From 8bfa1a083ce629172b8c8dec4891078a0b9c2374 Mon Sep 17 00:00:00 2001 From: Fabi <38692350+fgerschwiler@users.noreply.github.com> Date: Thu, 25 Jun 2020 08:01:13 +0200 Subject: [PATCH] feat: administrator (#271) * feat: get views and failed events * feat: get views and failed events * feat: get views and failed events * Update internal/view/repository/sequence.go Co-authored-by: Livio Amstutz * Update internal/view/repository/general_query.go Co-authored-by: Livio Amstutz Co-authored-by: Livio Amstutz --- internal/admin/repository/administrator.go | 13 + .../eventsourcing/eventstore/administrator.go | 50 + .../repository/eventsourcing/repository.go | 4 + .../eventsourcing/view/error_event.go | 18 +- .../repository/eventsourcing/view/org.go | 6 +- .../repository/eventsourcing/view/sequence.go | 16 +- internal/admin/repository/repository.go | 1 + .../eventsourcing/view/application.go | 6 +- .../eventsourcing/view/error_event.go | 10 +- .../auth/repository/eventsourcing/view/key.go | 6 +- .../auth/repository/eventsourcing/view/org.go | 6 +- .../repository/eventsourcing/view/sequence.go | 6 +- .../repository/eventsourcing/view/token.go | 6 +- .../repository/eventsourcing/view/user.go | 6 +- .../eventsourcing/view/user_grant.go | 6 +- .../eventsourcing/view/user_session.go | 6 +- .../eventsourcing/view/application.go | 6 +- .../eventsourcing/view/error_event.go | 10 +- .../repository/eventsourcing/view/sequence.go | 6 +- .../repository/eventsourcing/view/token.go | 6 +- .../eventsourcing/view/user_grant.go | 6 +- internal/eventstore/spooler/spooler.go | 6 +- internal/key/repository/view/key.go | 18 +- .../key/repository/view/model/key_query.go | 10 +- .../eventsourcing/view/application.go | 6 +- .../eventsourcing/view/error_event.go | 10 +- .../repository/eventsourcing/view/org.go | 6 +- .../eventsourcing/view/org_domain.go | 6 +- .../eventsourcing/view/org_member.go | 6 +- .../repository/eventsourcing/view/project.go | 6 +- .../eventsourcing/view/project_grant.go | 6 +- .../view/project_grant_member.go | 6 +- .../eventsourcing/view/project_member.go | 6 +- .../eventsourcing/view/project_role.go | 6 +- .../repository/eventsourcing/view/sequence.go | 6 +- .../repository/eventsourcing/view/user.go | 6 +- .../eventsourcing/view/user_grant.go | 6 +- .../eventsourcing/view/error_event.go | 10 +- .../eventsourcing/view/notification.go | 6 +- .../eventsourcing/view/notify_user.go | 6 +- .../repository/eventsourcing/view/sequence.go | 6 +- .../repository/view/model/org_domain_query.go | 10 +- .../repository/view/model/org_member_query.go | 10 +- .../org/repository/view/model/org_query.go | 10 +- .../org/repository/view/org_domain_view.go | 18 +- .../org/repository/view/org_member_view.go | 12 +- internal/org/repository/view/org_view.go | 10 +- .../repository/view/application_view.go | 14 +- .../view/model/application_query.go | 10 +- .../view/model/project_grant_member_query.go | 10 +- .../view/model/project_grant_query.go | 10 +- .../view/model/project_member_query.go | 10 +- .../repository/view/model/project_query.go | 10 +- .../view/model/project_role_query.go | 10 +- .../view/project_grant_member_view.go | 12 +- .../repository/view/project_grant_view.go | 16 +- .../repository/view/project_member_view.go | 12 +- .../repository/view/project_role_view.go | 14 +- .../project/repository/view/project_view.go | 12 +- .../repository/view/model/token_query.go | 10 +- internal/token/repository/view/token.go | 18 +- .../user/repository/view/model/user_query.go | 10 +- .../view/model/user_session_query.go | 10 +- internal/user/repository/view/notify_user.go | 8 +- .../user/repository/view/user_session_view.go | 12 +- internal/user/repository/view/user_view.go | 22 +- .../repository/view/model/user_grant_query.go | 10 +- .../repository/view/user_grant_view.go | 22 +- internal/view/model/failed_event.go | 9 + internal/view/model/general_query.go | 23 + internal/view/model/view.go | 7 + internal/view/{ => repository}/config.go | 2 +- .../view/{ => repository}/db_mock_test.go | 17 +- .../view/{ => repository}/failed_events.go | 41 +- internal/view/repository/general_query.go | 53 + internal/view/{ => repository}/query.go | 2 +- internal/view/{ => repository}/query_test.go | 2 +- internal/view/{ => repository}/requests.go | 14 +- .../view/{ => repository}/requests_test.go | 2 +- internal/view/{ => repository}/sequence.go | 36 +- migrations/cockroach/V1.22__admin_view.sql | 15 + pkg/admin/api/grpc/admin.pb.authoptions.go | 20 + pkg/admin/api/grpc/admin.pb.go | 3219 ++++++++++++----- pkg/admin/api/grpc/admin.pb.gw.go | 607 +--- pkg/admin/api/grpc/admin.swagger.json | 218 +- pkg/admin/api/grpc/administrator.go | 33 + pkg/admin/api/grpc/administrator_converter.go | 41 + pkg/admin/api/grpc/mock/admin.proto.mock.go | 80 + pkg/admin/api/grpc/server.go | 22 +- pkg/admin/api/proto/admin.proto | 77 +- 90 files changed, 3555 insertions(+), 1661 deletions(-) create mode 100644 internal/admin/repository/administrator.go create mode 100644 internal/admin/repository/eventsourcing/eventstore/administrator.go create mode 100644 internal/view/model/failed_event.go create mode 100644 internal/view/model/general_query.go create mode 100644 internal/view/model/view.go rename internal/view/{ => repository}/config.go (96%) rename internal/view/{ => repository}/db_mock_test.go (96%) rename internal/view/{ => repository}/failed_events.go (63%) create mode 100644 internal/view/repository/general_query.go rename internal/view/{ => repository}/query.go (99%) rename internal/view/{ => repository}/query_test.go (99%) rename internal/view/{ => repository}/requests.go (91%) rename internal/view/{ => repository}/requests_test.go (99%) rename internal/view/{ => repository}/sequence.go (58%) create mode 100644 migrations/cockroach/V1.22__admin_view.sql create mode 100644 pkg/admin/api/grpc/administrator.go create mode 100644 pkg/admin/api/grpc/administrator_converter.go diff --git a/internal/admin/repository/administrator.go b/internal/admin/repository/administrator.go new file mode 100644 index 0000000000..f091146a0b --- /dev/null +++ b/internal/admin/repository/administrator.go @@ -0,0 +1,13 @@ +package repository + +import ( + "context" + "github.com/caos/zitadel/internal/view/model" +) + +type AdministratorRepository interface { + GetFailedEvents(context.Context) ([]*model.FailedEvent, error) + RemoveFailedEvent(context.Context, *model.FailedEvent) error + GetViews(context.Context) ([]*model.View, error) + ClearView(ctx context.Context, db, view string) error +} diff --git a/internal/admin/repository/eventsourcing/eventstore/administrator.go b/internal/admin/repository/eventsourcing/eventstore/administrator.go new file mode 100644 index 0000000000..ab179e5308 --- /dev/null +++ b/internal/admin/repository/eventsourcing/eventstore/administrator.go @@ -0,0 +1,50 @@ +package eventstore + +import ( + "context" + "github.com/caos/zitadel/internal/admin/repository/eventsourcing/view" + view_model "github.com/caos/zitadel/internal/view/model" + "github.com/caos/zitadel/internal/view/repository" +) + +var dbList = []string{"management", "auth", "authz", "admin_api", "notification"} + +type AdministratorRepo struct { + View *view.View +} + +func (repo *AdministratorRepo) GetFailedEvents(ctx context.Context) ([]*view_model.FailedEvent, error) { + allFailedEvents := make([]*view_model.FailedEvent, 0) + for _, db := range dbList { + failedEvents, err := repo.View.AllFailedEvents(db) + if err != nil { + return nil, err + } + for _, failedEvent := range failedEvents { + allFailedEvents = append(allFailedEvents, repository.FailedEventToModel(failedEvent)) + } + } + return allFailedEvents, nil +} + +func (repo *AdministratorRepo) RemoveFailedEvent(ctx context.Context, failedEvent *view_model.FailedEvent) error { + return repo.View.RemoveFailedEvent(failedEvent.Database, repository.FailedEventFromModel(failedEvent)) +} + +func (repo *AdministratorRepo) GetViews(ctx context.Context) ([]*view_model.View, error) { + views := make([]*view_model.View, 0) + for _, db := range dbList { + sequences, err := repo.View.AllCurrentSequences(db) + if err != nil { + return nil, err + } + for _, sequence := range sequences { + views = append(views, repository.CurrentSequenceToModel(sequence)) + } + } + return views, nil +} + +func (repo *AdministratorRepo) ClearView(ctx context.Context, database, view string) error { + return repo.View.ClearView(database, view) +} diff --git a/internal/admin/repository/eventsourcing/repository.go b/internal/admin/repository/eventsourcing/repository.go index ea40f9070e..8b77e5fe8f 100644 --- a/internal/admin/repository/eventsourcing/repository.go +++ b/internal/admin/repository/eventsourcing/repository.go @@ -30,6 +30,7 @@ type Config struct { type EsRepository struct { spooler *es_spol.Spooler eventstore.OrgRepo + eventstore.AdministratorRepo } func Start(ctx context.Context, conf Config, systemDefaults sd.SystemDefaults) (*EsRepository, error) { @@ -95,6 +96,9 @@ func Start(ctx context.Context, conf Config, systemDefaults sd.SystemDefaults) ( View: view, SearchLimit: conf.SearchLimit, }, + AdministratorRepo: eventstore.AdministratorRepo{ + View: view, + }, }, nil } diff --git a/internal/admin/repository/eventsourcing/view/error_event.go b/internal/admin/repository/eventsourcing/view/error_event.go index 7f3c9ff3fb..7d2928e5dd 100644 --- a/internal/admin/repository/eventsourcing/view/error_event.go +++ b/internal/admin/repository/eventsourcing/view/error_event.go @@ -1,17 +1,25 @@ package view import ( - "github.com/caos/zitadel/internal/view" + "github.com/caos/zitadel/internal/view/repository" ) const ( errTable = "admin_api.failed_event" ) -func (v *View) saveFailedEvent(failedEvent *view.FailedEvent) error { - return view.SaveFailedEvent(v.Db, errTable, failedEvent) +func (v *View) saveFailedEvent(failedEvent *repository.FailedEvent) error { + return repository.SaveFailedEvent(v.Db, errTable, failedEvent) } -func (v *View) latestFailedEvent(viewName string, sequence uint64) (*view.FailedEvent, error) { - return view.LatestFailedEvent(v.Db, errTable, viewName, sequence) +func (v *View) RemoveFailedEvent(database string, failedEvent *repository.FailedEvent) error { + return repository.RemoveFailedEvent(v.Db, database+".failed_event", failedEvent) +} + +func (v *View) latestFailedEvent(viewName string, sequence uint64) (*repository.FailedEvent, error) { + return repository.LatestFailedEvent(v.Db, errTable, viewName, sequence) +} + +func (v *View) AllFailedEvents(db string) ([]*repository.FailedEvent, error) { + return repository.AllFailedEvents(v.Db, db+".failed_event") } diff --git a/internal/admin/repository/eventsourcing/view/org.go b/internal/admin/repository/eventsourcing/view/org.go index 2227f3cce8..efd1a29652 100644 --- a/internal/admin/repository/eventsourcing/view/org.go +++ b/internal/admin/repository/eventsourcing/view/org.go @@ -4,7 +4,7 @@ import ( org_model "github.com/caos/zitadel/internal/org/model" org_view "github.com/caos/zitadel/internal/org/repository/view" "github.com/caos/zitadel/internal/org/repository/view/model" - "github.com/caos/zitadel/internal/view" + "github.com/caos/zitadel/internal/view/repository" ) const ( @@ -27,11 +27,11 @@ func (v *View) PutOrg(org *model.OrgView) error { return v.ProcessedOrgSequence(org.Sequence) } -func (v *View) GetLatestOrgFailedEvent(sequence uint64) (*view.FailedEvent, error) { +func (v *View) GetLatestOrgFailedEvent(sequence uint64) (*repository.FailedEvent, error) { return v.latestFailedEvent(orgTable, sequence) } -func (v *View) ProcessedOrgFailedEvent(failedEvent *view.FailedEvent) error { +func (v *View) ProcessedOrgFailedEvent(failedEvent *repository.FailedEvent) error { return v.saveFailedEvent(failedEvent) } diff --git a/internal/admin/repository/eventsourcing/view/sequence.go b/internal/admin/repository/eventsourcing/view/sequence.go index 7f5db354a3..df08594f91 100644 --- a/internal/admin/repository/eventsourcing/view/sequence.go +++ b/internal/admin/repository/eventsourcing/view/sequence.go @@ -1,7 +1,7 @@ package view import ( - "github.com/caos/zitadel/internal/view" + "github.com/caos/zitadel/internal/view/repository" ) const ( @@ -9,9 +9,19 @@ const ( ) func (v *View) saveCurrentSequence(viewName string, sequence uint64) error { - return view.SaveCurrentSequence(v.Db, sequencesTable, viewName, sequence) + return repository.SaveCurrentSequence(v.Db, sequencesTable, viewName, sequence) } func (v *View) latestSequence(viewName string) (uint64, error) { - return view.LatestSequence(v.Db, sequencesTable, viewName) + return repository.LatestSequence(v.Db, sequencesTable, viewName) +} + +func (v *View) AllCurrentSequences(db string) ([]*repository.CurrentSequence, error) { + return repository.AllCurrentSequences(v.Db, db+".current_sequences") +} + +func (v *View) ClearView(db, viewName string) error { + truncateView := db + "." + viewName + sequenceTable := db + ".current_sequences" + return repository.ClearView(v.Db, truncateView, sequenceTable) } diff --git a/internal/admin/repository/repository.go b/internal/admin/repository/repository.go index 9ca914675c..5eb3296d06 100644 --- a/internal/admin/repository/repository.go +++ b/internal/admin/repository/repository.go @@ -5,4 +5,5 @@ import "context" type Repository interface { Health(ctx context.Context) error OrgRepository + AdministratorRepository } diff --git a/internal/auth/repository/eventsourcing/view/application.go b/internal/auth/repository/eventsourcing/view/application.go index 75cf45e1f4..90b2315623 100644 --- a/internal/auth/repository/eventsourcing/view/application.go +++ b/internal/auth/repository/eventsourcing/view/application.go @@ -2,13 +2,13 @@ package view import ( "context" + "github.com/caos/zitadel/internal/view/repository" "github.com/caos/zitadel/internal/errors" global_model "github.com/caos/zitadel/internal/model" proj_model "github.com/caos/zitadel/internal/project/model" "github.com/caos/zitadel/internal/project/repository/view" "github.com/caos/zitadel/internal/project/repository/view/model" - global_view "github.com/caos/zitadel/internal/view" ) const ( @@ -47,11 +47,11 @@ func (v *View) ProcessedApplicationSequence(eventSequence uint64) error { return v.saveCurrentSequence(applicationTable, eventSequence) } -func (v *View) GetLatestApplicationFailedEvent(sequence uint64) (*global_view.FailedEvent, error) { +func (v *View) GetLatestApplicationFailedEvent(sequence uint64) (*repository.FailedEvent, error) { return v.latestFailedEvent(applicationTable, sequence) } -func (v *View) ProcessedApplicationFailedEvent(failedEvent *global_view.FailedEvent) error { +func (v *View) ProcessedApplicationFailedEvent(failedEvent *repository.FailedEvent) error { return v.saveFailedEvent(failedEvent) } diff --git a/internal/auth/repository/eventsourcing/view/error_event.go b/internal/auth/repository/eventsourcing/view/error_event.go index 6ef28c1f69..81ea49081b 100644 --- a/internal/auth/repository/eventsourcing/view/error_event.go +++ b/internal/auth/repository/eventsourcing/view/error_event.go @@ -1,17 +1,17 @@ package view import ( - "github.com/caos/zitadel/internal/view" + "github.com/caos/zitadel/internal/view/repository" ) const ( errTable = "auth.failed_event" ) -func (v *View) saveFailedEvent(failedEvent *view.FailedEvent) error { - return view.SaveFailedEvent(v.Db, errTable, failedEvent) +func (v *View) saveFailedEvent(failedEvent *repository.FailedEvent) error { + return repository.SaveFailedEvent(v.Db, errTable, failedEvent) } -func (v *View) latestFailedEvent(viewName string, sequence uint64) (*view.FailedEvent, error) { - return view.LatestFailedEvent(v.Db, errTable, viewName, sequence) +func (v *View) latestFailedEvent(viewName string, sequence uint64) (*repository.FailedEvent, error) { + return repository.LatestFailedEvent(v.Db, errTable, viewName, sequence) } diff --git a/internal/auth/repository/eventsourcing/view/key.go b/internal/auth/repository/eventsourcing/view/key.go index a5b07ff62a..ade9a9b416 100644 --- a/internal/auth/repository/eventsourcing/view/key.go +++ b/internal/auth/repository/eventsourcing/view/key.go @@ -4,7 +4,7 @@ import ( key_model "github.com/caos/zitadel/internal/key/model" "github.com/caos/zitadel/internal/key/repository/view" "github.com/caos/zitadel/internal/key/repository/view/model" - global_view "github.com/caos/zitadel/internal/view" + "github.com/caos/zitadel/internal/view/repository" ) const ( @@ -63,10 +63,10 @@ func (v *View) ProcessedKeySequence(eventSequence uint64) error { return v.saveCurrentSequence(keyTable, eventSequence) } -func (v *View) GetLatestKeyFailedEvent(sequence uint64) (*global_view.FailedEvent, error) { +func (v *View) GetLatestKeyFailedEvent(sequence uint64) (*repository.FailedEvent, error) { return v.latestFailedEvent(keyTable, sequence) } -func (v *View) ProcessedKeyFailedEvent(failedEvent *global_view.FailedEvent) error { +func (v *View) ProcessedKeyFailedEvent(failedEvent *repository.FailedEvent) error { return v.saveFailedEvent(failedEvent) } diff --git a/internal/auth/repository/eventsourcing/view/org.go b/internal/auth/repository/eventsourcing/view/org.go index b79ee3d6bb..9d59c14d95 100644 --- a/internal/auth/repository/eventsourcing/view/org.go +++ b/internal/auth/repository/eventsourcing/view/org.go @@ -4,7 +4,7 @@ import ( "github.com/caos/zitadel/internal/org/model" org_view "github.com/caos/zitadel/internal/org/repository/view" org_model "github.com/caos/zitadel/internal/org/repository/view/model" - "github.com/caos/zitadel/internal/view" + "github.com/caos/zitadel/internal/view/repository" ) const ( @@ -27,11 +27,11 @@ func (v *View) PutOrg(org *org_model.OrgView) error { return v.ProcessedOrgSequence(org.Sequence) } -func (v *View) GetLatestOrgFailedEvent(sequence uint64) (*view.FailedEvent, error) { +func (v *View) GetLatestOrgFailedEvent(sequence uint64) (*repository.FailedEvent, error) { return v.latestFailedEvent(orgTable, sequence) } -func (v *View) ProcessedOrgFailedEvent(failedEvent *view.FailedEvent) error { +func (v *View) ProcessedOrgFailedEvent(failedEvent *repository.FailedEvent) error { return v.saveFailedEvent(failedEvent) } diff --git a/internal/auth/repository/eventsourcing/view/sequence.go b/internal/auth/repository/eventsourcing/view/sequence.go index 3026a1e4ea..0aa8642869 100644 --- a/internal/auth/repository/eventsourcing/view/sequence.go +++ b/internal/auth/repository/eventsourcing/view/sequence.go @@ -1,7 +1,7 @@ package view import ( - "github.com/caos/zitadel/internal/view" + "github.com/caos/zitadel/internal/view/repository" ) const ( @@ -9,9 +9,9 @@ const ( ) func (v *View) saveCurrentSequence(viewName string, sequence uint64) error { - return view.SaveCurrentSequence(v.Db, sequencesTable, viewName, sequence) + return repository.SaveCurrentSequence(v.Db, sequencesTable, viewName, sequence) } func (v *View) latestSequence(viewName string) (uint64, error) { - return view.LatestSequence(v.Db, sequencesTable, viewName) + return repository.LatestSequence(v.Db, sequencesTable, viewName) } diff --git a/internal/auth/repository/eventsourcing/view/token.go b/internal/auth/repository/eventsourcing/view/token.go index 3e37c2ed55..80ad659184 100644 --- a/internal/auth/repository/eventsourcing/view/token.go +++ b/internal/auth/repository/eventsourcing/view/token.go @@ -1,11 +1,11 @@ package view import ( + "github.com/caos/zitadel/internal/view/repository" "time" "github.com/caos/zitadel/internal/token/repository/view" "github.com/caos/zitadel/internal/token/repository/view/model" - global_view "github.com/caos/zitadel/internal/view" ) const ( @@ -90,10 +90,10 @@ func (v *View) ProcessedTokenSequence(eventSequence uint64) error { return v.saveCurrentSequence(tokenTable, eventSequence) } -func (v *View) GetLatestTokenFailedEvent(sequence uint64) (*global_view.FailedEvent, error) { +func (v *View) GetLatestTokenFailedEvent(sequence uint64) (*repository.FailedEvent, error) { return v.latestFailedEvent(tokenTable, sequence) } -func (v *View) ProcessedTokenFailedEvent(failedEvent *global_view.FailedEvent) error { +func (v *View) ProcessedTokenFailedEvent(failedEvent *repository.FailedEvent) error { return v.saveFailedEvent(failedEvent) } diff --git a/internal/auth/repository/eventsourcing/view/user.go b/internal/auth/repository/eventsourcing/view/user.go index f843cf2cdd..c24c6a0c46 100644 --- a/internal/auth/repository/eventsourcing/view/user.go +++ b/internal/auth/repository/eventsourcing/view/user.go @@ -4,7 +4,7 @@ import ( usr_model "github.com/caos/zitadel/internal/user/model" "github.com/caos/zitadel/internal/user/repository/view" "github.com/caos/zitadel/internal/user/repository/view/model" - global_view "github.com/caos/zitadel/internal/view" + "github.com/caos/zitadel/internal/view/repository" ) const ( @@ -66,10 +66,10 @@ func (v *View) ProcessedUserSequence(eventSequence uint64) error { return v.saveCurrentSequence(userTable, eventSequence) } -func (v *View) GetLatestUserFailedEvent(sequence uint64) (*global_view.FailedEvent, error) { +func (v *View) GetLatestUserFailedEvent(sequence uint64) (*repository.FailedEvent, error) { return v.latestFailedEvent(userTable, sequence) } -func (v *View) ProcessedUserFailedEvent(failedEvent *global_view.FailedEvent) error { +func (v *View) ProcessedUserFailedEvent(failedEvent *repository.FailedEvent) error { return v.saveFailedEvent(failedEvent) } diff --git a/internal/auth/repository/eventsourcing/view/user_grant.go b/internal/auth/repository/eventsourcing/view/user_grant.go index d4f8dd1573..a2679d779b 100644 --- a/internal/auth/repository/eventsourcing/view/user_grant.go +++ b/internal/auth/repository/eventsourcing/view/user_grant.go @@ -4,7 +4,7 @@ import ( grant_model "github.com/caos/zitadel/internal/usergrant/model" "github.com/caos/zitadel/internal/usergrant/repository/view" "github.com/caos/zitadel/internal/usergrant/repository/view/model" - global_view "github.com/caos/zitadel/internal/view" + "github.com/caos/zitadel/internal/view/repository" ) const ( @@ -55,10 +55,10 @@ func (v *View) ProcessedUserGrantSequence(eventSequence uint64) error { return v.saveCurrentSequence(userGrantTable, eventSequence) } -func (v *View) GetLatestUserGrantFailedEvent(sequence uint64) (*global_view.FailedEvent, error) { +func (v *View) GetLatestUserGrantFailedEvent(sequence uint64) (*repository.FailedEvent, error) { return v.latestFailedEvent(userGrantTable, sequence) } -func (v *View) ProcessedUserGrantFailedEvent(failedEvent *global_view.FailedEvent) error { +func (v *View) ProcessedUserGrantFailedEvent(failedEvent *repository.FailedEvent) error { return v.saveFailedEvent(failedEvent) } diff --git a/internal/auth/repository/eventsourcing/view/user_session.go b/internal/auth/repository/eventsourcing/view/user_session.go index fd02f989c4..bb4cb850a8 100644 --- a/internal/auth/repository/eventsourcing/view/user_session.go +++ b/internal/auth/repository/eventsourcing/view/user_session.go @@ -3,7 +3,7 @@ package view import ( "github.com/caos/zitadel/internal/user/repository/view" "github.com/caos/zitadel/internal/user/repository/view/model" - global_view "github.com/caos/zitadel/internal/view" + "github.com/caos/zitadel/internal/view/repository" ) const ( @@ -46,10 +46,10 @@ func (v *View) ProcessedUserSessionSequence(eventSequence uint64) error { return v.saveCurrentSequence(userSessionTable, eventSequence) } -func (v *View) GetLatestUserSessionFailedEvent(sequence uint64) (*global_view.FailedEvent, error) { +func (v *View) GetLatestUserSessionFailedEvent(sequence uint64) (*repository.FailedEvent, error) { return v.latestFailedEvent(userSessionTable, sequence) } -func (v *View) ProcessedUserSessionFailedEvent(failedEvent *global_view.FailedEvent) error { +func (v *View) ProcessedUserSessionFailedEvent(failedEvent *repository.FailedEvent) error { return v.saveFailedEvent(failedEvent) } diff --git a/internal/authz/repository/eventsourcing/view/application.go b/internal/authz/repository/eventsourcing/view/application.go index e99a01950f..f2880d4973 100644 --- a/internal/authz/repository/eventsourcing/view/application.go +++ b/internal/authz/repository/eventsourcing/view/application.go @@ -4,7 +4,7 @@ import ( proj_model "github.com/caos/zitadel/internal/project/model" "github.com/caos/zitadel/internal/project/repository/view" "github.com/caos/zitadel/internal/project/repository/view/model" - global_view "github.com/caos/zitadel/internal/view" + "github.com/caos/zitadel/internal/view/repository" ) const ( @@ -51,10 +51,10 @@ func (v *View) ProcessedApplicationSequence(eventSequence uint64) error { return v.saveCurrentSequence(applicationTable, eventSequence) } -func (v *View) GetLatestApplicationFailedEvent(sequence uint64) (*global_view.FailedEvent, error) { +func (v *View) GetLatestApplicationFailedEvent(sequence uint64) (*repository.FailedEvent, error) { return v.latestFailedEvent(applicationTable, sequence) } -func (v *View) ProcessedApplicationFailedEvent(failedEvent *global_view.FailedEvent) error { +func (v *View) ProcessedApplicationFailedEvent(failedEvent *repository.FailedEvent) error { return v.saveFailedEvent(failedEvent) } diff --git a/internal/authz/repository/eventsourcing/view/error_event.go b/internal/authz/repository/eventsourcing/view/error_event.go index a6e8bb9927..9b707b0004 100644 --- a/internal/authz/repository/eventsourcing/view/error_event.go +++ b/internal/authz/repository/eventsourcing/view/error_event.go @@ -1,17 +1,17 @@ package view import ( - "github.com/caos/zitadel/internal/view" + "github.com/caos/zitadel/internal/view/repository" ) const ( errTable = "authz.failed_event" ) -func (v *View) saveFailedEvent(failedEvent *view.FailedEvent) error { - return view.SaveFailedEvent(v.Db, errTable, failedEvent) +func (v *View) saveFailedEvent(failedEvent *repository.FailedEvent) error { + return repository.SaveFailedEvent(v.Db, errTable, failedEvent) } -func (v *View) latestFailedEvent(viewName string, sequence uint64) (*view.FailedEvent, error) { - return view.LatestFailedEvent(v.Db, errTable, viewName, sequence) +func (v *View) latestFailedEvent(viewName string, sequence uint64) (*repository.FailedEvent, error) { + return repository.LatestFailedEvent(v.Db, errTable, viewName, sequence) } diff --git a/internal/authz/repository/eventsourcing/view/sequence.go b/internal/authz/repository/eventsourcing/view/sequence.go index ddcfafbf62..7304589973 100644 --- a/internal/authz/repository/eventsourcing/view/sequence.go +++ b/internal/authz/repository/eventsourcing/view/sequence.go @@ -1,7 +1,7 @@ package view import ( - "github.com/caos/zitadel/internal/view" + "github.com/caos/zitadel/internal/view/repository" ) const ( @@ -9,9 +9,9 @@ const ( ) func (v *View) saveCurrentSequence(viewName string, sequence uint64) error { - return view.SaveCurrentSequence(v.Db, sequencesTable, viewName, sequence) + return repository.SaveCurrentSequence(v.Db, sequencesTable, viewName, sequence) } func (v *View) latestSequence(viewName string) (uint64, error) { - return view.LatestSequence(v.Db, sequencesTable, viewName) + return repository.LatestSequence(v.Db, sequencesTable, viewName) } diff --git a/internal/authz/repository/eventsourcing/view/token.go b/internal/authz/repository/eventsourcing/view/token.go index 230d46d3a1..bf4ec608b8 100644 --- a/internal/authz/repository/eventsourcing/view/token.go +++ b/internal/authz/repository/eventsourcing/view/token.go @@ -3,7 +3,7 @@ package view import ( "github.com/caos/zitadel/internal/token/repository/view" "github.com/caos/zitadel/internal/token/repository/view/model" - global_view "github.com/caos/zitadel/internal/view" + "github.com/caos/zitadel/internal/view/repository" ) const ( @@ -50,10 +50,10 @@ func (v *View) ProcessedTokenSequence(eventSequence uint64) error { return v.saveCurrentSequence(tokenTable, eventSequence) } -func (v *View) GetLatestTokenFailedEvent(sequence uint64) (*global_view.FailedEvent, error) { +func (v *View) GetLatestTokenFailedEvent(sequence uint64) (*repository.FailedEvent, error) { return v.latestFailedEvent(tokenTable, sequence) } -func (v *View) ProcessedTokenFailedEvent(failedEvent *global_view.FailedEvent) error { +func (v *View) ProcessedTokenFailedEvent(failedEvent *repository.FailedEvent) error { return v.saveFailedEvent(failedEvent) } diff --git a/internal/authz/repository/eventsourcing/view/user_grant.go b/internal/authz/repository/eventsourcing/view/user_grant.go index f4b01adfd8..88d8045e6e 100644 --- a/internal/authz/repository/eventsourcing/view/user_grant.go +++ b/internal/authz/repository/eventsourcing/view/user_grant.go @@ -4,7 +4,7 @@ import ( grant_model "github.com/caos/zitadel/internal/usergrant/model" "github.com/caos/zitadel/internal/usergrant/repository/view" "github.com/caos/zitadel/internal/usergrant/repository/view/model" - global_view "github.com/caos/zitadel/internal/view" + "github.com/caos/zitadel/internal/view/repository" ) const ( @@ -55,10 +55,10 @@ func (v *View) ProcessedUserGrantSequence(eventSequence uint64) error { return v.saveCurrentSequence(userGrantTable, eventSequence) } -func (v *View) GetLatestUserGrantFailedEvent(sequence uint64) (*global_view.FailedEvent, error) { +func (v *View) GetLatestUserGrantFailedEvent(sequence uint64) (*repository.FailedEvent, error) { return v.latestFailedEvent(userGrantTable, sequence) } -func (v *View) ProcessedUserGrantFailedEvent(failedEvent *global_view.FailedEvent) error { +func (v *View) ProcessedUserGrantFailedEvent(failedEvent *repository.FailedEvent) error { return v.saveFailedEvent(failedEvent) } diff --git a/internal/eventstore/spooler/spooler.go b/internal/eventstore/spooler/spooler.go index 51bfacab55..ee7882f064 100644 --- a/internal/eventstore/spooler/spooler.go +++ b/internal/eventstore/spooler/spooler.go @@ -6,7 +6,7 @@ import ( "github.com/caos/zitadel/internal/eventstore" "github.com/caos/zitadel/internal/eventstore/models" "github.com/caos/zitadel/internal/eventstore/query" - global_view "github.com/caos/zitadel/internal/view" + "github.com/caos/zitadel/internal/view/repository" "time" ) @@ -104,8 +104,8 @@ func (s *spooledHandler) process(ctx context.Context, events []*models.Event) er } func HandleError(event *models.Event, failedErr error, - latestFailedEvent func(sequence uint64) (*global_view.FailedEvent, error), - processFailedEvent func(*global_view.FailedEvent) error, + latestFailedEvent func(sequence uint64) (*repository.FailedEvent, error), + processFailedEvent func(*repository.FailedEvent) error, processSequence func(uint64) error, errorCountUntilSkip uint64) error { failedEvent, err := latestFailedEvent(event.Sequence) if err != nil { diff --git a/internal/key/repository/view/key.go b/internal/key/repository/view/key.go index b9439c2460..ebdddd762c 100644 --- a/internal/key/repository/view/key.go +++ b/internal/key/repository/view/key.go @@ -1,6 +1,7 @@ package view import ( + "github.com/caos/zitadel/internal/view/repository" "time" "github.com/jinzhu/gorm" @@ -8,12 +9,11 @@ import ( key_model "github.com/caos/zitadel/internal/key/model" "github.com/caos/zitadel/internal/key/repository/view/model" global_model "github.com/caos/zitadel/internal/model" - "github.com/caos/zitadel/internal/view" ) func KeyByIDAndType(db *gorm.DB, table, keyID string, private bool) (*model.KeyView, error) { key := new(model.KeyView) - query := view.PrepareGetByQuery(table, + query := repository.PrepareGetByQuery(table, model.KeySearchQuery{Key: key_model.KeySearchKeyID, Method: global_model.SearchMethodEquals, Value: keyID}, model.KeySearchQuery{Key: key_model.KeySearchKeyPrivate, Method: global_model.SearchMethodEquals, Value: private}, ) @@ -23,7 +23,7 @@ func KeyByIDAndType(db *gorm.DB, table, keyID string, private bool) (*model.KeyV func GetSigningKey(db *gorm.DB, table string) (*model.KeyView, error) { key := new(model.KeyView) - query := view.PrepareGetByQuery(table, + query := repository.PrepareGetByQuery(table, model.KeySearchQuery{Key: key_model.KeySearchKeyPrivate, Method: global_model.SearchMethodEquals, Value: true}, model.KeySearchQuery{Key: key_model.KeySearchKeyUsage, Method: global_model.SearchMethodEquals, Value: key_model.KeyUsageSigning}, model.KeySearchQuery{Key: key_model.KeySearchKeyExpiry, Method: global_model.SearchMethodGreaterThan, Value: time.Now().UTC()}, @@ -34,7 +34,7 @@ func GetSigningKey(db *gorm.DB, table string) (*model.KeyView, error) { func GetActivePublicKeys(db *gorm.DB, table string) ([]*model.KeyView, error) { keys := make([]*model.KeyView, 0) - query := view.PrepareSearchQuery(table, + query := repository.PrepareSearchQuery(table, model.KeySearchRequest{ Queries: []*key_model.KeySearchQuery{ {Key: key_model.KeySearchKeyPrivate, Method: global_model.SearchMethodEquals, Value: false}, @@ -48,7 +48,7 @@ func GetActivePublicKeys(db *gorm.DB, table string) ([]*model.KeyView, error) { } func PutKeys(db *gorm.DB, table string, privateKey, publicKey *model.KeyView) error { - save := view.PrepareSave(table) + save := repository.PrepareSave(table) err := save(db, privateKey) if err != nil { return err @@ -57,14 +57,14 @@ func PutKeys(db *gorm.DB, table string, privateKey, publicKey *model.KeyView) er } func DeleteKey(db *gorm.DB, table, keyID string, private bool) error { - delete := view.PrepareDeleteByKeys(table, - view.Key{Key: model.KeySearchKey(key_model.KeySearchKeyID), Value: keyID}, - view.Key{Key: model.KeySearchKey(key_model.KeySearchKeyPrivate), Value: private}, + delete := repository.PrepareDeleteByKeys(table, + repository.Key{Key: model.KeySearchKey(key_model.KeySearchKeyID), Value: keyID}, + repository.Key{Key: model.KeySearchKey(key_model.KeySearchKeyPrivate), Value: private}, ) return delete(db) } func DeleteKeyPair(db *gorm.DB, table, keyID string) error { - delete := view.PrepareDeleteByKey(table, model.KeySearchKey(key_model.KeySearchKeyID), keyID) + delete := repository.PrepareDeleteByKey(table, model.KeySearchKey(key_model.KeySearchKeyID), keyID) return delete(db) } diff --git a/internal/key/repository/view/model/key_query.go b/internal/key/repository/view/model/key_query.go index 8af86159ef..85ffd3508c 100644 --- a/internal/key/repository/view/model/key_query.go +++ b/internal/key/repository/view/model/key_query.go @@ -3,7 +3,7 @@ package model import ( key_model "github.com/caos/zitadel/internal/key/model" global_model "github.com/caos/zitadel/internal/model" - "github.com/caos/zitadel/internal/view" + "github.com/caos/zitadel/internal/view/repository" ) type KeySearchRequest key_model.KeySearchRequest @@ -18,7 +18,7 @@ func (req KeySearchRequest) GetOffset() uint64 { return req.Offset } -func (req KeySearchRequest) GetSortingColumn() view.ColumnKey { +func (req KeySearchRequest) GetSortingColumn() repository.ColumnKey { if req.SortingColumn == key_model.KeySearchKeyUnspecified { return nil } @@ -29,15 +29,15 @@ func (req KeySearchRequest) GetAsc() bool { return req.Asc } -func (req KeySearchRequest) GetQueries() []view.SearchQuery { - result := make([]view.SearchQuery, len(req.Queries)) +func (req KeySearchRequest) GetQueries() []repository.SearchQuery { + result := make([]repository.SearchQuery, len(req.Queries)) for i, q := range req.Queries { result[i] = KeySearchQuery{Key: q.Key, Value: q.Value, Method: q.Method} } return result } -func (req KeySearchQuery) GetKey() view.ColumnKey { +func (req KeySearchQuery) GetKey() repository.ColumnKey { return KeySearchKey(req.Key) } diff --git a/internal/management/repository/eventsourcing/view/application.go b/internal/management/repository/eventsourcing/view/application.go index 9154a303b6..bb0ffe9be6 100644 --- a/internal/management/repository/eventsourcing/view/application.go +++ b/internal/management/repository/eventsourcing/view/application.go @@ -4,7 +4,7 @@ import ( proj_model "github.com/caos/zitadel/internal/project/model" "github.com/caos/zitadel/internal/project/repository/view" "github.com/caos/zitadel/internal/project/repository/view/model" - global_view "github.com/caos/zitadel/internal/view" + "github.com/caos/zitadel/internal/view/repository" ) const ( @@ -43,10 +43,10 @@ func (v *View) ProcessedApplicationSequence(eventSequence uint64) error { return v.saveCurrentSequence(applicationTable, eventSequence) } -func (v *View) GetLatestApplicationFailedEvent(sequence uint64) (*global_view.FailedEvent, error) { +func (v *View) GetLatestApplicationFailedEvent(sequence uint64) (*repository.FailedEvent, error) { return v.latestFailedEvent(applicationTable, sequence) } -func (v *View) ProcessedApplicationFailedEvent(failedEvent *global_view.FailedEvent) error { +func (v *View) ProcessedApplicationFailedEvent(failedEvent *repository.FailedEvent) error { return v.saveFailedEvent(failedEvent) } diff --git a/internal/management/repository/eventsourcing/view/error_event.go b/internal/management/repository/eventsourcing/view/error_event.go index 0b74d537ad..80dbf2902e 100644 --- a/internal/management/repository/eventsourcing/view/error_event.go +++ b/internal/management/repository/eventsourcing/view/error_event.go @@ -1,17 +1,17 @@ package view import ( - "github.com/caos/zitadel/internal/view" + "github.com/caos/zitadel/internal/view/repository" ) const ( errTable = "management.failed_event" ) -func (v *View) saveFailedEvent(failedEvent *view.FailedEvent) error { - return view.SaveFailedEvent(v.Db, errTable, failedEvent) +func (v *View) saveFailedEvent(failedEvent *repository.FailedEvent) error { + return repository.SaveFailedEvent(v.Db, errTable, failedEvent) } -func (v *View) latestFailedEvent(viewName string, sequence uint64) (*view.FailedEvent, error) { - return view.LatestFailedEvent(v.Db, errTable, viewName, sequence) +func (v *View) latestFailedEvent(viewName string, sequence uint64) (*repository.FailedEvent, error) { + return repository.LatestFailedEvent(v.Db, errTable, viewName, sequence) } diff --git a/internal/management/repository/eventsourcing/view/org.go b/internal/management/repository/eventsourcing/view/org.go index 1eeb91c09c..718c47929b 100644 --- a/internal/management/repository/eventsourcing/view/org.go +++ b/internal/management/repository/eventsourcing/view/org.go @@ -3,7 +3,7 @@ package view import ( org_view "github.com/caos/zitadel/internal/org/repository/view" "github.com/caos/zitadel/internal/org/repository/view/model" - "github.com/caos/zitadel/internal/view" + "github.com/caos/zitadel/internal/view/repository" ) const ( @@ -22,11 +22,11 @@ func (v *View) PutOrg(org *model.OrgView) error { return v.ProcessedOrgSequence(org.Sequence) } -func (v *View) GetLatestOrgFailedEvent(sequence uint64) (*view.FailedEvent, error) { +func (v *View) GetLatestOrgFailedEvent(sequence uint64) (*repository.FailedEvent, error) { return v.latestFailedEvent(orgTable, sequence) } -func (v *View) ProcessedOrgFailedEvent(failedEvent *view.FailedEvent) error { +func (v *View) ProcessedOrgFailedEvent(failedEvent *repository.FailedEvent) error { return v.saveFailedEvent(failedEvent) } diff --git a/internal/management/repository/eventsourcing/view/org_domain.go b/internal/management/repository/eventsourcing/view/org_domain.go index facb8a2eb0..c42f784e90 100644 --- a/internal/management/repository/eventsourcing/view/org_domain.go +++ b/internal/management/repository/eventsourcing/view/org_domain.go @@ -4,7 +4,7 @@ import ( org_model "github.com/caos/zitadel/internal/org/model" "github.com/caos/zitadel/internal/org/repository/view" "github.com/caos/zitadel/internal/org/repository/view/model" - global_view "github.com/caos/zitadel/internal/view" + "github.com/caos/zitadel/internal/view/repository" ) const ( @@ -54,10 +54,10 @@ func (v *View) ProcessedOrgDomainSequence(eventSequence uint64) error { return v.saveCurrentSequence(orgDomainTable, eventSequence) } -func (v *View) GetLatestOrgDomainFailedEvent(sequence uint64) (*global_view.FailedEvent, error) { +func (v *View) GetLatestOrgDomainFailedEvent(sequence uint64) (*repository.FailedEvent, error) { return v.latestFailedEvent(orgDomainTable, sequence) } -func (v *View) ProcessedOrgDomainFailedEvent(failedEvent *global_view.FailedEvent) error { +func (v *View) ProcessedOrgDomainFailedEvent(failedEvent *repository.FailedEvent) error { return v.saveFailedEvent(failedEvent) } diff --git a/internal/management/repository/eventsourcing/view/org_member.go b/internal/management/repository/eventsourcing/view/org_member.go index c4c13b711e..365b35dca3 100644 --- a/internal/management/repository/eventsourcing/view/org_member.go +++ b/internal/management/repository/eventsourcing/view/org_member.go @@ -4,7 +4,7 @@ import ( org_model "github.com/caos/zitadel/internal/org/model" "github.com/caos/zitadel/internal/org/repository/view" "github.com/caos/zitadel/internal/org/repository/view/model" - global_view "github.com/caos/zitadel/internal/view" + "github.com/caos/zitadel/internal/view/repository" ) const ( @@ -47,10 +47,10 @@ func (v *View) ProcessedOrgMemberSequence(eventSequence uint64) error { return v.saveCurrentSequence(orgMemberTable, eventSequence) } -func (v *View) GetLatestOrgMemberFailedEvent(sequence uint64) (*global_view.FailedEvent, error) { +func (v *View) GetLatestOrgMemberFailedEvent(sequence uint64) (*repository.FailedEvent, error) { return v.latestFailedEvent(orgMemberTable, sequence) } -func (v *View) ProcessedOrgMemberFailedEvent(failedEvent *global_view.FailedEvent) error { +func (v *View) ProcessedOrgMemberFailedEvent(failedEvent *repository.FailedEvent) error { return v.saveFailedEvent(failedEvent) } diff --git a/internal/management/repository/eventsourcing/view/project.go b/internal/management/repository/eventsourcing/view/project.go index 3fd43755c0..93f7bedfa1 100644 --- a/internal/management/repository/eventsourcing/view/project.go +++ b/internal/management/repository/eventsourcing/view/project.go @@ -4,7 +4,7 @@ import ( proj_model "github.com/caos/zitadel/internal/project/model" "github.com/caos/zitadel/internal/project/repository/view" "github.com/caos/zitadel/internal/project/repository/view/model" - global_view "github.com/caos/zitadel/internal/view" + "github.com/caos/zitadel/internal/view/repository" ) const ( @@ -43,10 +43,10 @@ func (v *View) ProcessedProjectSequence(eventSequence uint64) error { return v.saveCurrentSequence(projectTable, eventSequence) } -func (v *View) GetLatestProjectFailedEvent(sequence uint64) (*global_view.FailedEvent, error) { +func (v *View) GetLatestProjectFailedEvent(sequence uint64) (*repository.FailedEvent, error) { return v.latestFailedEvent(projectTable, sequence) } -func (v *View) ProcessedProjectFailedEvent(failedEvent *global_view.FailedEvent) error { +func (v *View) ProcessedProjectFailedEvent(failedEvent *repository.FailedEvent) error { return v.saveFailedEvent(failedEvent) } diff --git a/internal/management/repository/eventsourcing/view/project_grant.go b/internal/management/repository/eventsourcing/view/project_grant.go index dc8b47fce5..f2153647b4 100644 --- a/internal/management/repository/eventsourcing/view/project_grant.go +++ b/internal/management/repository/eventsourcing/view/project_grant.go @@ -4,7 +4,7 @@ import ( proj_model "github.com/caos/zitadel/internal/project/model" "github.com/caos/zitadel/internal/project/repository/view" "github.com/caos/zitadel/internal/project/repository/view/model" - global_view "github.com/caos/zitadel/internal/view" + "github.com/caos/zitadel/internal/view/repository" ) const ( @@ -55,10 +55,10 @@ func (v *View) ProcessedProjectGrantSequence(eventSequence uint64) error { return v.saveCurrentSequence(grantedProjectTable, eventSequence) } -func (v *View) GetLatestProjectGrantFailedEvent(sequence uint64) (*global_view.FailedEvent, error) { +func (v *View) GetLatestProjectGrantFailedEvent(sequence uint64) (*repository.FailedEvent, error) { return v.latestFailedEvent(grantedProjectTable, sequence) } -func (v *View) ProcessedProjectGrantFailedEvent(failedEvent *global_view.FailedEvent) error { +func (v *View) ProcessedProjectGrantFailedEvent(failedEvent *repository.FailedEvent) error { return v.saveFailedEvent(failedEvent) } diff --git a/internal/management/repository/eventsourcing/view/project_grant_member.go b/internal/management/repository/eventsourcing/view/project_grant_member.go index 9d4a83f8e4..b3411ba884 100644 --- a/internal/management/repository/eventsourcing/view/project_grant_member.go +++ b/internal/management/repository/eventsourcing/view/project_grant_member.go @@ -4,7 +4,7 @@ import ( proj_model "github.com/caos/zitadel/internal/project/model" "github.com/caos/zitadel/internal/project/repository/view" "github.com/caos/zitadel/internal/project/repository/view/model" - global_view "github.com/caos/zitadel/internal/view" + "github.com/caos/zitadel/internal/view/repository" ) const ( @@ -47,10 +47,10 @@ func (v *View) ProcessedProjectGrantMemberSequence(eventSequence uint64) error { return v.saveCurrentSequence(projectGrantMemberTable, eventSequence) } -func (v *View) GetLatestProjectGrantMemberFailedEvent(sequence uint64) (*global_view.FailedEvent, error) { +func (v *View) GetLatestProjectGrantMemberFailedEvent(sequence uint64) (*repository.FailedEvent, error) { return v.latestFailedEvent(projectGrantMemberTable, sequence) } -func (v *View) ProcessedProjectGrantMemberFailedEvent(failedEvent *global_view.FailedEvent) error { +func (v *View) ProcessedProjectGrantMemberFailedEvent(failedEvent *repository.FailedEvent) error { return v.saveFailedEvent(failedEvent) } diff --git a/internal/management/repository/eventsourcing/view/project_member.go b/internal/management/repository/eventsourcing/view/project_member.go index 6dff8d1680..240df76771 100644 --- a/internal/management/repository/eventsourcing/view/project_member.go +++ b/internal/management/repository/eventsourcing/view/project_member.go @@ -4,7 +4,7 @@ import ( proj_model "github.com/caos/zitadel/internal/project/model" "github.com/caos/zitadel/internal/project/repository/view" "github.com/caos/zitadel/internal/project/repository/view/model" - global_view "github.com/caos/zitadel/internal/view" + "github.com/caos/zitadel/internal/view/repository" ) const ( @@ -47,10 +47,10 @@ func (v *View) ProcessedProjectMemberSequence(eventSequence uint64) error { return v.saveCurrentSequence(projectMemberTable, eventSequence) } -func (v *View) GetLatestProjectMemberFailedEvent(sequence uint64) (*global_view.FailedEvent, error) { +func (v *View) GetLatestProjectMemberFailedEvent(sequence uint64) (*repository.FailedEvent, error) { return v.latestFailedEvent(projectMemberTable, sequence) } -func (v *View) ProcessedProjectMemberFailedEvent(failedEvent *global_view.FailedEvent) error { +func (v *View) ProcessedProjectMemberFailedEvent(failedEvent *repository.FailedEvent) error { return v.saveFailedEvent(failedEvent) } diff --git a/internal/management/repository/eventsourcing/view/project_role.go b/internal/management/repository/eventsourcing/view/project_role.go index fb3098323a..641e848162 100644 --- a/internal/management/repository/eventsourcing/view/project_role.go +++ b/internal/management/repository/eventsourcing/view/project_role.go @@ -4,7 +4,7 @@ import ( proj_model "github.com/caos/zitadel/internal/project/model" "github.com/caos/zitadel/internal/project/repository/view" "github.com/caos/zitadel/internal/project/repository/view/model" - global_view "github.com/caos/zitadel/internal/view" + "github.com/caos/zitadel/internal/view/repository" ) const ( @@ -51,10 +51,10 @@ func (v *View) ProcessedProjectRoleSequence(eventSequence uint64) error { return v.saveCurrentSequence(projectRoleTable, eventSequence) } -func (v *View) GetLatestProjectRoleFailedEvent(sequence uint64) (*global_view.FailedEvent, error) { +func (v *View) GetLatestProjectRoleFailedEvent(sequence uint64) (*repository.FailedEvent, error) { return v.latestFailedEvent(projectRoleTable, sequence) } -func (v *View) ProcessedProjectRoleFailedEvent(failedEvent *global_view.FailedEvent) error { +func (v *View) ProcessedProjectRoleFailedEvent(failedEvent *repository.FailedEvent) error { return v.saveFailedEvent(failedEvent) } diff --git a/internal/management/repository/eventsourcing/view/sequence.go b/internal/management/repository/eventsourcing/view/sequence.go index 7a8398e8f5..4102b59ec2 100644 --- a/internal/management/repository/eventsourcing/view/sequence.go +++ b/internal/management/repository/eventsourcing/view/sequence.go @@ -1,7 +1,7 @@ package view import ( - "github.com/caos/zitadel/internal/view" + "github.com/caos/zitadel/internal/view/repository" ) const ( @@ -9,9 +9,9 @@ const ( ) func (v *View) saveCurrentSequence(viewName string, sequence uint64) error { - return view.SaveCurrentSequence(v.Db, sequencesTable, viewName, sequence) + return repository.SaveCurrentSequence(v.Db, sequencesTable, viewName, sequence) } func (v *View) latestSequence(viewName string) (uint64, error) { - return view.LatestSequence(v.Db, sequencesTable, viewName) + return repository.LatestSequence(v.Db, sequencesTable, viewName) } diff --git a/internal/management/repository/eventsourcing/view/user.go b/internal/management/repository/eventsourcing/view/user.go index b0da5ec4d8..987b769795 100644 --- a/internal/management/repository/eventsourcing/view/user.go +++ b/internal/management/repository/eventsourcing/view/user.go @@ -4,7 +4,7 @@ import ( usr_model "github.com/caos/zitadel/internal/user/model" "github.com/caos/zitadel/internal/user/repository/view" "github.com/caos/zitadel/internal/user/repository/view/model" - global_view "github.com/caos/zitadel/internal/view" + "github.com/caos/zitadel/internal/view/repository" ) const ( @@ -62,10 +62,10 @@ func (v *View) ProcessedUserSequence(eventSequence uint64) error { return v.saveCurrentSequence(userTable, eventSequence) } -func (v *View) GetLatestUserFailedEvent(sequence uint64) (*global_view.FailedEvent, error) { +func (v *View) GetLatestUserFailedEvent(sequence uint64) (*repository.FailedEvent, error) { return v.latestFailedEvent(userTable, sequence) } -func (v *View) ProcessedUserFailedEvent(failedEvent *global_view.FailedEvent) error { +func (v *View) ProcessedUserFailedEvent(failedEvent *repository.FailedEvent) error { return v.saveFailedEvent(failedEvent) } diff --git a/internal/management/repository/eventsourcing/view/user_grant.go b/internal/management/repository/eventsourcing/view/user_grant.go index 8cbd7c8611..7ec2ced5fb 100644 --- a/internal/management/repository/eventsourcing/view/user_grant.go +++ b/internal/management/repository/eventsourcing/view/user_grant.go @@ -4,7 +4,7 @@ import ( grant_model "github.com/caos/zitadel/internal/usergrant/model" "github.com/caos/zitadel/internal/usergrant/repository/view" "github.com/caos/zitadel/internal/usergrant/repository/view/model" - global_view "github.com/caos/zitadel/internal/view" + "github.com/caos/zitadel/internal/view/repository" ) const ( @@ -63,10 +63,10 @@ func (v *View) ProcessedUserGrantSequence(eventSequence uint64) error { return v.saveCurrentSequence(userGrantTable, eventSequence) } -func (v *View) GetLatestUserGrantFailedEvent(sequence uint64) (*global_view.FailedEvent, error) { +func (v *View) GetLatestUserGrantFailedEvent(sequence uint64) (*repository.FailedEvent, error) { return v.latestFailedEvent(userGrantTable, sequence) } -func (v *View) ProcessedUserGrantFailedEvent(failedEvent *global_view.FailedEvent) error { +func (v *View) ProcessedUserGrantFailedEvent(failedEvent *repository.FailedEvent) error { return v.saveFailedEvent(failedEvent) } diff --git a/internal/notification/repository/eventsourcing/view/error_event.go b/internal/notification/repository/eventsourcing/view/error_event.go index 0aaede433d..3c65c2d61f 100644 --- a/internal/notification/repository/eventsourcing/view/error_event.go +++ b/internal/notification/repository/eventsourcing/view/error_event.go @@ -1,17 +1,17 @@ package view import ( - "github.com/caos/zitadel/internal/view" + "github.com/caos/zitadel/internal/view/repository" ) const ( errTable = "notification.failed_event" ) -func (v *View) saveFailedEvent(failedEvent *view.FailedEvent) error { - return view.SaveFailedEvent(v.Db, errTable, failedEvent) +func (v *View) saveFailedEvent(failedEvent *repository.FailedEvent) error { + return repository.SaveFailedEvent(v.Db, errTable, failedEvent) } -func (v *View) latestFailedEvent(viewName string, sequence uint64) (*view.FailedEvent, error) { - return view.LatestFailedEvent(v.Db, errTable, viewName, sequence) +func (v *View) latestFailedEvent(viewName string, sequence uint64) (*repository.FailedEvent, error) { + return repository.LatestFailedEvent(v.Db, errTable, viewName, sequence) } diff --git a/internal/notification/repository/eventsourcing/view/notification.go b/internal/notification/repository/eventsourcing/view/notification.go index c6afa9a159..c785c92fcf 100644 --- a/internal/notification/repository/eventsourcing/view/notification.go +++ b/internal/notification/repository/eventsourcing/view/notification.go @@ -1,7 +1,7 @@ package view import ( - global_view "github.com/caos/zitadel/internal/view" + "github.com/caos/zitadel/internal/view/repository" ) const ( @@ -16,10 +16,10 @@ func (v *View) ProcessedNotificationSequence(eventSequence uint64) error { return v.saveCurrentSequence(notificationTable, eventSequence) } -func (v *View) GetLatestNotificationFailedEvent(sequence uint64) (*global_view.FailedEvent, error) { +func (v *View) GetLatestNotificationFailedEvent(sequence uint64) (*repository.FailedEvent, error) { return v.latestFailedEvent(notificationTable, sequence) } -func (v *View) ProcessedNotificationFailedEvent(failedEvent *global_view.FailedEvent) error { +func (v *View) ProcessedNotificationFailedEvent(failedEvent *repository.FailedEvent) error { return v.saveFailedEvent(failedEvent) } diff --git a/internal/notification/repository/eventsourcing/view/notify_user.go b/internal/notification/repository/eventsourcing/view/notify_user.go index bbcee2c0e2..c5abff4fe0 100644 --- a/internal/notification/repository/eventsourcing/view/notify_user.go +++ b/internal/notification/repository/eventsourcing/view/notify_user.go @@ -3,7 +3,7 @@ package view import ( "github.com/caos/zitadel/internal/user/repository/view" "github.com/caos/zitadel/internal/user/repository/view/model" - global_view "github.com/caos/zitadel/internal/view" + "github.com/caos/zitadel/internal/view/repository" ) const ( @@ -38,10 +38,10 @@ func (v *View) ProcessedNotifyUserSequence(eventSequence uint64) error { return v.saveCurrentSequence(notifyUserTable, eventSequence) } -func (v *View) GetLatestNotifyUserFailedEvent(sequence uint64) (*global_view.FailedEvent, error) { +func (v *View) GetLatestNotifyUserFailedEvent(sequence uint64) (*repository.FailedEvent, error) { return v.latestFailedEvent(notifyUserTable, sequence) } -func (v *View) ProcessedNotifyUserFailedEvent(failedEvent *global_view.FailedEvent) error { +func (v *View) ProcessedNotifyUserFailedEvent(failedEvent *repository.FailedEvent) error { return v.saveFailedEvent(failedEvent) } diff --git a/internal/notification/repository/eventsourcing/view/sequence.go b/internal/notification/repository/eventsourcing/view/sequence.go index aaa7ac48a4..3a30b6036f 100644 --- a/internal/notification/repository/eventsourcing/view/sequence.go +++ b/internal/notification/repository/eventsourcing/view/sequence.go @@ -1,7 +1,7 @@ package view import ( - "github.com/caos/zitadel/internal/view" + "github.com/caos/zitadel/internal/view/repository" ) const ( @@ -9,9 +9,9 @@ const ( ) func (v *View) saveCurrentSequence(viewName string, sequence uint64) error { - return view.SaveCurrentSequence(v.Db, sequencesTable, viewName, sequence) + return repository.SaveCurrentSequence(v.Db, sequencesTable, viewName, sequence) } func (v *View) latestSequence(viewName string) (uint64, error) { - return view.LatestSequence(v.Db, sequencesTable, viewName) + return repository.LatestSequence(v.Db, sequencesTable, viewName) } diff --git a/internal/org/repository/view/model/org_domain_query.go b/internal/org/repository/view/model/org_domain_query.go index 326968bad7..3b05e1d826 100644 --- a/internal/org/repository/view/model/org_domain_query.go +++ b/internal/org/repository/view/model/org_domain_query.go @@ -3,7 +3,7 @@ package model import ( global_model "github.com/caos/zitadel/internal/model" org_model "github.com/caos/zitadel/internal/org/model" - "github.com/caos/zitadel/internal/view" + "github.com/caos/zitadel/internal/view/repository" ) type OrgDomainSearchRequest org_model.OrgDomainSearchRequest @@ -18,7 +18,7 @@ func (req OrgDomainSearchRequest) GetOffset() uint64 { return req.Offset } -func (req OrgDomainSearchRequest) GetSortingColumn() view.ColumnKey { +func (req OrgDomainSearchRequest) GetSortingColumn() repository.ColumnKey { if req.SortingColumn == org_model.OrgDomainSearchKeyUnspecified { return nil } @@ -29,15 +29,15 @@ func (req OrgDomainSearchRequest) GetAsc() bool { return req.Asc } -func (req OrgDomainSearchRequest) GetQueries() []view.SearchQuery { - result := make([]view.SearchQuery, len(req.Queries)) +func (req OrgDomainSearchRequest) GetQueries() []repository.SearchQuery { + result := make([]repository.SearchQuery, len(req.Queries)) for i, q := range req.Queries { result[i] = OrgDomainSearchQuery{Key: q.Key, Value: q.Value, Method: q.Method} } return result } -func (req OrgDomainSearchQuery) GetKey() view.ColumnKey { +func (req OrgDomainSearchQuery) GetKey() repository.ColumnKey { return OrgDomainSearchKey(req.Key) } diff --git a/internal/org/repository/view/model/org_member_query.go b/internal/org/repository/view/model/org_member_query.go index 21e6d62475..a094d5a0f4 100644 --- a/internal/org/repository/view/model/org_member_query.go +++ b/internal/org/repository/view/model/org_member_query.go @@ -3,7 +3,7 @@ package model import ( global_model "github.com/caos/zitadel/internal/model" proj_model "github.com/caos/zitadel/internal/org/model" - "github.com/caos/zitadel/internal/view" + "github.com/caos/zitadel/internal/view/repository" ) type OrgMemberSearchRequest proj_model.OrgMemberSearchRequest @@ -18,7 +18,7 @@ func (req OrgMemberSearchRequest) GetOffset() uint64 { return req.Offset } -func (req OrgMemberSearchRequest) GetSortingColumn() view.ColumnKey { +func (req OrgMemberSearchRequest) GetSortingColumn() repository.ColumnKey { if req.SortingColumn == proj_model.OrgMemberSearchKeyUnspecified { return nil } @@ -29,15 +29,15 @@ func (req OrgMemberSearchRequest) GetAsc() bool { return req.Asc } -func (req OrgMemberSearchRequest) GetQueries() []view.SearchQuery { - result := make([]view.SearchQuery, len(req.Queries)) +func (req OrgMemberSearchRequest) GetQueries() []repository.SearchQuery { + result := make([]repository.SearchQuery, len(req.Queries)) for i, q := range req.Queries { result[i] = OrgMemberSearchQuery{Key: q.Key, Value: q.Value, Method: q.Method} } return result } -func (req OrgMemberSearchQuery) GetKey() view.ColumnKey { +func (req OrgMemberSearchQuery) GetKey() repository.ColumnKey { return OrgMemberSearchKey(req.Key) } diff --git a/internal/org/repository/view/model/org_query.go b/internal/org/repository/view/model/org_query.go index 3d4696b0f0..341be51623 100644 --- a/internal/org/repository/view/model/org_query.go +++ b/internal/org/repository/view/model/org_query.go @@ -3,7 +3,7 @@ package model import ( global_model "github.com/caos/zitadel/internal/model" usr_model "github.com/caos/zitadel/internal/org/model" - "github.com/caos/zitadel/internal/view" + "github.com/caos/zitadel/internal/view/repository" ) type OrgSearchRequest usr_model.OrgSearchRequest @@ -18,7 +18,7 @@ func (req OrgSearchRequest) GetOffset() uint64 { return req.Offset } -func (req OrgSearchRequest) GetSortingColumn() view.ColumnKey { +func (req OrgSearchRequest) GetSortingColumn() repository.ColumnKey { if req.SortingColumn == usr_model.OrgSearchKeyUnspecified { return nil } @@ -29,15 +29,15 @@ func (req OrgSearchRequest) GetAsc() bool { return req.Asc } -func (req OrgSearchRequest) GetQueries() []view.SearchQuery { - result := make([]view.SearchQuery, len(req.Queries)) +func (req OrgSearchRequest) GetQueries() []repository.SearchQuery { + result := make([]repository.SearchQuery, len(req.Queries)) for i, q := range req.Queries { result[i] = OrgSearchQuery{Key: q.Key, Value: q.Value, Method: q.Method} } return result } -func (req OrgSearchQuery) GetKey() view.ColumnKey { +func (req OrgSearchQuery) GetKey() repository.ColumnKey { return OrgSearchKey(req.Key) } diff --git a/internal/org/repository/view/org_domain_view.go b/internal/org/repository/view/org_domain_view.go index a790395866..981b425cb8 100644 --- a/internal/org/repository/view/org_domain_view.go +++ b/internal/org/repository/view/org_domain_view.go @@ -4,7 +4,7 @@ import ( global_model "github.com/caos/zitadel/internal/model" org_model "github.com/caos/zitadel/internal/org/model" "github.com/caos/zitadel/internal/org/repository/view/model" - "github.com/caos/zitadel/internal/view" + "github.com/caos/zitadel/internal/view/repository" "github.com/jinzhu/gorm" ) @@ -12,7 +12,7 @@ func OrgDomainByOrgIDAndDomain(db *gorm.DB, table, orgID, domain string) (*model domainView := new(model.OrgDomainView) orgIDQuery := &model.OrgDomainSearchQuery{Key: org_model.OrgDomainSearchKeyOrgID, Value: orgID, Method: global_model.SearchMethodEquals} domainQuery := &model.OrgDomainSearchQuery{Key: org_model.OrgDomainSearchKeyDomain, Value: domain, Method: global_model.SearchMethodEquals} - query := view.PrepareGetByQuery(table, orgIDQuery, domainQuery) + query := repository.PrepareGetByQuery(table, orgIDQuery, domainQuery) err := query(db, domainView) return domainView, err } @@ -21,14 +21,14 @@ func VerifiedOrgDomain(db *gorm.DB, table, domain string) (*model.OrgDomainView, domainView := new(model.OrgDomainView) domainQuery := &model.OrgDomainSearchQuery{Key: org_model.OrgDomainSearchKeyDomain, Value: domain, Method: global_model.SearchMethodEquals} verifiedQuery := &model.OrgDomainSearchQuery{Key: org_model.OrgDomainSearchKeyVerified, Value: true, Method: global_model.SearchMethodEquals} - query := view.PrepareGetByQuery(table, domainQuery, verifiedQuery) + query := repository.PrepareGetByQuery(table, domainQuery, verifiedQuery) err := query(db, domainView) return domainView, err } func SearchOrgDomains(db *gorm.DB, table string, req *org_model.OrgDomainSearchRequest) ([]*model.OrgDomainView, int, error) { members := make([]*model.OrgDomainView, 0) - query := view.PrepareSearchQuery(table, model.OrgDomainSearchRequest{Limit: req.Limit, Offset: req.Offset, Queries: req.Queries}) + query := repository.PrepareSearchQuery(table, model.OrgDomainSearchRequest{Limit: req.Limit, Offset: req.Offset, Queries: req.Queries}) count, err := query(db, &members) if err != nil { return nil, 0, err @@ -45,7 +45,7 @@ func OrgDomainsByOrgID(db *gorm.DB, table string, orgID string) ([]*model.OrgDom Method: global_model.SearchMethodEquals, }, } - query := view.PrepareSearchQuery(table, model.OrgDomainSearchRequest{Queries: queries}) + query := repository.PrepareSearchQuery(table, model.OrgDomainSearchRequest{Queries: queries}) _, err := query(db, &domains) if err != nil { return nil, err @@ -54,14 +54,14 @@ func OrgDomainsByOrgID(db *gorm.DB, table string, orgID string) ([]*model.OrgDom } func PutOrgDomain(db *gorm.DB, table string, role *model.OrgDomainView) error { - save := view.PrepareSave(table) + save := repository.PrepareSave(table) return save(db, role) } func DeleteOrgDomain(db *gorm.DB, table, orgID, domain string) error { - delete := view.PrepareDeleteByKeys(table, - view.Key{Key: model.OrgDomainSearchKey(org_model.OrgDomainSearchKeyDomain), Value: domain}, - view.Key{Key: model.OrgDomainSearchKey(org_model.OrgDomainSearchKeyOrgID), Value: orgID}, + delete := repository.PrepareDeleteByKeys(table, + repository.Key{Key: model.OrgDomainSearchKey(org_model.OrgDomainSearchKeyDomain), Value: domain}, + repository.Key{Key: model.OrgDomainSearchKey(org_model.OrgDomainSearchKeyOrgID), Value: orgID}, ) return delete(db) } diff --git a/internal/org/repository/view/org_member_view.go b/internal/org/repository/view/org_member_view.go index 7a4b9127dd..7265aec7c4 100644 --- a/internal/org/repository/view/org_member_view.go +++ b/internal/org/repository/view/org_member_view.go @@ -4,7 +4,7 @@ import ( global_model "github.com/caos/zitadel/internal/model" org_model "github.com/caos/zitadel/internal/org/model" "github.com/caos/zitadel/internal/org/repository/view/model" - "github.com/caos/zitadel/internal/view" + "github.com/caos/zitadel/internal/view/repository" "github.com/jinzhu/gorm" ) @@ -13,14 +13,14 @@ func OrgMemberByIDs(db *gorm.DB, table, orgID, userID string) (*model.OrgMemberV orgIDQuery := &model.OrgMemberSearchQuery{Key: org_model.OrgMemberSearchKeyOrgID, Value: orgID, Method: global_model.SearchMethodEquals} userIDQuery := &model.OrgMemberSearchQuery{Key: org_model.OrgMemberSearchKeyUserID, Value: userID, Method: global_model.SearchMethodEquals} - query := view.PrepareGetByQuery(table, orgIDQuery, userIDQuery) + query := repository.PrepareGetByQuery(table, orgIDQuery, userIDQuery) err := query(db, member) return member, err } func SearchOrgMembers(db *gorm.DB, table string, req *org_model.OrgMemberSearchRequest) ([]*model.OrgMemberView, int, error) { members := make([]*model.OrgMemberView, 0) - query := view.PrepareSearchQuery(table, model.OrgMemberSearchRequest{Limit: req.Limit, Offset: req.Offset, Queries: req.Queries}) + query := repository.PrepareSearchQuery(table, model.OrgMemberSearchRequest{Limit: req.Limit, Offset: req.Offset, Queries: req.Queries}) count, err := query(db, &members) if err != nil { return nil, 0, err @@ -36,7 +36,7 @@ func OrgMembersByUserID(db *gorm.DB, table string, userID string) ([]*model.OrgM Method: global_model.SearchMethodEquals, }, } - query := view.PrepareSearchQuery(table, model.OrgMemberSearchRequest{Queries: queries}) + query := repository.PrepareSearchQuery(table, model.OrgMemberSearchRequest{Queries: queries}) _, err := query(db, &members) if err != nil { return nil, err @@ -45,7 +45,7 @@ func OrgMembersByUserID(db *gorm.DB, table string, userID string) ([]*model.OrgM } func PutOrgMember(db *gorm.DB, table string, role *model.OrgMemberView) error { - save := view.PrepareSave(table) + save := repository.PrepareSave(table) return save(db, role) } @@ -54,6 +54,6 @@ func DeleteOrgMember(db *gorm.DB, table, orgID, userID string) error { if err != nil { return err } - delete := view.PrepareDeleteByObject(table, member) + delete := repository.PrepareDeleteByObject(table, member) return delete(db) } diff --git a/internal/org/repository/view/org_view.go b/internal/org/repository/view/org_view.go index bb42abfedc..9ed57cc899 100644 --- a/internal/org/repository/view/org_view.go +++ b/internal/org/repository/view/org_view.go @@ -3,20 +3,20 @@ package view import ( org_model "github.com/caos/zitadel/internal/org/model" "github.com/caos/zitadel/internal/org/repository/view/model" - "github.com/caos/zitadel/internal/view" + "github.com/caos/zitadel/internal/view/repository" "github.com/jinzhu/gorm" ) func OrgByID(db *gorm.DB, table, orgID string) (*model.OrgView, error) { org := new(model.OrgView) - query := view.PrepareGetByKey(table, model.OrgSearchKey(org_model.OrgSearchKeyOrgID), orgID) + query := repository.PrepareGetByKey(table, model.OrgSearchKey(org_model.OrgSearchKeyOrgID), orgID) err := query(db, org) return org, err } func SearchOrgs(db *gorm.DB, table string, req *org_model.OrgSearchRequest) ([]*model.OrgView, int, error) { orgs := make([]*model.OrgView, 0) - query := view.PrepareSearchQuery(table, model.OrgSearchRequest{Limit: req.Limit, Offset: req.Offset, Queries: req.Queries}) + query := repository.PrepareSearchQuery(table, model.OrgSearchRequest{Limit: req.Limit, Offset: req.Offset, Queries: req.Queries}) count, err := query(db, &orgs) if err != nil { return nil, 0, err @@ -25,11 +25,11 @@ func SearchOrgs(db *gorm.DB, table string, req *org_model.OrgSearchRequest) ([]* } func PutOrg(db *gorm.DB, table string, org *model.OrgView) error { - save := view.PrepareSave(table) + save := repository.PrepareSave(table) return save(db, org) } func DeleteOrg(db *gorm.DB, table, orgID string) error { - delete := view.PrepareDeleteByKey(table, model.OrgSearchKey(org_model.OrgSearchKeyOrgID), orgID) + delete := repository.PrepareDeleteByKey(table, model.OrgSearchKey(org_model.OrgSearchKeyOrgID), orgID) return delete(db) } diff --git a/internal/project/repository/view/application_view.go b/internal/project/repository/view/application_view.go index caa95c470f..9e5ef09b1b 100644 --- a/internal/project/repository/view/application_view.go +++ b/internal/project/repository/view/application_view.go @@ -4,13 +4,13 @@ import ( global_model "github.com/caos/zitadel/internal/model" proj_model "github.com/caos/zitadel/internal/project/model" "github.com/caos/zitadel/internal/project/repository/view/model" - "github.com/caos/zitadel/internal/view" + "github.com/caos/zitadel/internal/view/repository" "github.com/jinzhu/gorm" ) func ApplicationByID(db *gorm.DB, table, appID string) (*model.ApplicationView, error) { app := new(model.ApplicationView) - query := view.PrepareGetByKey(table, model.ApplicationSearchKey(proj_model.AppSearchKeyAppID), appID) + query := repository.PrepareGetByKey(table, model.ApplicationSearchKey(proj_model.AppSearchKeyAppID), appID) err := query(db, app) return app, err } @@ -18,7 +18,7 @@ func ApplicationByID(db *gorm.DB, table, appID string) (*model.ApplicationView, func ApplicationByOIDCClientID(db *gorm.DB, table, clientID string) (*model.ApplicationView, error) { app := new(model.ApplicationView) clientIDQuery := model.ApplicationSearchQuery{Key: proj_model.AppSearchKeyOIDCClientID, Value: clientID, Method: global_model.SearchMethodEquals} - query := view.PrepareGetByQuery(table, clientIDQuery) + query := repository.PrepareGetByQuery(table, clientIDQuery) err := query(db, app) return app, err } @@ -27,24 +27,24 @@ func ApplicationByProjectIDAndAppName(db *gorm.DB, table, projectID, appName str app := new(model.ApplicationView) projectIDQuery := model.ApplicationSearchQuery{Key: proj_model.AppSearchKeyProjectID, Value: projectID, Method: global_model.SearchMethodEquals} appNameQuery := model.ApplicationSearchQuery{Key: proj_model.AppSearchKeyName, Value: appName, Method: global_model.SearchMethodEquals} - query := view.PrepareGetByQuery(table, projectIDQuery, appNameQuery) + query := repository.PrepareGetByQuery(table, projectIDQuery, appNameQuery) err := query(db, app) return app, err } func SearchApplications(db *gorm.DB, table string, req *proj_model.ApplicationSearchRequest) ([]*model.ApplicationView, int, error) { apps := make([]*model.ApplicationView, 0) - query := view.PrepareSearchQuery(table, model.ApplicationSearchRequest{Limit: req.Limit, Offset: req.Offset, Queries: req.Queries}) + query := repository.PrepareSearchQuery(table, model.ApplicationSearchRequest{Limit: req.Limit, Offset: req.Offset, Queries: req.Queries}) count, err := query(db, &apps) return apps, count, err } func PutApplication(db *gorm.DB, table string, app *model.ApplicationView) error { - save := view.PrepareSave(table) + save := repository.PrepareSave(table) return save(db, app) } func DeleteApplication(db *gorm.DB, table, appID string) error { - delete := view.PrepareDeleteByKey(table, model.ApplicationSearchKey(proj_model.AppSearchKeyAppID), appID) + delete := repository.PrepareDeleteByKey(table, model.ApplicationSearchKey(proj_model.AppSearchKeyAppID), appID) return delete(db) } diff --git a/internal/project/repository/view/model/application_query.go b/internal/project/repository/view/model/application_query.go index 3a7b583ea2..da3860606f 100644 --- a/internal/project/repository/view/model/application_query.go +++ b/internal/project/repository/view/model/application_query.go @@ -3,7 +3,7 @@ package model import ( global_model "github.com/caos/zitadel/internal/model" proj_model "github.com/caos/zitadel/internal/project/model" - "github.com/caos/zitadel/internal/view" + "github.com/caos/zitadel/internal/view/repository" ) type ApplicationSearchRequest proj_model.ApplicationSearchRequest @@ -18,7 +18,7 @@ func (req ApplicationSearchRequest) GetOffset() uint64 { return req.Offset } -func (req ApplicationSearchRequest) GetSortingColumn() view.ColumnKey { +func (req ApplicationSearchRequest) GetSortingColumn() repository.ColumnKey { if req.SortingColumn == proj_model.AppSearchKeyUnspecified { return nil } @@ -29,15 +29,15 @@ func (req ApplicationSearchRequest) GetAsc() bool { return req.Asc } -func (req ApplicationSearchRequest) GetQueries() []view.SearchQuery { - result := make([]view.SearchQuery, len(req.Queries)) +func (req ApplicationSearchRequest) GetQueries() []repository.SearchQuery { + result := make([]repository.SearchQuery, len(req.Queries)) for i, q := range req.Queries { result[i] = ApplicationSearchQuery{Key: q.Key, Value: q.Value, Method: q.Method} } return result } -func (req ApplicationSearchQuery) GetKey() view.ColumnKey { +func (req ApplicationSearchQuery) GetKey() repository.ColumnKey { return ApplicationSearchKey(req.Key) } diff --git a/internal/project/repository/view/model/project_grant_member_query.go b/internal/project/repository/view/model/project_grant_member_query.go index 1cae740564..f18e3e2c0f 100644 --- a/internal/project/repository/view/model/project_grant_member_query.go +++ b/internal/project/repository/view/model/project_grant_member_query.go @@ -3,7 +3,7 @@ package model import ( global_model "github.com/caos/zitadel/internal/model" proj_model "github.com/caos/zitadel/internal/project/model" - "github.com/caos/zitadel/internal/view" + "github.com/caos/zitadel/internal/view/repository" ) type ProjectGrantMemberSearchRequest proj_model.ProjectGrantMemberSearchRequest @@ -18,7 +18,7 @@ func (req ProjectGrantMemberSearchRequest) GetOffset() uint64 { return req.Offset } -func (req ProjectGrantMemberSearchRequest) GetSortingColumn() view.ColumnKey { +func (req ProjectGrantMemberSearchRequest) GetSortingColumn() repository.ColumnKey { if req.SortingColumn == proj_model.ProjectGrantMemberSearchKeyUnspecified { return nil } @@ -29,15 +29,15 @@ func (req ProjectGrantMemberSearchRequest) GetAsc() bool { return req.Asc } -func (req ProjectGrantMemberSearchRequest) GetQueries() []view.SearchQuery { - result := make([]view.SearchQuery, len(req.Queries)) +func (req ProjectGrantMemberSearchRequest) GetQueries() []repository.SearchQuery { + result := make([]repository.SearchQuery, len(req.Queries)) for i, q := range req.Queries { result[i] = ProjectGrantMemberSearchQuery{Key: q.Key, Value: q.Value, Method: q.Method} } return result } -func (req ProjectGrantMemberSearchQuery) GetKey() view.ColumnKey { +func (req ProjectGrantMemberSearchQuery) GetKey() repository.ColumnKey { return ProjectGrantMemberSearchKey(req.Key) } diff --git a/internal/project/repository/view/model/project_grant_query.go b/internal/project/repository/view/model/project_grant_query.go index d577a2aacb..22843eee92 100644 --- a/internal/project/repository/view/model/project_grant_query.go +++ b/internal/project/repository/view/model/project_grant_query.go @@ -3,7 +3,7 @@ package model import ( global_model "github.com/caos/zitadel/internal/model" proj_model "github.com/caos/zitadel/internal/project/model" - "github.com/caos/zitadel/internal/view" + "github.com/caos/zitadel/internal/view/repository" ) type ProjectGrantSearchRequest proj_model.ProjectGrantViewSearchRequest @@ -18,7 +18,7 @@ func (req ProjectGrantSearchRequest) GetOffset() uint64 { return req.Offset } -func (req ProjectGrantSearchRequest) GetSortingColumn() view.ColumnKey { +func (req ProjectGrantSearchRequest) GetSortingColumn() repository.ColumnKey { if req.SortingColumn == proj_model.GrantedProjectSearchKeyUnspecified { return nil } @@ -29,15 +29,15 @@ func (req ProjectGrantSearchRequest) GetAsc() bool { return req.Asc } -func (req ProjectGrantSearchRequest) GetQueries() []view.SearchQuery { - result := make([]view.SearchQuery, len(req.Queries)) +func (req ProjectGrantSearchRequest) GetQueries() []repository.SearchQuery { + result := make([]repository.SearchQuery, len(req.Queries)) for i, q := range req.Queries { result[i] = ProjectGrantSearchQuery{Key: q.Key, Value: q.Value, Method: q.Method} } return result } -func (req ProjectGrantSearchQuery) GetKey() view.ColumnKey { +func (req ProjectGrantSearchQuery) GetKey() repository.ColumnKey { return ProjectGrantSearchKey(req.Key) } diff --git a/internal/project/repository/view/model/project_member_query.go b/internal/project/repository/view/model/project_member_query.go index e601cdda08..e73d31687e 100644 --- a/internal/project/repository/view/model/project_member_query.go +++ b/internal/project/repository/view/model/project_member_query.go @@ -3,7 +3,7 @@ package model import ( global_model "github.com/caos/zitadel/internal/model" proj_model "github.com/caos/zitadel/internal/project/model" - "github.com/caos/zitadel/internal/view" + "github.com/caos/zitadel/internal/view/repository" ) type ProjectMemberSearchRequest proj_model.ProjectMemberSearchRequest @@ -18,7 +18,7 @@ func (req ProjectMemberSearchRequest) GetOffset() uint64 { return req.Offset } -func (req ProjectMemberSearchRequest) GetSortingColumn() view.ColumnKey { +func (req ProjectMemberSearchRequest) GetSortingColumn() repository.ColumnKey { if req.SortingColumn == proj_model.ProjectMemberSearchKeyUnspecified { return nil } @@ -29,15 +29,15 @@ func (req ProjectMemberSearchRequest) GetAsc() bool { return req.Asc } -func (req ProjectMemberSearchRequest) GetQueries() []view.SearchQuery { - result := make([]view.SearchQuery, len(req.Queries)) +func (req ProjectMemberSearchRequest) GetQueries() []repository.SearchQuery { + result := make([]repository.SearchQuery, len(req.Queries)) for i, q := range req.Queries { result[i] = ProjectMemberSearchQuery{Key: q.Key, Value: q.Value, Method: q.Method} } return result } -func (req ProjectMemberSearchQuery) GetKey() view.ColumnKey { +func (req ProjectMemberSearchQuery) GetKey() repository.ColumnKey { return ProjectMemberSearchKey(req.Key) } diff --git a/internal/project/repository/view/model/project_query.go b/internal/project/repository/view/model/project_query.go index 4fe013a43c..d00fe65272 100644 --- a/internal/project/repository/view/model/project_query.go +++ b/internal/project/repository/view/model/project_query.go @@ -3,7 +3,7 @@ package model import ( global_model "github.com/caos/zitadel/internal/model" proj_model "github.com/caos/zitadel/internal/project/model" - "github.com/caos/zitadel/internal/view" + "github.com/caos/zitadel/internal/view/repository" ) type ProjectSearchRequest proj_model.ProjectViewSearchRequest @@ -18,7 +18,7 @@ func (req ProjectSearchRequest) GetOffset() uint64 { return req.Offset } -func (req ProjectSearchRequest) GetSortingColumn() view.ColumnKey { +func (req ProjectSearchRequest) GetSortingColumn() repository.ColumnKey { if req.SortingColumn == proj_model.ProjectViewSearchKeyUnspecified { return nil } @@ -29,15 +29,15 @@ func (req ProjectSearchRequest) GetAsc() bool { return req.Asc } -func (req ProjectSearchRequest) GetQueries() []view.SearchQuery { - result := make([]view.SearchQuery, len(req.Queries)) +func (req ProjectSearchRequest) GetQueries() []repository.SearchQuery { + result := make([]repository.SearchQuery, len(req.Queries)) for i, q := range req.Queries { result[i] = ProjectSearchQuery{Key: q.Key, Value: q.Value, Method: q.Method} } return result } -func (req ProjectSearchQuery) GetKey() view.ColumnKey { +func (req ProjectSearchQuery) GetKey() repository.ColumnKey { return ProjectSearchKey(req.Key) } diff --git a/internal/project/repository/view/model/project_role_query.go b/internal/project/repository/view/model/project_role_query.go index 68871d0811..7213ac0fa5 100644 --- a/internal/project/repository/view/model/project_role_query.go +++ b/internal/project/repository/view/model/project_role_query.go @@ -3,7 +3,7 @@ package model import ( global_model "github.com/caos/zitadel/internal/model" proj_model "github.com/caos/zitadel/internal/project/model" - "github.com/caos/zitadel/internal/view" + "github.com/caos/zitadel/internal/view/repository" ) type ProjectRoleSearchRequest proj_model.ProjectRoleSearchRequest @@ -18,7 +18,7 @@ func (req ProjectRoleSearchRequest) GetOffset() uint64 { return req.Offset } -func (req ProjectRoleSearchRequest) GetSortingColumn() view.ColumnKey { +func (req ProjectRoleSearchRequest) GetSortingColumn() repository.ColumnKey { if req.SortingColumn == proj_model.ProjectRoleSearchKeyUnspecified { return nil } @@ -29,15 +29,15 @@ func (req ProjectRoleSearchRequest) GetAsc() bool { return req.Asc } -func (req ProjectRoleSearchRequest) GetQueries() []view.SearchQuery { - result := make([]view.SearchQuery, len(req.Queries)) +func (req ProjectRoleSearchRequest) GetQueries() []repository.SearchQuery { + result := make([]repository.SearchQuery, len(req.Queries)) for i, q := range req.Queries { result[i] = ProjectRoleSearchQuery{Key: q.Key, Value: q.Value, Method: q.Method} } return result } -func (req ProjectRoleSearchQuery) GetKey() view.ColumnKey { +func (req ProjectRoleSearchQuery) GetKey() repository.ColumnKey { return ProjectRoleSearchKey(req.Key) } diff --git a/internal/project/repository/view/project_grant_member_view.go b/internal/project/repository/view/project_grant_member_view.go index e769c41a58..a1ce4170ec 100644 --- a/internal/project/repository/view/project_grant_member_view.go +++ b/internal/project/repository/view/project_grant_member_view.go @@ -4,7 +4,7 @@ import ( global_model "github.com/caos/zitadel/internal/model" proj_model "github.com/caos/zitadel/internal/project/model" "github.com/caos/zitadel/internal/project/repository/view/model" - "github.com/caos/zitadel/internal/view" + "github.com/caos/zitadel/internal/view/repository" "github.com/jinzhu/gorm" ) @@ -13,14 +13,14 @@ func ProjectGrantMemberByIDs(db *gorm.DB, table, grantID, userID string) (*model grantIDQuery := model.ProjectGrantMemberSearchQuery{Key: proj_model.ProjectGrantMemberSearchKeyGrantID, Value: grantID, Method: global_model.SearchMethodEquals} userIDQuery := model.ProjectGrantMemberSearchQuery{Key: proj_model.ProjectGrantMemberSearchKeyUserID, Value: userID, Method: global_model.SearchMethodEquals} - query := view.PrepareGetByQuery(table, grantIDQuery, userIDQuery) + query := repository.PrepareGetByQuery(table, grantIDQuery, userIDQuery) err := query(db, role) return role, err } func SearchProjectGrantMembers(db *gorm.DB, table string, req *proj_model.ProjectGrantMemberSearchRequest) ([]*model.ProjectGrantMemberView, int, error) { roles := make([]*model.ProjectGrantMemberView, 0) - query := view.PrepareSearchQuery(table, model.ProjectGrantMemberSearchRequest{Limit: req.Limit, Offset: req.Offset, Queries: req.Queries}) + query := repository.PrepareSearchQuery(table, model.ProjectGrantMemberSearchRequest{Limit: req.Limit, Offset: req.Offset, Queries: req.Queries}) count, err := query(db, &roles) if err != nil { return nil, 0, err @@ -33,7 +33,7 @@ func ProjectGrantMembersByUserID(db *gorm.DB, table, userID string) ([]*model.Pr queries := []*proj_model.ProjectGrantMemberSearchQuery{ &proj_model.ProjectGrantMemberSearchQuery{Key: proj_model.ProjectGrantMemberSearchKeyUserID, Value: userID, Method: global_model.SearchMethodEquals}, } - query := view.PrepareSearchQuery(table, model.ProjectGrantMemberSearchRequest{Queries: queries}) + query := repository.PrepareSearchQuery(table, model.ProjectGrantMemberSearchRequest{Queries: queries}) _, err := query(db, &members) if err != nil { return nil, err @@ -42,7 +42,7 @@ func ProjectGrantMembersByUserID(db *gorm.DB, table, userID string) ([]*model.Pr } func PutProjectGrantMember(db *gorm.DB, table string, role *model.ProjectGrantMemberView) error { - save := view.PrepareSave(table) + save := repository.PrepareSave(table) return save(db, role) } @@ -51,6 +51,6 @@ func DeleteProjectGrantMember(db *gorm.DB, table, grantID, userID string) error if err != nil { return err } - delete := view.PrepareDeleteByObject(table, role) + delete := repository.PrepareDeleteByObject(table, role) return delete(db) } diff --git a/internal/project/repository/view/project_grant_view.go b/internal/project/repository/view/project_grant_view.go index 30fa9fe793..84c3b7a3bd 100644 --- a/internal/project/repository/view/project_grant_view.go +++ b/internal/project/repository/view/project_grant_view.go @@ -4,7 +4,7 @@ import ( global_model "github.com/caos/zitadel/internal/model" proj_model "github.com/caos/zitadel/internal/project/model" "github.com/caos/zitadel/internal/project/repository/view/model" - "github.com/caos/zitadel/internal/view" + "github.com/caos/zitadel/internal/view/repository" "github.com/jinzhu/gorm" ) @@ -13,7 +13,7 @@ func ProjectGrantByProjectAndOrg(db *gorm.DB, table, projectID, orgID string) (* projectIDQuery := model.ProjectGrantSearchQuery{Key: proj_model.GrantedProjectSearchKeyProjectID, Value: projectID, Method: global_model.SearchMethodEquals} orgIDQuery := model.ProjectGrantSearchQuery{Key: proj_model.GrantedProjectSearchKeyOrgID, Value: orgID, Method: global_model.SearchMethodEquals} - query := view.PrepareGetByQuery(table, projectIDQuery, orgIDQuery) + query := repository.PrepareGetByQuery(table, projectIDQuery, orgIDQuery) err := query(db, project) return project, err } @@ -21,7 +21,7 @@ func ProjectGrantByProjectAndOrg(db *gorm.DB, table, projectID, orgID string) (* func ProjectGrantByID(db *gorm.DB, table, grantID string) (*model.ProjectGrantView, error) { project := new(model.ProjectGrantView) grantIDQuery := model.ProjectGrantSearchQuery{Key: proj_model.GrantedProjectSearchKeyGrantID, Value: grantID, Method: global_model.SearchMethodEquals} - query := view.PrepareGetByQuery(table, grantIDQuery) + query := repository.PrepareGetByQuery(table, grantIDQuery) err := query(db, project) return project, err } @@ -31,7 +31,7 @@ func ProjectGrantsByProjectID(db *gorm.DB, table, projectID string) ([]*model.Pr queries := []*proj_model.ProjectGrantViewSearchQuery{ &proj_model.ProjectGrantViewSearchQuery{Key: proj_model.GrantedProjectSearchKeyProjectID, Value: projectID, Method: global_model.SearchMethodEquals}, } - query := view.PrepareSearchQuery(table, model.ProjectGrantSearchRequest{Queries: queries}) + query := repository.PrepareSearchQuery(table, model.ProjectGrantSearchRequest{Queries: queries}) _, err := query(db, &projects) if err != nil { return nil, err @@ -45,7 +45,7 @@ func ProjectGrantsByProjectIDAndRoleKey(db *gorm.DB, table, projectID, roleKey s &proj_model.ProjectGrantViewSearchQuery{Key: proj_model.GrantedProjectSearchKeyProjectID, Value: projectID, Method: global_model.SearchMethodEquals}, &proj_model.ProjectGrantViewSearchQuery{Key: proj_model.GrantedProjectSearchKeyRoleKeys, Value: roleKey, Method: global_model.SearchMethodListContains}, } - query := view.PrepareSearchQuery(table, model.ProjectGrantSearchRequest{Queries: queries}) + query := repository.PrepareSearchQuery(table, model.ProjectGrantSearchRequest{Queries: queries}) _, err := query(db, &projects) if err != nil { return nil, err @@ -55,7 +55,7 @@ func ProjectGrantsByProjectIDAndRoleKey(db *gorm.DB, table, projectID, roleKey s func SearchProjectGrants(db *gorm.DB, table string, req *proj_model.ProjectGrantViewSearchRequest) ([]*model.ProjectGrantView, int, error) { projects := make([]*model.ProjectGrantView, 0) - query := view.PrepareSearchQuery(table, model.ProjectGrantSearchRequest{Limit: req.Limit, Offset: req.Offset, Queries: req.Queries}) + query := repository.PrepareSearchQuery(table, model.ProjectGrantSearchRequest{Limit: req.Limit, Offset: req.Offset, Queries: req.Queries}) count, err := query(db, &projects) if err != nil { return nil, 0, err @@ -64,11 +64,11 @@ func SearchProjectGrants(db *gorm.DB, table string, req *proj_model.ProjectGrant } func PutProjectGrant(db *gorm.DB, table string, project *model.ProjectGrantView) error { - save := view.PrepareSave(table) + save := repository.PrepareSave(table) return save(db, project) } func DeleteProjectGrant(db *gorm.DB, table, grantID string) error { - delete := view.PrepareDeleteByKey(table, model.ProjectSearchKey(proj_model.GrantedProjectSearchKeyGrantID), grantID) + delete := repository.PrepareDeleteByKey(table, model.ProjectSearchKey(proj_model.GrantedProjectSearchKeyGrantID), grantID) return delete(db) } diff --git a/internal/project/repository/view/project_member_view.go b/internal/project/repository/view/project_member_view.go index 43d8291597..7ca6f66f50 100644 --- a/internal/project/repository/view/project_member_view.go +++ b/internal/project/repository/view/project_member_view.go @@ -4,7 +4,7 @@ import ( global_model "github.com/caos/zitadel/internal/model" proj_model "github.com/caos/zitadel/internal/project/model" "github.com/caos/zitadel/internal/project/repository/view/model" - "github.com/caos/zitadel/internal/view" + "github.com/caos/zitadel/internal/view/repository" "github.com/jinzhu/gorm" ) @@ -13,14 +13,14 @@ func ProjectMemberByIDs(db *gorm.DB, table, projectID, userID string) (*model.Pr projectIDQuery := model.ProjectMemberSearchQuery{Key: proj_model.ProjectMemberSearchKeyProjectID, Value: projectID, Method: global_model.SearchMethodEquals} userIDQuery := model.ProjectMemberSearchQuery{Key: proj_model.ProjectMemberSearchKeyUserID, Value: userID, Method: global_model.SearchMethodEquals} - query := view.PrepareGetByQuery(table, projectIDQuery, userIDQuery) + query := repository.PrepareGetByQuery(table, projectIDQuery, userIDQuery) err := query(db, role) return role, err } func SearchProjectMembers(db *gorm.DB, table string, req *proj_model.ProjectMemberSearchRequest) ([]*model.ProjectMemberView, int, error) { roles := make([]*model.ProjectMemberView, 0) - query := view.PrepareSearchQuery(table, model.ProjectMemberSearchRequest{Limit: req.Limit, Offset: req.Offset, Queries: req.Queries}) + query := repository.PrepareSearchQuery(table, model.ProjectMemberSearchRequest{Limit: req.Limit, Offset: req.Offset, Queries: req.Queries}) count, err := query(db, &roles) if err != nil { return nil, 0, err @@ -32,7 +32,7 @@ func ProjectMembersByUserID(db *gorm.DB, table string, userID string) ([]*model. queries := []*proj_model.ProjectMemberSearchQuery{ &proj_model.ProjectMemberSearchQuery{Key: proj_model.ProjectMemberSearchKeyUserID, Value: userID, Method: global_model.SearchMethodEquals}, } - query := view.PrepareSearchQuery(table, model.ProjectMemberSearchRequest{Queries: queries}) + query := repository.PrepareSearchQuery(table, model.ProjectMemberSearchRequest{Queries: queries}) _, err := query(db, &members) if err != nil { return nil, err @@ -41,7 +41,7 @@ func ProjectMembersByUserID(db *gorm.DB, table string, userID string) ([]*model. } func PutProjectMember(db *gorm.DB, table string, role *model.ProjectMemberView) error { - save := view.PrepareSave(table) + save := repository.PrepareSave(table) return save(db, role) } @@ -50,6 +50,6 @@ func DeleteProjectMember(db *gorm.DB, table, projectID, userID string) error { if err != nil { return err } - delete := view.PrepareDeleteByObject(table, role) + delete := repository.PrepareDeleteByObject(table, role) return delete(db) } diff --git a/internal/project/repository/view/project_role_view.go b/internal/project/repository/view/project_role_view.go index 1771766e39..a9eb336cf3 100644 --- a/internal/project/repository/view/project_role_view.go +++ b/internal/project/repository/view/project_role_view.go @@ -4,7 +4,7 @@ import ( global_model "github.com/caos/zitadel/internal/model" proj_model "github.com/caos/zitadel/internal/project/model" "github.com/caos/zitadel/internal/project/repository/view/model" - "github.com/caos/zitadel/internal/view" + "github.com/caos/zitadel/internal/view/repository" "github.com/jinzhu/gorm" ) @@ -14,7 +14,7 @@ func ProjectRoleByIDs(db *gorm.DB, table, projectID, orgID, key string) (*model. projectIDQuery := model.ProjectRoleSearchQuery{Key: proj_model.ProjectRoleSearchKeyProjectID, Value: projectID, Method: global_model.SearchMethodEquals} grantIDQuery := model.ProjectRoleSearchQuery{Key: proj_model.ProjectRoleSearchKeyOrgID, Value: orgID, Method: global_model.SearchMethodEquals} keyQuery := model.ProjectRoleSearchQuery{Key: proj_model.ProjectRoleSearchKeyKey, Value: orgID, Method: global_model.SearchMethodEquals} - query := view.PrepareGetByQuery(table, projectIDQuery, grantIDQuery, keyQuery) + query := repository.PrepareGetByQuery(table, projectIDQuery, grantIDQuery, keyQuery) err := query(db, role) return role, err } @@ -26,7 +26,7 @@ func ResourceOwnerProjectRolesByKey(db *gorm.DB, table, projectID, resourceOwner &proj_model.ProjectRoleSearchQuery{Key: proj_model.ProjectRoleSearchKeyResourceOwner, Value: resourceOwner, Method: global_model.SearchMethodEquals}, &proj_model.ProjectRoleSearchQuery{Key: proj_model.ProjectRoleSearchKeyKey, Value: key, Method: global_model.SearchMethodEquals}, } - query := view.PrepareSearchQuery(table, model.ProjectRoleSearchRequest{Queries: queries}) + query := repository.PrepareSearchQuery(table, model.ProjectRoleSearchRequest{Queries: queries}) _, err := query(db, &roles) if err != nil { return nil, err @@ -40,7 +40,7 @@ func ResourceOwnerProjectRoles(db *gorm.DB, table, projectID, resourceOwner stri &proj_model.ProjectRoleSearchQuery{Key: proj_model.ProjectRoleSearchKeyProjectID, Value: projectID, Method: global_model.SearchMethodEquals}, &proj_model.ProjectRoleSearchQuery{Key: proj_model.ProjectRoleSearchKeyResourceOwner, Value: resourceOwner, Method: global_model.SearchMethodEquals}, } - query := view.PrepareSearchQuery(table, model.ProjectRoleSearchRequest{Queries: queries}) + query := repository.PrepareSearchQuery(table, model.ProjectRoleSearchRequest{Queries: queries}) _, err := query(db, &roles) if err != nil { return nil, err @@ -50,7 +50,7 @@ func ResourceOwnerProjectRoles(db *gorm.DB, table, projectID, resourceOwner stri func SearchProjectRoles(db *gorm.DB, table string, req *proj_model.ProjectRoleSearchRequest) ([]*model.ProjectRoleView, int, error) { roles := make([]*model.ProjectRoleView, 0) - query := view.PrepareSearchQuery(table, model.ProjectRoleSearchRequest{Limit: req.Limit, Offset: req.Offset, Queries: req.Queries}) + query := repository.PrepareSearchQuery(table, model.ProjectRoleSearchRequest{Limit: req.Limit, Offset: req.Offset, Queries: req.Queries}) count, err := query(db, &roles) if err != nil { return nil, 0, err @@ -59,7 +59,7 @@ func SearchProjectRoles(db *gorm.DB, table string, req *proj_model.ProjectRoleSe } func PutProjectRole(db *gorm.DB, table string, role *model.ProjectRoleView) error { - save := view.PrepareSave(table) + save := repository.PrepareSave(table) return save(db, role) } @@ -68,6 +68,6 @@ func DeleteProjectRole(db *gorm.DB, table, projectID, orgID, key string) error { if err != nil { return err } - delete := view.PrepareDeleteByObject(table, role) + delete := repository.PrepareDeleteByObject(table, role) return delete(db) } diff --git a/internal/project/repository/view/project_view.go b/internal/project/repository/view/project_view.go index 080040204a..6711d7a307 100644 --- a/internal/project/repository/view/project_view.go +++ b/internal/project/repository/view/project_view.go @@ -4,7 +4,7 @@ import ( global_model "github.com/caos/zitadel/internal/model" proj_model "github.com/caos/zitadel/internal/project/model" "github.com/caos/zitadel/internal/project/repository/view/model" - "github.com/caos/zitadel/internal/view" + "github.com/caos/zitadel/internal/view/repository" "github.com/jinzhu/gorm" ) @@ -12,7 +12,7 @@ func ProjectByID(db *gorm.DB, table, projectID string) (*model.ProjectView, erro project := new(model.ProjectView) projectIDQuery := model.ProjectSearchQuery{Key: proj_model.ProjectViewSearchKeyProjectID, Value: projectID, Method: global_model.SearchMethodEquals} - query := view.PrepareGetByQuery(table, projectIDQuery) + query := repository.PrepareGetByQuery(table, projectIDQuery) err := query(db, project) return project, err } @@ -22,7 +22,7 @@ func ProjectsByResourceOwner(db *gorm.DB, table, orgID string) ([]*model.Project queries := []*proj_model.ProjectViewSearchQuery{ &proj_model.ProjectViewSearchQuery{Key: proj_model.ProjectViewSearchKeyResourceOwner, Value: orgID, Method: global_model.SearchMethodEquals}, } - query := view.PrepareSearchQuery(table, model.ProjectSearchRequest{Queries: queries}) + query := repository.PrepareSearchQuery(table, model.ProjectSearchRequest{Queries: queries}) _, err := query(db, &projects) if err != nil { return nil, err @@ -32,7 +32,7 @@ func ProjectsByResourceOwner(db *gorm.DB, table, orgID string) ([]*model.Project func SearchProjects(db *gorm.DB, table string, req *proj_model.ProjectViewSearchRequest) ([]*model.ProjectView, int, error) { projects := make([]*model.ProjectView, 0) - query := view.PrepareSearchQuery(table, model.ProjectSearchRequest{Limit: req.Limit, Offset: req.Offset, Queries: req.Queries}) + query := repository.PrepareSearchQuery(table, model.ProjectSearchRequest{Limit: req.Limit, Offset: req.Offset, Queries: req.Queries}) count, err := query(db, &projects) if err != nil { return nil, 0, err @@ -41,11 +41,11 @@ func SearchProjects(db *gorm.DB, table string, req *proj_model.ProjectViewSearch } func PutProject(db *gorm.DB, table string, project *model.ProjectView) error { - save := view.PrepareSave(table) + save := repository.PrepareSave(table) return save(db, project) } func DeleteProject(db *gorm.DB, table, projectID string) error { - delete := view.PrepareDeleteByKey(table, model.ProjectSearchKey(proj_model.ProjectViewSearchKeyProjectID), projectID) + delete := repository.PrepareDeleteByKey(table, model.ProjectSearchKey(proj_model.ProjectViewSearchKeyProjectID), projectID) return delete(db) } diff --git a/internal/token/repository/view/model/token_query.go b/internal/token/repository/view/model/token_query.go index 62089c1a18..28a8f5dddc 100644 --- a/internal/token/repository/view/model/token_query.go +++ b/internal/token/repository/view/model/token_query.go @@ -3,7 +3,7 @@ package model import ( global_model "github.com/caos/zitadel/internal/model" token_model "github.com/caos/zitadel/internal/token/model" - "github.com/caos/zitadel/internal/view" + "github.com/caos/zitadel/internal/view/repository" ) type TokenSearchRequest token_model.TokenSearchRequest @@ -18,7 +18,7 @@ func (req TokenSearchRequest) GetOffset() uint64 { return req.Offset } -func (req TokenSearchRequest) GetSortingColumn() view.ColumnKey { +func (req TokenSearchRequest) GetSortingColumn() repository.ColumnKey { if req.SortingColumn == token_model.TokenSearchKeyUnspecified { return nil } @@ -29,15 +29,15 @@ func (req TokenSearchRequest) GetAsc() bool { return req.Asc } -func (req TokenSearchRequest) GetQueries() []view.SearchQuery { - result := make([]view.SearchQuery, len(req.Queries)) +func (req TokenSearchRequest) GetQueries() []repository.SearchQuery { + result := make([]repository.SearchQuery, len(req.Queries)) for i, q := range req.Queries { result[i] = TokenSearchQuery{Key: q.Key, Value: q.Value, Method: q.Method} } return result } -func (req TokenSearchQuery) GetKey() view.ColumnKey { +func (req TokenSearchQuery) GetKey() repository.ColumnKey { return TokenSearchKey(req.Key) } diff --git a/internal/token/repository/view/token.go b/internal/token/repository/view/token.go index ad6c1cc2d5..c9fb4c7af0 100644 --- a/internal/token/repository/view/token.go +++ b/internal/token/repository/view/token.go @@ -1,6 +1,7 @@ package view import ( + "github.com/caos/zitadel/internal/view/repository" "time" "github.com/jinzhu/gorm" @@ -9,12 +10,11 @@ import ( "github.com/caos/zitadel/internal/errors" token_model "github.com/caos/zitadel/internal/token/model" "github.com/caos/zitadel/internal/token/repository/view/model" - "github.com/caos/zitadel/internal/view" ) func TokenByID(db *gorm.DB, table, tokenID string) (*model.Token, error) { token := new(model.Token) - query := view.PrepareGetByKey(table, model.TokenSearchKey(token_model.TokenSearchKeyTokenID), tokenID) + query := repository.PrepareGetByKey(table, model.TokenSearchKey(token_model.TokenSearchKeyTokenID), tokenID) err := query(db, token) return token, err } @@ -31,29 +31,29 @@ func IsTokenValid(db *gorm.DB, table, tokenID string) (bool, error) { } func PutToken(db *gorm.DB, table string, token *model.Token) error { - save := view.PrepareSave(table) + save := repository.PrepareSave(table) return save(db, token) } func DeleteToken(db *gorm.DB, table, tokenID string) error { - delete := view.PrepareDeleteByKey(table, model.TokenSearchKey(token_model.TokenSearchKeyTokenID), tokenID) + delete := repository.PrepareDeleteByKey(table, model.TokenSearchKey(token_model.TokenSearchKeyTokenID), tokenID) return delete(db) } func DeleteSessionTokens(db *gorm.DB, table, agentID, userID string) error { - delete := view.PrepareDeleteByKeys(table, - view.Key{Key: model.TokenSearchKey(token_model.TokenSearchKeyUserAgentID), Value: agentID}, - view.Key{Key: model.TokenSearchKey(token_model.TokenSearchKeyUserID), Value: userID}, + delete := repository.PrepareDeleteByKeys(table, + repository.Key{Key: model.TokenSearchKey(token_model.TokenSearchKeyUserAgentID), Value: agentID}, + repository.Key{Key: model.TokenSearchKey(token_model.TokenSearchKeyUserID), Value: userID}, ) return delete(db) } func DeleteUserTokens(db *gorm.DB, table, userID string) error { - delete := view.PrepareDeleteByKey(table, model.TokenSearchKey(token_model.TokenSearchKeyUserID), userID) + delete := repository.PrepareDeleteByKey(table, model.TokenSearchKey(token_model.TokenSearchKeyUserID), userID) return delete(db) } func DeleteApplicationTokens(db *gorm.DB, table string, appIDs []string) error { - delete := view.PrepareDeleteByKey(table, model.TokenSearchKey(token_model.TokenSearchKeyApplicationID), pq.StringArray(appIDs)) + delete := repository.PrepareDeleteByKey(table, model.TokenSearchKey(token_model.TokenSearchKeyApplicationID), pq.StringArray(appIDs)) return delete(db) } diff --git a/internal/user/repository/view/model/user_query.go b/internal/user/repository/view/model/user_query.go index f812587cdc..a59755d3c8 100644 --- a/internal/user/repository/view/model/user_query.go +++ b/internal/user/repository/view/model/user_query.go @@ -3,7 +3,7 @@ package model import ( global_model "github.com/caos/zitadel/internal/model" usr_model "github.com/caos/zitadel/internal/user/model" - "github.com/caos/zitadel/internal/view" + "github.com/caos/zitadel/internal/view/repository" ) type UserSearchRequest usr_model.UserSearchRequest @@ -18,7 +18,7 @@ func (req UserSearchRequest) GetOffset() uint64 { return req.Offset } -func (req UserSearchRequest) GetSortingColumn() view.ColumnKey { +func (req UserSearchRequest) GetSortingColumn() repository.ColumnKey { if req.SortingColumn == usr_model.UserSearchKeyUnspecified { return nil } @@ -29,15 +29,15 @@ func (req UserSearchRequest) GetAsc() bool { return req.Asc } -func (req UserSearchRequest) GetQueries() []view.SearchQuery { - result := make([]view.SearchQuery, len(req.Queries)) +func (req UserSearchRequest) GetQueries() []repository.SearchQuery { + result := make([]repository.SearchQuery, len(req.Queries)) for i, q := range req.Queries { result[i] = UserSearchQuery{Key: q.Key, Value: q.Value, Method: q.Method} } return result } -func (req UserSearchQuery) GetKey() view.ColumnKey { +func (req UserSearchQuery) GetKey() repository.ColumnKey { return UserSearchKey(req.Key) } diff --git a/internal/user/repository/view/model/user_session_query.go b/internal/user/repository/view/model/user_session_query.go index 654d206b0f..053742e7f3 100644 --- a/internal/user/repository/view/model/user_session_query.go +++ b/internal/user/repository/view/model/user_session_query.go @@ -3,7 +3,7 @@ package model import ( global_model "github.com/caos/zitadel/internal/model" usr_model "github.com/caos/zitadel/internal/user/model" - "github.com/caos/zitadel/internal/view" + "github.com/caos/zitadel/internal/view/repository" ) type UserSessionSearchRequest usr_model.UserSessionSearchRequest @@ -18,7 +18,7 @@ func (req UserSessionSearchRequest) GetOffset() uint64 { return req.Offset } -func (req UserSessionSearchRequest) GetSortingColumn() view.ColumnKey { +func (req UserSessionSearchRequest) GetSortingColumn() repository.ColumnKey { if req.SortingColumn == usr_model.UserSessionSearchKeyUnspecified { return nil } @@ -29,15 +29,15 @@ func (req UserSessionSearchRequest) GetAsc() bool { return req.Asc } -func (req UserSessionSearchRequest) GetQueries() []view.SearchQuery { - result := make([]view.SearchQuery, len(req.Queries)) +func (req UserSessionSearchRequest) GetQueries() []repository.SearchQuery { + result := make([]repository.SearchQuery, len(req.Queries)) for i, q := range req.Queries { result[i] = UserSessionSearchQuery{Key: q.Key, Value: q.Value, Method: q.Method} } return result } -func (req UserSessionSearchQuery) GetKey() view.ColumnKey { +func (req UserSessionSearchQuery) GetKey() repository.ColumnKey { return UserSessionSearchKey(req.Key) } diff --git a/internal/user/repository/view/notify_user.go b/internal/user/repository/view/notify_user.go index 325cb08223..cd0be724bf 100644 --- a/internal/user/repository/view/notify_user.go +++ b/internal/user/repository/view/notify_user.go @@ -3,23 +3,23 @@ package view import ( usr_model "github.com/caos/zitadel/internal/user/model" "github.com/caos/zitadel/internal/user/repository/view/model" - "github.com/caos/zitadel/internal/view" + "github.com/caos/zitadel/internal/view/repository" "github.com/jinzhu/gorm" ) func NotifyUserByID(db *gorm.DB, table, userID string) (*model.NotifyUser, error) { user := new(model.NotifyUser) - query := view.PrepareGetByKey(table, model.UserSearchKey(usr_model.NotifyUserSearchKeyUserID), userID) + query := repository.PrepareGetByKey(table, model.UserSearchKey(usr_model.NotifyUserSearchKeyUserID), userID) err := query(db, user) return user, err } func PutNotifyUser(db *gorm.DB, table string, project *model.NotifyUser) error { - save := view.PrepareSave(table) + save := repository.PrepareSave(table) return save(db, project) } func DeleteNotifyUser(db *gorm.DB, table, userID string) error { - delete := view.PrepareDeleteByKey(table, model.UserSearchKey(usr_model.NotifyUserSearchKeyUserID), userID) + delete := repository.PrepareDeleteByKey(table, model.UserSearchKey(usr_model.NotifyUserSearchKeyUserID), userID) return delete(db) } diff --git a/internal/user/repository/view/user_session_view.go b/internal/user/repository/view/user_session_view.go index fa583aa29f..d6091cdf6a 100644 --- a/internal/user/repository/view/user_session_view.go +++ b/internal/user/repository/view/user_session_view.go @@ -1,12 +1,12 @@ package view import ( + "github.com/caos/zitadel/internal/view/repository" "github.com/jinzhu/gorm" global_model "github.com/caos/zitadel/internal/model" usr_model "github.com/caos/zitadel/internal/user/model" "github.com/caos/zitadel/internal/user/repository/view/model" - "github.com/caos/zitadel/internal/view" ) func UserSessionByIDs(db *gorm.DB, table, agentID, userID string) (*model.UserSessionView, error) { @@ -21,7 +21,7 @@ func UserSessionByIDs(db *gorm.DB, table, agentID, userID string) (*model.UserSe Method: global_model.SearchMethodEquals, Value: userID, } - query := view.PrepareGetByQuery(table, userAgentQuery, userQuery) + query := repository.PrepareGetByQuery(table, userAgentQuery, userQuery) err := query(db, userSession) return userSession, err } @@ -33,7 +33,7 @@ func UserSessionsByUserID(db *gorm.DB, table, userID string) ([]*model.UserSessi Method: global_model.SearchMethodEquals, Value: userID, } - query := view.PrepareSearchQuery(table, model.UserSessionSearchRequest{ + query := repository.PrepareSearchQuery(table, model.UserSessionSearchRequest{ Queries: []*usr_model.UserSessionSearchQuery{userAgentQuery}, }) _, err := query(db, &userSessions) @@ -47,7 +47,7 @@ func UserSessionsByAgentID(db *gorm.DB, table, agentID string) ([]*model.UserSes Method: global_model.SearchMethodEquals, Value: agentID, } - query := view.PrepareSearchQuery(table, model.UserSessionSearchRequest{ + query := repository.PrepareSearchQuery(table, model.UserSessionSearchRequest{ Queries: []*usr_model.UserSessionSearchQuery{userAgentQuery}, }) _, err := query(db, &userSessions) @@ -55,11 +55,11 @@ func UserSessionsByAgentID(db *gorm.DB, table, agentID string) ([]*model.UserSes } func PutUserSession(db *gorm.DB, table string, session *model.UserSessionView) error { - save := view.PrepareSave(table) + save := repository.PrepareSave(table) return save(db, session) } func DeleteUserSessions(db *gorm.DB, table, userID string) error { - delete := view.PrepareDeleteByKey(table, model.UserSessionSearchKey(usr_model.UserSessionSearchKeyUserID), userID) + delete := repository.PrepareDeleteByKey(table, model.UserSessionSearchKey(usr_model.UserSessionSearchKeyUserID), userID) return delete(db) } diff --git a/internal/user/repository/view/user_view.go b/internal/user/repository/view/user_view.go index b6a8d9d27e..f61af06a6b 100644 --- a/internal/user/repository/view/user_view.go +++ b/internal/user/repository/view/user_view.go @@ -1,18 +1,18 @@ package view import ( + "github.com/caos/zitadel/internal/view/repository" "github.com/jinzhu/gorm" caos_errs "github.com/caos/zitadel/internal/errors" global_model "github.com/caos/zitadel/internal/model" usr_model "github.com/caos/zitadel/internal/user/model" "github.com/caos/zitadel/internal/user/repository/view/model" - "github.com/caos/zitadel/internal/view" ) func UserByID(db *gorm.DB, table, userID string) (*model.UserView, error) { user := new(model.UserView) - query := view.PrepareGetByKey(table, model.UserSearchKey(usr_model.UserSearchKeyUserID), userID) + query := repository.PrepareGetByKey(table, model.UserSearchKey(usr_model.UserSearchKeyUserID), userID) err := query(db, user) if caos_errs.IsNotFound(err) { return nil, caos_errs.ThrowNotFound(nil, "VIEW-sj8Sw", "Errors.User.NotFound") @@ -22,7 +22,7 @@ func UserByID(db *gorm.DB, table, userID string) (*model.UserView, error) { func UserByUserName(db *gorm.DB, table, userName string) (*model.UserView, error) { user := new(model.UserView) - query := view.PrepareGetByKey(table, model.UserSearchKey(usr_model.UserSearchKeyUserName), userName) + query := repository.PrepareGetByKey(table, model.UserSearchKey(usr_model.UserSearchKeyUserName), userName) err := query(db, user) if caos_errs.IsNotFound(err) { return nil, caos_errs.ThrowNotFound(nil, "VIEW-Lso9s", "Errors.User.NotFound") @@ -37,7 +37,7 @@ func UserByLoginName(db *gorm.DB, table, loginName string) (*model.UserView, err Method: global_model.SearchMethodListContains, Value: loginName, } - query := view.PrepareGetByQuery(table, loginNameQuery) + query := repository.PrepareGetByQuery(table, loginNameQuery) err := query(db, user) return user, err } @@ -49,7 +49,7 @@ func UsersByOrgID(db *gorm.DB, table, orgID string) ([]*model.UserView, error) { Method: global_model.SearchMethodEquals, Value: orgID, } - query := view.PrepareSearchQuery(table, model.UserSearchRequest{ + query := repository.PrepareSearchQuery(table, model.UserSearchRequest{ Queries: []*usr_model.UserSearchQuery{orgIDQuery}, }) _, err := query(db, &users) @@ -58,7 +58,7 @@ func UsersByOrgID(db *gorm.DB, table, orgID string) ([]*model.UserView, error) { func SearchUsers(db *gorm.DB, table string, req *usr_model.UserSearchRequest) ([]*model.UserView, int, error) { users := make([]*model.UserView, 0) - query := view.PrepareSearchQuery(table, model.UserSearchRequest{Limit: req.Limit, Offset: req.Offset, Queries: req.Queries}) + query := repository.PrepareSearchQuery(table, model.UserSearchRequest{Limit: req.Limit, Offset: req.Offset, Queries: req.Queries}) count, err := query(db, &users) if err != nil { return nil, 0, err @@ -68,7 +68,7 @@ func SearchUsers(db *gorm.DB, table string, req *usr_model.UserSearchRequest) ([ func GetGlobalUserByEmail(db *gorm.DB, table, email string) (*model.UserView, error) { user := new(model.UserView) - query := view.PrepareGetByKey(table, model.UserSearchKey(usr_model.UserSearchKeyEmail), email) + query := repository.PrepareGetByKey(table, model.UserSearchKey(usr_model.UserSearchKeyEmail), email) err := query(db, user) if caos_errs.IsNotFound(err) { return nil, caos_errs.ThrowNotFound(nil, "VIEW-8uWer", "Errors.User.NotFound") @@ -78,7 +78,7 @@ func GetGlobalUserByEmail(db *gorm.DB, table, email string) (*model.UserView, er func IsUserUnique(db *gorm.DB, table, userName, email string) (bool, error) { user := new(model.UserView) - query := view.PrepareGetByKey(table, model.UserSearchKey(usr_model.UserSearchKeyEmail), email) + query := repository.PrepareGetByKey(table, model.UserSearchKey(usr_model.UserSearchKeyEmail), email) err := query(db, user) if err != nil && !caos_errs.IsNotFound(err) { return false, err @@ -86,7 +86,7 @@ func IsUserUnique(db *gorm.DB, table, userName, email string) (bool, error) { if user != nil { return false, nil } - query = view.PrepareGetByKey(table, model.UserSearchKey(usr_model.UserSearchKeyUserName), email) + query = repository.PrepareGetByKey(table, model.UserSearchKey(usr_model.UserSearchKeyUserName), email) err = query(db, user) if err != nil && !caos_errs.IsNotFound(err) { return false, err @@ -106,11 +106,11 @@ func UserMfas(db *gorm.DB, table, userID string) ([]*usr_model.MultiFactor, erro } func PutUser(db *gorm.DB, table string, project *model.UserView) error { - save := view.PrepareSave(table) + save := repository.PrepareSave(table) return save(db, project) } func DeleteUser(db *gorm.DB, table, userID string) error { - delete := view.PrepareDeleteByKey(table, model.UserSearchKey(usr_model.UserSearchKeyUserID), userID) + delete := repository.PrepareDeleteByKey(table, model.UserSearchKey(usr_model.UserSearchKeyUserID), userID) return delete(db) } diff --git a/internal/usergrant/repository/view/model/user_grant_query.go b/internal/usergrant/repository/view/model/user_grant_query.go index f5e858b4d0..35c0f4275f 100644 --- a/internal/usergrant/repository/view/model/user_grant_query.go +++ b/internal/usergrant/repository/view/model/user_grant_query.go @@ -3,7 +3,7 @@ package model import ( global_model "github.com/caos/zitadel/internal/model" grant_model "github.com/caos/zitadel/internal/usergrant/model" - "github.com/caos/zitadel/internal/view" + "github.com/caos/zitadel/internal/view/repository" ) type UserGrantSearchRequest grant_model.UserGrantSearchRequest @@ -18,7 +18,7 @@ func (req UserGrantSearchRequest) GetOffset() uint64 { return req.Offset } -func (req UserGrantSearchRequest) GetSortingColumn() view.ColumnKey { +func (req UserGrantSearchRequest) GetSortingColumn() repository.ColumnKey { if req.SortingColumn == grant_model.UserGrantSearchKeyUnspecified { return nil } @@ -29,15 +29,15 @@ func (req UserGrantSearchRequest) GetAsc() bool { return req.Asc } -func (req UserGrantSearchRequest) GetQueries() []view.SearchQuery { - result := make([]view.SearchQuery, len(req.Queries)) +func (req UserGrantSearchRequest) GetQueries() []repository.SearchQuery { + result := make([]repository.SearchQuery, len(req.Queries)) for i, q := range req.Queries { result[i] = UserGrantSearchQuery{Key: q.Key, Value: q.Value, Method: q.Method} } return result } -func (req UserGrantSearchQuery) GetKey() view.ColumnKey { +func (req UserGrantSearchQuery) GetKey() repository.ColumnKey { return UserGrantSearchKey(req.Key) } diff --git a/internal/usergrant/repository/view/user_grant_view.go b/internal/usergrant/repository/view/user_grant_view.go index fbd2aca151..19f5121426 100644 --- a/internal/usergrant/repository/view/user_grant_view.go +++ b/internal/usergrant/repository/view/user_grant_view.go @@ -4,13 +4,13 @@ import ( global_model "github.com/caos/zitadel/internal/model" grant_model "github.com/caos/zitadel/internal/usergrant/model" "github.com/caos/zitadel/internal/usergrant/repository/view/model" - "github.com/caos/zitadel/internal/view" + "github.com/caos/zitadel/internal/view/repository" "github.com/jinzhu/gorm" ) func UserGrantByID(db *gorm.DB, table, grantID string) (*model.UserGrantView, error) { user := new(model.UserGrantView) - query := view.PrepareGetByKey(table, model.UserGrantSearchKey(grant_model.UserGrantSearchKeyGrantID), grantID) + query := repository.PrepareGetByKey(table, model.UserGrantSearchKey(grant_model.UserGrantSearchKeyGrantID), grantID) err := query(db, user) return user, err } @@ -21,14 +21,14 @@ func UserGrantByIDs(db *gorm.DB, table, resourceOwnerID, projectID, userID strin resourceOwnerIDQuery := model.UserGrantSearchQuery{Key: grant_model.UserGrantSearchKeyResourceOwner, Value: resourceOwnerID, Method: global_model.SearchMethodEquals} projectIDQuery := model.UserGrantSearchQuery{Key: grant_model.UserGrantSearchKeyProjectID, Value: projectID, Method: global_model.SearchMethodEquals} userIDQuery := model.UserGrantSearchQuery{Key: grant_model.UserGrantSearchKeyUserID, Value: userID, Method: global_model.SearchMethodEquals} - query := view.PrepareGetByQuery(table, resourceOwnerIDQuery, projectIDQuery, userIDQuery) + query := repository.PrepareGetByQuery(table, resourceOwnerIDQuery, projectIDQuery, userIDQuery) err := query(db, user) return user, err } func SearchUserGrants(db *gorm.DB, table string, req *grant_model.UserGrantSearchRequest) ([]*model.UserGrantView, int, error) { users := make([]*model.UserGrantView, 0) - query := view.PrepareSearchQuery(table, model.UserGrantSearchRequest{Limit: req.Limit, Offset: req.Offset, Queries: req.Queries}) + query := repository.PrepareSearchQuery(table, model.UserGrantSearchRequest{Limit: req.Limit, Offset: req.Offset, Queries: req.Queries}) count, err := query(db, &users) if err != nil { return nil, 0, err @@ -41,7 +41,7 @@ func UserGrantsByUserID(db *gorm.DB, table, userID string) ([]*model.UserGrantVi queries := []*grant_model.UserGrantSearchQuery{ &grant_model.UserGrantSearchQuery{Key: grant_model.UserGrantSearchKeyUserID, Value: userID, Method: global_model.SearchMethodEquals}, } - query := view.PrepareSearchQuery(table, model.UserGrantSearchRequest{Queries: queries}) + query := repository.PrepareSearchQuery(table, model.UserGrantSearchRequest{Queries: queries}) _, err := query(db, &users) if err != nil { return nil, err @@ -54,7 +54,7 @@ func UserGrantsByProjectID(db *gorm.DB, table, projectID string) ([]*model.UserG queries := []*grant_model.UserGrantSearchQuery{ &grant_model.UserGrantSearchQuery{Key: grant_model.UserGrantSearchKeyProjectID, Value: projectID, Method: global_model.SearchMethodEquals}, } - query := view.PrepareSearchQuery(table, model.UserGrantSearchRequest{Queries: queries}) + query := repository.PrepareSearchQuery(table, model.UserGrantSearchRequest{Queries: queries}) _, err := query(db, &users) if err != nil { return nil, err @@ -68,7 +68,7 @@ func UserGrantsByProjectIDAndRole(db *gorm.DB, table, projectID, roleKey string) &grant_model.UserGrantSearchQuery{Key: grant_model.UserGrantSearchKeyProjectID, Value: projectID, Method: global_model.SearchMethodEquals}, &grant_model.UserGrantSearchQuery{Key: grant_model.UserGrantSearchKeyRoleKey, Value: roleKey, Method: global_model.SearchMethodListContains}, } - query := view.PrepareSearchQuery(table, model.UserGrantSearchRequest{Queries: queries}) + query := repository.PrepareSearchQuery(table, model.UserGrantSearchRequest{Queries: queries}) _, err := query(db, &users) if err != nil { return nil, err @@ -82,7 +82,7 @@ func UserGrantsByOrgIDAndProjectID(db *gorm.DB, table, orgID, projectID string) &grant_model.UserGrantSearchQuery{Key: grant_model.UserGrantSearchKeyResourceOwner, Value: orgID, Method: global_model.SearchMethodEquals}, &grant_model.UserGrantSearchQuery{Key: grant_model.UserGrantSearchKeyProjectID, Value: projectID, Method: global_model.SearchMethodEquals}, } - query := view.PrepareSearchQuery(table, model.UserGrantSearchRequest{Queries: queries}) + query := repository.PrepareSearchQuery(table, model.UserGrantSearchRequest{Queries: queries}) _, err := query(db, &users) if err != nil { return nil, err @@ -95,7 +95,7 @@ func UserGrantsByOrgID(db *gorm.DB, table, orgID string) ([]*model.UserGrantView queries := []*grant_model.UserGrantSearchQuery{ &grant_model.UserGrantSearchQuery{Key: grant_model.UserGrantSearchKeyResourceOwner, Value: orgID, Method: global_model.SearchMethodEquals}, } - query := view.PrepareSearchQuery(table, model.UserGrantSearchRequest{Queries: queries}) + query := repository.PrepareSearchQuery(table, model.UserGrantSearchRequest{Queries: queries}) _, err := query(db, &users) if err != nil { return nil, err @@ -104,11 +104,11 @@ func UserGrantsByOrgID(db *gorm.DB, table, orgID string) ([]*model.UserGrantView } func PutUserGrant(db *gorm.DB, table string, grant *model.UserGrantView) error { - save := view.PrepareSave(table) + save := repository.PrepareSave(table) return save(db, grant) } func DeleteUserGrant(db *gorm.DB, table, grantID string) error { - delete := view.PrepareDeleteByKey(table, model.UserGrantSearchKey(grant_model.UserGrantSearchKeyGrantID), grantID) + delete := repository.PrepareDeleteByKey(table, model.UserGrantSearchKey(grant_model.UserGrantSearchKeyGrantID), grantID) return delete(db) } diff --git a/internal/view/model/failed_event.go b/internal/view/model/failed_event.go new file mode 100644 index 0000000000..de01b4b9d9 --- /dev/null +++ b/internal/view/model/failed_event.go @@ -0,0 +1,9 @@ +package model + +type FailedEvent struct { + Database string + ViewName string + FailedSequence uint64 + FailureCount uint64 + ErrMsg string +} diff --git a/internal/view/model/general_query.go b/internal/view/model/general_query.go new file mode 100644 index 0000000000..285628eb3a --- /dev/null +++ b/internal/view/model/general_query.go @@ -0,0 +1,23 @@ +package model + +import "github.com/caos/zitadel/internal/model" + +type GeneralSearchRequest struct { + Offset uint64 + Limit uint64 + SortingColumn GeneralSearchKey + Asc bool + Queries []*GeneralSearchQuery +} + +type GeneralSearchKey int32 + +const ( + GeneralSearchKeyUnspecified GeneralSearchKey = iota +) + +type GeneralSearchQuery struct { + Key GeneralSearchKey + Method model.SearchMethod + Value interface{} +} diff --git a/internal/view/model/view.go b/internal/view/model/view.go new file mode 100644 index 0000000000..d8caf9d282 --- /dev/null +++ b/internal/view/model/view.go @@ -0,0 +1,7 @@ +package model + +type View struct { + Database string + ViewName string + CurrentSequence uint64 +} diff --git a/internal/view/config.go b/internal/view/repository/config.go similarity index 96% rename from internal/view/config.go rename to internal/view/repository/config.go index a623b27d05..2d1f3f35d9 100644 --- a/internal/view/config.go +++ b/internal/view/repository/config.go @@ -1,4 +1,4 @@ -package view +package repository import ( "database/sql" diff --git a/internal/view/db_mock_test.go b/internal/view/repository/db_mock_test.go similarity index 96% rename from internal/view/db_mock_test.go rename to internal/view/repository/db_mock_test.go index 438f2554a8..697b9e79fa 100644 --- a/internal/view/db_mock_test.go +++ b/internal/view/repository/db_mock_test.go @@ -1,4 +1,4 @@ -package view +package repository import ( "database/sql/driver" @@ -28,6 +28,7 @@ var ( } expectedRemoveByObject = `DELETE FROM "%s" WHERE "%s"."%s" = \$1` expectedRemoveByObjectMultiplePK = `DELETE FROM "%s" WHERE "%s"."%s" = \$1 AND "%s"."%s" = \$2` + expectedTruncate = `TRUNCATE %s;` expectedSearch = `SELECT \* FROM "%s" OFFSET 0` expectedSearchCount = `SELECT count\(\*\) FROM "%s"` expectedSearchLimit = `SELECT \* FROM "%s" LIMIT %v OFFSET 0` @@ -289,6 +290,20 @@ func (db *dbMock) expectRemoveErr(table, key, value string, err error) *dbMock { return db } +func (db *dbMock) expectTruncate(table string) *dbMock { + query := fmt.Sprintf(expectedTruncate, table) + db.mock.ExpectExec(query). + WillReturnResult(sqlmock.NewResult(1, 1)) + + return db +} +func (db *dbMock) expectTruncateErr(table string, err error) *dbMock { + query := fmt.Sprintf(expectedTruncate, table) + db.mock.ExpectExec(query). + WillReturnError(err) + + return db +} func (db *dbMock) expectGetSearchRequestNoParams(table string, resultAmount, total int) *dbMock { query := fmt.Sprintf(expectedSearch, table) queryCount := fmt.Sprintf(expectedSearchCount, table) diff --git a/internal/view/failed_events.go b/internal/view/repository/failed_events.go similarity index 63% rename from internal/view/failed_events.go rename to internal/view/repository/failed_events.go index 3d74022694..fe0aef5551 100644 --- a/internal/view/failed_events.go +++ b/internal/view/repository/failed_events.go @@ -1,9 +1,11 @@ -package view +package repository import ( "github.com/caos/zitadel/internal/errors" "github.com/caos/zitadel/internal/model" + view_model "github.com/caos/zitadel/internal/view/model" "github.com/jinzhu/gorm" + "strings" ) const ( @@ -57,6 +59,25 @@ func (key failedEventSearchKey) ToColumnName() string { } } +func FailedEventFromModel(failedEvent *view_model.FailedEvent) *FailedEvent { + return &FailedEvent{ + ViewName: failedEvent.Database + "." + failedEvent.ViewName, + FailureCount: failedEvent.FailureCount, + FailedSequence: failedEvent.FailedSequence, + ErrMsg: failedEvent.ErrMsg, + } +} +func FailedEventToModel(failedEvent *FailedEvent) *view_model.FailedEvent { + dbView := strings.Split(failedEvent.ViewName, ".") + return &view_model.FailedEvent{ + Database: dbView[0], + ViewName: dbView[1], + FailureCount: failedEvent.FailureCount, + FailedSequence: failedEvent.FailedSequence, + ErrMsg: failedEvent.ErrMsg, + } +} + func SaveFailedEvent(db *gorm.DB, table string, failedEvent *FailedEvent) error { save := PrepareSave(table) err := save(db, failedEvent) @@ -67,6 +88,14 @@ func SaveFailedEvent(db *gorm.DB, table string, failedEvent *FailedEvent) error return nil } +func RemoveFailedEvent(db *gorm.DB, table string, failedEvent *FailedEvent) error { + delete := PrepareDeleteByKeys(table, + Key{Key: failedEventSearchKey(FailedEventKeyViewName), Value: failedEvent.ViewName}, + Key{Key: failedEventSearchKey(FailedEventKeyFailedSequence), Value: failedEvent.FailedSequence}, + ) + return delete(db) +} + func LatestFailedEvent(db *gorm.DB, table, viewName string, sequence uint64) (*FailedEvent, error) { failedEvent := new(FailedEvent) queries := []SearchQuery{ @@ -90,3 +119,13 @@ func LatestFailedEvent(db *gorm.DB, table, viewName string, sequence uint64) (*F return nil, errors.ThrowInternalf(err, "VIEW-9LyCB", "unable to get failed events of %s", viewName) } + +func AllFailedEvents(db *gorm.DB, table string) ([]*FailedEvent, error) { + failedEvents := make([]*FailedEvent, 0) + query := PrepareSearchQuery(table, GeneralSearchRequest{}) + _, err := query(db, &failedEvents) + if err != nil { + return nil, err + } + return failedEvents, nil +} diff --git a/internal/view/repository/general_query.go b/internal/view/repository/general_query.go new file mode 100644 index 0000000000..df53841c18 --- /dev/null +++ b/internal/view/repository/general_query.go @@ -0,0 +1,53 @@ +package repository + +import ( + global_model "github.com/caos/zitadel/internal/model" + "github.com/caos/zitadel/internal/view/model" +) + +type GeneralSearchRequest model.GeneralSearchRequest +type GeneralSearchQuery model.GeneralSearchQuery +type GeneralSearchKey model.GeneralSearchKey + +func (req GeneralSearchRequest) GetLimit() uint64 { + return req.Limit +} + +func (req GeneralSearchRequest) GetOffset() uint64 { + return req.Offset +} + +func (req GeneralSearchRequest) GetSortingColumn() ColumnKey { + if req.SortingColumn == model.GeneralSearchKeyUnspecified { + return nil + } + return GeneralSearchKey(req.SortingColumn) +} + +func (req GeneralSearchRequest) GetAsc() bool { + return req.Asc +} + +func (req GeneralSearchRequest) GetQueries() []SearchQuery { + result := make([]SearchQuery, len(req.Queries)) + for i, q := range req.Queries { + result[i] = GeneralSearchQuery{Key: q.Key, Value: q.Value, Method: q.Method} + } + return result +} + +func (req GeneralSearchQuery) GetKey() ColumnKey { + return GeneralSearchKey(req.Key) +} + +func (req GeneralSearchQuery) GetMethod() global_model.SearchMethod { + return req.Method +} + +func (req GeneralSearchQuery) GetValue() interface{} { + return req.Value +} + +func (key GeneralSearchKey) ToColumnName() string { + return "" +} diff --git a/internal/view/query.go b/internal/view/repository/query.go similarity index 99% rename from internal/view/query.go rename to internal/view/repository/query.go index fe4c73b0dd..c80148f22b 100644 --- a/internal/view/query.go +++ b/internal/view/repository/query.go @@ -1,4 +1,4 @@ -package view +package repository import ( "fmt" diff --git a/internal/view/query_test.go b/internal/view/repository/query_test.go similarity index 99% rename from internal/view/query_test.go rename to internal/view/repository/query_test.go index 05ea399461..2504e10967 100644 --- a/internal/view/query_test.go +++ b/internal/view/repository/query_test.go @@ -1,4 +1,4 @@ -package view +package repository import ( caos_errs "github.com/caos/zitadel/internal/errors" diff --git a/internal/view/requests.go b/internal/view/repository/requests.go similarity index 91% rename from internal/view/requests.go rename to internal/view/repository/requests.go index fff13ea971..c8cddaaada 100644 --- a/internal/view/requests.go +++ b/internal/view/repository/requests.go @@ -1,4 +1,4 @@ -package view +package repository import ( "errors" @@ -105,3 +105,15 @@ func PrepareDeleteByObject(table string, object interface{}) func(db *gorm.DB) e return nil } } + +func PrepareTruncate(table string) func(db *gorm.DB) error { + return func(db *gorm.DB) error { + err := db. + Exec("TRUNCATE " + table). + Error + if err != nil { + return caos_errs.ThrowInternal(err, "VIEW-lso9w", "could not truncate table") + } + return nil + } +} diff --git a/internal/view/requests_test.go b/internal/view/repository/requests_test.go similarity index 99% rename from internal/view/requests_test.go rename to internal/view/repository/requests_test.go index 510999e29e..20dec59488 100644 --- a/internal/view/requests_test.go +++ b/internal/view/repository/requests_test.go @@ -1,4 +1,4 @@ -package view +package repository import ( caos_errs "github.com/caos/zitadel/internal/errors" diff --git a/internal/view/sequence.go b/internal/view/repository/sequence.go similarity index 58% rename from internal/view/sequence.go rename to internal/view/repository/sequence.go index 6742a3bf51..645a205dfb 100644 --- a/internal/view/sequence.go +++ b/internal/view/repository/sequence.go @@ -1,15 +1,17 @@ -package view +package repository import ( caos_errs "github.com/caos/zitadel/internal/errors" + "github.com/caos/zitadel/internal/view/model" "github.com/jinzhu/gorm" + "strings" ) type actualSequece struct { ActualSequence uint64 `gorm:"column:current_sequence"` } -type currentSequence struct { +type CurrentSequence struct { ViewName string `gorm:"column:view_name;primary_key"` CurrentSequence uint64 `gorm:"column:current_sequence"` } @@ -32,9 +34,18 @@ func (key sequenceSearchKey) ToColumnName() string { } } +func CurrentSequenceToModel(sequence *CurrentSequence) *model.View { + dbView := strings.Split(sequence.ViewName, ".") + return &model.View{ + Database: dbView[0], + ViewName: dbView[1], + CurrentSequence: sequence.CurrentSequence, + } +} + func SaveCurrentSequence(db *gorm.DB, table, viewName string, sequence uint64) error { save := PrepareSave(table) - err := save(db, ¤tSequence{viewName, sequence}) + err := save(db, &CurrentSequence{viewName, sequence}) if err != nil { return caos_errs.ThrowInternal(err, "VIEW-5kOhP", "unable to updated processed sequence") @@ -56,3 +67,22 @@ func LatestSequence(db *gorm.DB, table, viewName string) (uint64, error) { } return 0, caos_errs.ThrowInternalf(err, "VIEW-9LyCB", "unable to get latest sequence of %s", viewName) } + +func AllCurrentSequences(db *gorm.DB, table string) ([]*CurrentSequence, error) { + sequences := make([]*CurrentSequence, 0) + query := PrepareSearchQuery(table, GeneralSearchRequest{}) + _, err := query(db, &sequences) + if err != nil { + return nil, err + } + return sequences, nil +} + +func ClearView(db *gorm.DB, truncateView, sequenceTable string) error { + truncate := PrepareTruncate(truncateView) + err := truncate(db) + if err != nil { + return err + } + return SaveCurrentSequence(db, sequenceTable, truncateView, 0) +} diff --git a/migrations/cockroach/V1.22__admin_view.sql b/migrations/cockroach/V1.22__admin_view.sql new file mode 100644 index 0000000000..c32333b179 --- /dev/null +++ b/migrations/cockroach/V1.22__admin_view.sql @@ -0,0 +1,15 @@ +BEGIN; + +GRANT SELECT, INSERT, UPDATE, DROP, DELETE ON DATABASE auth TO admin_api; +GRANT SELECT, INSERT, UPDATE, DROP, DELETE ON TABLE auth.* TO admin_api; + +GRANT SELECT, INSERT, UPDATE, DROP, DELETE ON DATABASE authz TO admin_api; +GRANT SELECT, INSERT, UPDATE, DROP, DELETE ON TABLE authz.* TO admin_api; + +GRANT SELECT, INSERT, UPDATE, DROP, DELETE ON DATABASE management TO admin_api; +GRANT SELECT, INSERT, UPDATE, DROP, DELETE ON TABLE management.* TO admin_api; + +GRANT SELECT, INSERT, UPDATE, DROP, DELETE ON DATABASE notification TO admin_api; +GRANT SELECT, INSERT, UPDATE, DROP, DELETE ON TABLE notification.* TO admin_api; + +COMMIT; \ No newline at end of file diff --git a/pkg/admin/api/grpc/admin.pb.authoptions.go b/pkg/admin/api/grpc/admin.pb.authoptions.go index ff0297b00d..07f02a886d 100644 --- a/pkg/admin/api/grpc/admin.pb.authoptions.go +++ b/pkg/admin/api/grpc/admin.pb.authoptions.go @@ -54,6 +54,26 @@ var AdminService_AuthMethods = utils_auth.MethodMapping{ Permission: "iam.policy.delete", CheckParam: "", }, + + "/caos.zitadel.admin.api.v1.AdminService/GetViews": utils_auth.Option{ + Permission: "iam.read", + CheckParam: "", + }, + + "/caos.zitadel.admin.api.v1.AdminService/ClearView": utils_auth.Option{ + Permission: "iam.write", + CheckParam: "", + }, + + "/caos.zitadel.admin.api.v1.AdminService/GetFailedEvents": utils_auth.Option{ + Permission: "iam.read", + CheckParam: "", + }, + + "/caos.zitadel.admin.api.v1.AdminService/RemoveFailedEvent": utils_auth.Option{ + Permission: "iam.write", + CheckParam: "", + }, } func AdminService_Authorization_Interceptor(verifier utils_auth.TokenVerifier, authConf *utils_auth.Config) grpc.UnaryServerInterceptor { diff --git a/pkg/admin/api/grpc/admin.pb.go b/pkg/admin/api/grpc/admin.pb.go index ca637a3851..7523f8fe6d 100644 --- a/pkg/admin/api/grpc/admin.pb.go +++ b/pkg/admin/api/grpc/admin.pb.go @@ -1,11 +1,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.20.1 +// protoc v3.11.3 // source: admin.proto package grpc import ( context "context" - fmt "fmt" _ "github.com/caos/zitadel/internal/protoc/protoc-gen-authoption/authoption" _ "github.com/envoyproxy/protoc-gen-validate/validate" proto "github.com/golang/protobuf/proto" @@ -17,19 +19,22 @@ import ( grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" - math "math" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 type OrgState int32 @@ -39,24 +44,45 @@ const ( OrgState_ORGSTATE_INACTIVE OrgState = 2 ) -var OrgState_name = map[int32]string{ - 0: "ORGSTATE_UNSPECIFIED", - 1: "ORGSTATE_ACTIVE", - 2: "ORGSTATE_INACTIVE", -} +// Enum value maps for OrgState. +var ( + OrgState_name = map[int32]string{ + 0: "ORGSTATE_UNSPECIFIED", + 1: "ORGSTATE_ACTIVE", + 2: "ORGSTATE_INACTIVE", + } + OrgState_value = map[string]int32{ + "ORGSTATE_UNSPECIFIED": 0, + "ORGSTATE_ACTIVE": 1, + "ORGSTATE_INACTIVE": 2, + } +) -var OrgState_value = map[string]int32{ - "ORGSTATE_UNSPECIFIED": 0, - "ORGSTATE_ACTIVE": 1, - "ORGSTATE_INACTIVE": 2, +func (x OrgState) Enum() *OrgState { + p := new(OrgState) + *p = x + return p } func (x OrgState) String() string { - return proto.EnumName(OrgState_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } +func (OrgState) Descriptor() protoreflect.EnumDescriptor { + return file_admin_proto_enumTypes[0].Descriptor() +} + +func (OrgState) Type() protoreflect.EnumType { + return &file_admin_proto_enumTypes[0] +} + +func (x OrgState) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use OrgState.Descriptor instead. func (OrgState) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_73a7fc70dcc2027c, []int{0} + return file_admin_proto_rawDescGZIP(), []int{0} } type OrgSearchKey int32 @@ -68,26 +94,47 @@ const ( OrgSearchKey_ORGSEARCHKEY_STATE OrgSearchKey = 3 ) -var OrgSearchKey_name = map[int32]string{ - 0: "ORGSEARCHKEY_UNSPECIFIED", - 1: "ORGSEARCHKEY_ORG_NAME", - 2: "ORGSEARCHKEY_DOMAIN", - 3: "ORGSEARCHKEY_STATE", -} +// Enum value maps for OrgSearchKey. +var ( + OrgSearchKey_name = map[int32]string{ + 0: "ORGSEARCHKEY_UNSPECIFIED", + 1: "ORGSEARCHKEY_ORG_NAME", + 2: "ORGSEARCHKEY_DOMAIN", + 3: "ORGSEARCHKEY_STATE", + } + OrgSearchKey_value = map[string]int32{ + "ORGSEARCHKEY_UNSPECIFIED": 0, + "ORGSEARCHKEY_ORG_NAME": 1, + "ORGSEARCHKEY_DOMAIN": 2, + "ORGSEARCHKEY_STATE": 3, + } +) -var OrgSearchKey_value = map[string]int32{ - "ORGSEARCHKEY_UNSPECIFIED": 0, - "ORGSEARCHKEY_ORG_NAME": 1, - "ORGSEARCHKEY_DOMAIN": 2, - "ORGSEARCHKEY_STATE": 3, +func (x OrgSearchKey) Enum() *OrgSearchKey { + p := new(OrgSearchKey) + *p = x + return p } func (x OrgSearchKey) String() string { - return proto.EnumName(OrgSearchKey_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } +func (OrgSearchKey) Descriptor() protoreflect.EnumDescriptor { + return file_admin_proto_enumTypes[1].Descriptor() +} + +func (OrgSearchKey) Type() protoreflect.EnumType { + return &file_admin_proto_enumTypes[1] +} + +func (x OrgSearchKey) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use OrgSearchKey.Descriptor instead. func (OrgSearchKey) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_73a7fc70dcc2027c, []int{1} + return file_admin_proto_rawDescGZIP(), []int{1} } type OrgSearchMethod int32 @@ -98,24 +145,45 @@ const ( OrgSearchMethod_ORGSEARCHMETHOD_CONTAINS OrgSearchMethod = 2 ) -var OrgSearchMethod_name = map[int32]string{ - 0: "ORGSEARCHMETHOD_EQUALS", - 1: "ORGSEARCHMETHOD_STARTS_WITH", - 2: "ORGSEARCHMETHOD_CONTAINS", -} +// Enum value maps for OrgSearchMethod. +var ( + OrgSearchMethod_name = map[int32]string{ + 0: "ORGSEARCHMETHOD_EQUALS", + 1: "ORGSEARCHMETHOD_STARTS_WITH", + 2: "ORGSEARCHMETHOD_CONTAINS", + } + OrgSearchMethod_value = map[string]int32{ + "ORGSEARCHMETHOD_EQUALS": 0, + "ORGSEARCHMETHOD_STARTS_WITH": 1, + "ORGSEARCHMETHOD_CONTAINS": 2, + } +) -var OrgSearchMethod_value = map[string]int32{ - "ORGSEARCHMETHOD_EQUALS": 0, - "ORGSEARCHMETHOD_STARTS_WITH": 1, - "ORGSEARCHMETHOD_CONTAINS": 2, +func (x OrgSearchMethod) Enum() *OrgSearchMethod { + p := new(OrgSearchMethod) + *p = x + return p } func (x OrgSearchMethod) String() string { - return proto.EnumName(OrgSearchMethod_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } +func (OrgSearchMethod) Descriptor() protoreflect.EnumDescriptor { + return file_admin_proto_enumTypes[2].Descriptor() +} + +func (OrgSearchMethod) Type() protoreflect.EnumType { + return &file_admin_proto_enumTypes[2] +} + +func (x OrgSearchMethod) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use OrgSearchMethod.Descriptor instead. func (OrgSearchMethod) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_73a7fc70dcc2027c, []int{2} + return file_admin_proto_rawDescGZIP(), []int{2} } type UserState int32 @@ -130,32 +198,53 @@ const ( UserState_USERSTATE_INITIAL UserState = 6 ) -var UserState_name = map[int32]string{ - 0: "USERSTATE_UNSPECIFIED", - 1: "USERSTATE_ACTIVE", - 2: "USERSTATE_INACTIVE", - 3: "USERSTATE_DELETED", - 4: "USERSTATE_LOCKED", - 5: "USERSTATE_SUSPEND", - 6: "USERSTATE_INITIAL", -} +// Enum value maps for UserState. +var ( + UserState_name = map[int32]string{ + 0: "USERSTATE_UNSPECIFIED", + 1: "USERSTATE_ACTIVE", + 2: "USERSTATE_INACTIVE", + 3: "USERSTATE_DELETED", + 4: "USERSTATE_LOCKED", + 5: "USERSTATE_SUSPEND", + 6: "USERSTATE_INITIAL", + } + UserState_value = map[string]int32{ + "USERSTATE_UNSPECIFIED": 0, + "USERSTATE_ACTIVE": 1, + "USERSTATE_INACTIVE": 2, + "USERSTATE_DELETED": 3, + "USERSTATE_LOCKED": 4, + "USERSTATE_SUSPEND": 5, + "USERSTATE_INITIAL": 6, + } +) -var UserState_value = map[string]int32{ - "USERSTATE_UNSPECIFIED": 0, - "USERSTATE_ACTIVE": 1, - "USERSTATE_INACTIVE": 2, - "USERSTATE_DELETED": 3, - "USERSTATE_LOCKED": 4, - "USERSTATE_SUSPEND": 5, - "USERSTATE_INITIAL": 6, +func (x UserState) Enum() *UserState { + p := new(UserState) + *p = x + return p } func (x UserState) String() string { - return proto.EnumName(UserState_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } +func (UserState) Descriptor() protoreflect.EnumDescriptor { + return file_admin_proto_enumTypes[3].Descriptor() +} + +func (UserState) Type() protoreflect.EnumType { + return &file_admin_proto_enumTypes[3] +} + +func (x UserState) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use UserState.Descriptor instead. func (UserState) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_73a7fc70dcc2027c, []int{3} + return file_admin_proto_rawDescGZIP(), []int{3} } type Gender int32 @@ -167,921 +256,1042 @@ const ( Gender_GENDER_DIVERSE Gender = 3 ) -var Gender_name = map[int32]string{ - 0: "GENDER_UNSPECIFIED", - 1: "GENDER_FEMALE", - 2: "GENDER_MALE", - 3: "GENDER_DIVERSE", -} +// Enum value maps for Gender. +var ( + Gender_name = map[int32]string{ + 0: "GENDER_UNSPECIFIED", + 1: "GENDER_FEMALE", + 2: "GENDER_MALE", + 3: "GENDER_DIVERSE", + } + Gender_value = map[string]int32{ + "GENDER_UNSPECIFIED": 0, + "GENDER_FEMALE": 1, + "GENDER_MALE": 2, + "GENDER_DIVERSE": 3, + } +) -var Gender_value = map[string]int32{ - "GENDER_UNSPECIFIED": 0, - "GENDER_FEMALE": 1, - "GENDER_MALE": 2, - "GENDER_DIVERSE": 3, +func (x Gender) Enum() *Gender { + p := new(Gender) + *p = x + return p } func (x Gender) String() string { - return proto.EnumName(Gender_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } +func (Gender) Descriptor() protoreflect.EnumDescriptor { + return file_admin_proto_enumTypes[4].Descriptor() +} + +func (Gender) Type() protoreflect.EnumType { + return &file_admin_proto_enumTypes[4] +} + +func (x Gender) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Gender.Descriptor instead. func (Gender) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_73a7fc70dcc2027c, []int{4} + return file_admin_proto_rawDescGZIP(), []int{4} } type OrgID struct { - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` } -func (m *OrgID) Reset() { *m = OrgID{} } -func (m *OrgID) String() string { return proto.CompactTextString(m) } -func (*OrgID) ProtoMessage() {} +func (x *OrgID) Reset() { + *x = OrgID{} + if protoimpl.UnsafeEnabled { + mi := &file_admin_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OrgID) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OrgID) ProtoMessage() {} + +func (x *OrgID) ProtoReflect() protoreflect.Message { + mi := &file_admin_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OrgID.ProtoReflect.Descriptor instead. func (*OrgID) Descriptor() ([]byte, []int) { - return fileDescriptor_73a7fc70dcc2027c, []int{0} + return file_admin_proto_rawDescGZIP(), []int{0} } -func (m *OrgID) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_OrgID.Unmarshal(m, b) -} -func (m *OrgID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_OrgID.Marshal(b, m, deterministic) -} -func (m *OrgID) XXX_Merge(src proto.Message) { - xxx_messageInfo_OrgID.Merge(m, src) -} -func (m *OrgID) XXX_Size() int { - return xxx_messageInfo_OrgID.Size(m) -} -func (m *OrgID) XXX_DiscardUnknown() { - xxx_messageInfo_OrgID.DiscardUnknown(m) -} - -var xxx_messageInfo_OrgID proto.InternalMessageInfo - -func (m *OrgID) GetId() string { - if m != nil { - return m.Id +func (x *OrgID) GetId() string { + if x != nil { + return x.Id } return "" } type UniqueOrgRequest struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Domain string `protobuf:"bytes,2,opt,name=domain,proto3" json:"domain,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Domain string `protobuf:"bytes,2,opt,name=domain,proto3" json:"domain,omitempty"` } -func (m *UniqueOrgRequest) Reset() { *m = UniqueOrgRequest{} } -func (m *UniqueOrgRequest) String() string { return proto.CompactTextString(m) } -func (*UniqueOrgRequest) ProtoMessage() {} +func (x *UniqueOrgRequest) Reset() { + *x = UniqueOrgRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_admin_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UniqueOrgRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UniqueOrgRequest) ProtoMessage() {} + +func (x *UniqueOrgRequest) ProtoReflect() protoreflect.Message { + mi := &file_admin_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UniqueOrgRequest.ProtoReflect.Descriptor instead. func (*UniqueOrgRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_73a7fc70dcc2027c, []int{1} + return file_admin_proto_rawDescGZIP(), []int{1} } -func (m *UniqueOrgRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_UniqueOrgRequest.Unmarshal(m, b) -} -func (m *UniqueOrgRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_UniqueOrgRequest.Marshal(b, m, deterministic) -} -func (m *UniqueOrgRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_UniqueOrgRequest.Merge(m, src) -} -func (m *UniqueOrgRequest) XXX_Size() int { - return xxx_messageInfo_UniqueOrgRequest.Size(m) -} -func (m *UniqueOrgRequest) XXX_DiscardUnknown() { - xxx_messageInfo_UniqueOrgRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_UniqueOrgRequest proto.InternalMessageInfo - -func (m *UniqueOrgRequest) GetName() string { - if m != nil { - return m.Name +func (x *UniqueOrgRequest) GetName() string { + if x != nil { + return x.Name } return "" } -func (m *UniqueOrgRequest) GetDomain() string { - if m != nil { - return m.Domain +func (x *UniqueOrgRequest) GetDomain() string { + if x != nil { + return x.Domain } return "" } type UniqueOrgResponse struct { - IsUnique bool `protobuf:"varint,1,opt,name=is_unique,json=isUnique,proto3" json:"is_unique,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IsUnique bool `protobuf:"varint,1,opt,name=is_unique,json=isUnique,proto3" json:"is_unique,omitempty"` } -func (m *UniqueOrgResponse) Reset() { *m = UniqueOrgResponse{} } -func (m *UniqueOrgResponse) String() string { return proto.CompactTextString(m) } -func (*UniqueOrgResponse) ProtoMessage() {} +func (x *UniqueOrgResponse) Reset() { + *x = UniqueOrgResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_admin_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UniqueOrgResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UniqueOrgResponse) ProtoMessage() {} + +func (x *UniqueOrgResponse) ProtoReflect() protoreflect.Message { + mi := &file_admin_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UniqueOrgResponse.ProtoReflect.Descriptor instead. func (*UniqueOrgResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_73a7fc70dcc2027c, []int{2} + return file_admin_proto_rawDescGZIP(), []int{2} } -func (m *UniqueOrgResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_UniqueOrgResponse.Unmarshal(m, b) -} -func (m *UniqueOrgResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_UniqueOrgResponse.Marshal(b, m, deterministic) -} -func (m *UniqueOrgResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_UniqueOrgResponse.Merge(m, src) -} -func (m *UniqueOrgResponse) XXX_Size() int { - return xxx_messageInfo_UniqueOrgResponse.Size(m) -} -func (m *UniqueOrgResponse) XXX_DiscardUnknown() { - xxx_messageInfo_UniqueOrgResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_UniqueOrgResponse proto.InternalMessageInfo - -func (m *UniqueOrgResponse) GetIsUnique() bool { - if m != nil { - return m.IsUnique +func (x *UniqueOrgResponse) GetIsUnique() bool { + if x != nil { + return x.IsUnique } return false } type Org struct { - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - State OrgState `protobuf:"varint,2,opt,name=state,proto3,enum=caos.zitadel.admin.api.v1.OrgState" json:"state,omitempty"` - CreationDate *timestamp.Timestamp `protobuf:"bytes,3,opt,name=creation_date,json=creationDate,proto3" json:"creation_date,omitempty"` - ChangeDate *timestamp.Timestamp `protobuf:"bytes,4,opt,name=change_date,json=changeDate,proto3" json:"change_date,omitempty"` - Name string `protobuf:"bytes,5,opt,name=name,proto3" json:"name,omitempty"` - Domain string `protobuf:"bytes,6,opt,name=domain,proto3" json:"domain,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + State OrgState `protobuf:"varint,2,opt,name=state,proto3,enum=caos.zitadel.admin.api.v1.OrgState" json:"state,omitempty"` + CreationDate *timestamp.Timestamp `protobuf:"bytes,3,opt,name=creation_date,json=creationDate,proto3" json:"creation_date,omitempty"` + ChangeDate *timestamp.Timestamp `protobuf:"bytes,4,opt,name=change_date,json=changeDate,proto3" json:"change_date,omitempty"` + Name string `protobuf:"bytes,5,opt,name=name,proto3" json:"name,omitempty"` + Domain string `protobuf:"bytes,6,opt,name=domain,proto3" json:"domain,omitempty"` } -func (m *Org) Reset() { *m = Org{} } -func (m *Org) String() string { return proto.CompactTextString(m) } -func (*Org) ProtoMessage() {} +func (x *Org) Reset() { + *x = Org{} + if protoimpl.UnsafeEnabled { + mi := &file_admin_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Org) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Org) ProtoMessage() {} + +func (x *Org) ProtoReflect() protoreflect.Message { + mi := &file_admin_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Org.ProtoReflect.Descriptor instead. func (*Org) Descriptor() ([]byte, []int) { - return fileDescriptor_73a7fc70dcc2027c, []int{3} + return file_admin_proto_rawDescGZIP(), []int{3} } -func (m *Org) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Org.Unmarshal(m, b) -} -func (m *Org) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Org.Marshal(b, m, deterministic) -} -func (m *Org) XXX_Merge(src proto.Message) { - xxx_messageInfo_Org.Merge(m, src) -} -func (m *Org) XXX_Size() int { - return xxx_messageInfo_Org.Size(m) -} -func (m *Org) XXX_DiscardUnknown() { - xxx_messageInfo_Org.DiscardUnknown(m) -} - -var xxx_messageInfo_Org proto.InternalMessageInfo - -func (m *Org) GetId() string { - if m != nil { - return m.Id +func (x *Org) GetId() string { + if x != nil { + return x.Id } return "" } -func (m *Org) GetState() OrgState { - if m != nil { - return m.State +func (x *Org) GetState() OrgState { + if x != nil { + return x.State } return OrgState_ORGSTATE_UNSPECIFIED } -func (m *Org) GetCreationDate() *timestamp.Timestamp { - if m != nil { - return m.CreationDate +func (x *Org) GetCreationDate() *timestamp.Timestamp { + if x != nil { + return x.CreationDate } return nil } -func (m *Org) GetChangeDate() *timestamp.Timestamp { - if m != nil { - return m.ChangeDate +func (x *Org) GetChangeDate() *timestamp.Timestamp { + if x != nil { + return x.ChangeDate } return nil } -func (m *Org) GetName() string { - if m != nil { - return m.Name +func (x *Org) GetName() string { + if x != nil { + return x.Name } return "" } -func (m *Org) GetDomain() string { - if m != nil { - return m.Domain +func (x *Org) GetDomain() string { + if x != nil { + return x.Domain } return "" } type OrgSearchRequest struct { - Offset uint64 `protobuf:"varint,1,opt,name=offset,proto3" json:"offset,omitempty"` - Limit uint64 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"` - SortingColumn OrgSearchKey `protobuf:"varint,3,opt,name=sorting_column,json=sortingColumn,proto3,enum=caos.zitadel.admin.api.v1.OrgSearchKey" json:"sorting_column,omitempty"` - Asc bool `protobuf:"varint,4,opt,name=asc,proto3" json:"asc,omitempty"` - Queries []*OrgSearchQuery `protobuf:"bytes,5,rep,name=queries,proto3" json:"queries,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Offset uint64 `protobuf:"varint,1,opt,name=offset,proto3" json:"offset,omitempty"` + Limit uint64 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"` + SortingColumn OrgSearchKey `protobuf:"varint,3,opt,name=sorting_column,json=sortingColumn,proto3,enum=caos.zitadel.admin.api.v1.OrgSearchKey" json:"sorting_column,omitempty"` + Asc bool `protobuf:"varint,4,opt,name=asc,proto3" json:"asc,omitempty"` + Queries []*OrgSearchQuery `protobuf:"bytes,5,rep,name=queries,proto3" json:"queries,omitempty"` } -func (m *OrgSearchRequest) Reset() { *m = OrgSearchRequest{} } -func (m *OrgSearchRequest) String() string { return proto.CompactTextString(m) } -func (*OrgSearchRequest) ProtoMessage() {} +func (x *OrgSearchRequest) Reset() { + *x = OrgSearchRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_admin_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OrgSearchRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OrgSearchRequest) ProtoMessage() {} + +func (x *OrgSearchRequest) ProtoReflect() protoreflect.Message { + mi := &file_admin_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OrgSearchRequest.ProtoReflect.Descriptor instead. func (*OrgSearchRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_73a7fc70dcc2027c, []int{4} + return file_admin_proto_rawDescGZIP(), []int{4} } -func (m *OrgSearchRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_OrgSearchRequest.Unmarshal(m, b) -} -func (m *OrgSearchRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_OrgSearchRequest.Marshal(b, m, deterministic) -} -func (m *OrgSearchRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_OrgSearchRequest.Merge(m, src) -} -func (m *OrgSearchRequest) XXX_Size() int { - return xxx_messageInfo_OrgSearchRequest.Size(m) -} -func (m *OrgSearchRequest) XXX_DiscardUnknown() { - xxx_messageInfo_OrgSearchRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_OrgSearchRequest proto.InternalMessageInfo - -func (m *OrgSearchRequest) GetOffset() uint64 { - if m != nil { - return m.Offset +func (x *OrgSearchRequest) GetOffset() uint64 { + if x != nil { + return x.Offset } return 0 } -func (m *OrgSearchRequest) GetLimit() uint64 { - if m != nil { - return m.Limit +func (x *OrgSearchRequest) GetLimit() uint64 { + if x != nil { + return x.Limit } return 0 } -func (m *OrgSearchRequest) GetSortingColumn() OrgSearchKey { - if m != nil { - return m.SortingColumn +func (x *OrgSearchRequest) GetSortingColumn() OrgSearchKey { + if x != nil { + return x.SortingColumn } return OrgSearchKey_ORGSEARCHKEY_UNSPECIFIED } -func (m *OrgSearchRequest) GetAsc() bool { - if m != nil { - return m.Asc +func (x *OrgSearchRequest) GetAsc() bool { + if x != nil { + return x.Asc } return false } -func (m *OrgSearchRequest) GetQueries() []*OrgSearchQuery { - if m != nil { - return m.Queries +func (x *OrgSearchRequest) GetQueries() []*OrgSearchQuery { + if x != nil { + return x.Queries } return nil } type OrgSearchQuery struct { - Key OrgSearchKey `protobuf:"varint,1,opt,name=key,proto3,enum=caos.zitadel.admin.api.v1.OrgSearchKey" json:"key,omitempty"` - Method OrgSearchMethod `protobuf:"varint,2,opt,name=method,proto3,enum=caos.zitadel.admin.api.v1.OrgSearchMethod" json:"method,omitempty"` - Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key OrgSearchKey `protobuf:"varint,1,opt,name=key,proto3,enum=caos.zitadel.admin.api.v1.OrgSearchKey" json:"key,omitempty"` + Method OrgSearchMethod `protobuf:"varint,2,opt,name=method,proto3,enum=caos.zitadel.admin.api.v1.OrgSearchMethod" json:"method,omitempty"` + Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` } -func (m *OrgSearchQuery) Reset() { *m = OrgSearchQuery{} } -func (m *OrgSearchQuery) String() string { return proto.CompactTextString(m) } -func (*OrgSearchQuery) ProtoMessage() {} +func (x *OrgSearchQuery) Reset() { + *x = OrgSearchQuery{} + if protoimpl.UnsafeEnabled { + mi := &file_admin_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OrgSearchQuery) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OrgSearchQuery) ProtoMessage() {} + +func (x *OrgSearchQuery) ProtoReflect() protoreflect.Message { + mi := &file_admin_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OrgSearchQuery.ProtoReflect.Descriptor instead. func (*OrgSearchQuery) Descriptor() ([]byte, []int) { - return fileDescriptor_73a7fc70dcc2027c, []int{5} + return file_admin_proto_rawDescGZIP(), []int{5} } -func (m *OrgSearchQuery) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_OrgSearchQuery.Unmarshal(m, b) -} -func (m *OrgSearchQuery) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_OrgSearchQuery.Marshal(b, m, deterministic) -} -func (m *OrgSearchQuery) XXX_Merge(src proto.Message) { - xxx_messageInfo_OrgSearchQuery.Merge(m, src) -} -func (m *OrgSearchQuery) XXX_Size() int { - return xxx_messageInfo_OrgSearchQuery.Size(m) -} -func (m *OrgSearchQuery) XXX_DiscardUnknown() { - xxx_messageInfo_OrgSearchQuery.DiscardUnknown(m) -} - -var xxx_messageInfo_OrgSearchQuery proto.InternalMessageInfo - -func (m *OrgSearchQuery) GetKey() OrgSearchKey { - if m != nil { - return m.Key +func (x *OrgSearchQuery) GetKey() OrgSearchKey { + if x != nil { + return x.Key } return OrgSearchKey_ORGSEARCHKEY_UNSPECIFIED } -func (m *OrgSearchQuery) GetMethod() OrgSearchMethod { - if m != nil { - return m.Method +func (x *OrgSearchQuery) GetMethod() OrgSearchMethod { + if x != nil { + return x.Method } return OrgSearchMethod_ORGSEARCHMETHOD_EQUALS } -func (m *OrgSearchQuery) GetValue() string { - if m != nil { - return m.Value +func (x *OrgSearchQuery) GetValue() string { + if x != nil { + return x.Value } return "" } type OrgSearchResponse struct { - Offset uint64 `protobuf:"varint,1,opt,name=offset,proto3" json:"offset,omitempty"` - Limit uint64 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"` - TotalResult uint64 `protobuf:"varint,3,opt,name=total_result,json=totalResult,proto3" json:"total_result,omitempty"` - Result []*Org `protobuf:"bytes,4,rep,name=result,proto3" json:"result,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Offset uint64 `protobuf:"varint,1,opt,name=offset,proto3" json:"offset,omitempty"` + Limit uint64 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"` + TotalResult uint64 `protobuf:"varint,3,opt,name=total_result,json=totalResult,proto3" json:"total_result,omitempty"` + Result []*Org `protobuf:"bytes,4,rep,name=result,proto3" json:"result,omitempty"` } -func (m *OrgSearchResponse) Reset() { *m = OrgSearchResponse{} } -func (m *OrgSearchResponse) String() string { return proto.CompactTextString(m) } -func (*OrgSearchResponse) ProtoMessage() {} +func (x *OrgSearchResponse) Reset() { + *x = OrgSearchResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_admin_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OrgSearchResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OrgSearchResponse) ProtoMessage() {} + +func (x *OrgSearchResponse) ProtoReflect() protoreflect.Message { + mi := &file_admin_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OrgSearchResponse.ProtoReflect.Descriptor instead. func (*OrgSearchResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_73a7fc70dcc2027c, []int{6} + return file_admin_proto_rawDescGZIP(), []int{6} } -func (m *OrgSearchResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_OrgSearchResponse.Unmarshal(m, b) -} -func (m *OrgSearchResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_OrgSearchResponse.Marshal(b, m, deterministic) -} -func (m *OrgSearchResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_OrgSearchResponse.Merge(m, src) -} -func (m *OrgSearchResponse) XXX_Size() int { - return xxx_messageInfo_OrgSearchResponse.Size(m) -} -func (m *OrgSearchResponse) XXX_DiscardUnknown() { - xxx_messageInfo_OrgSearchResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_OrgSearchResponse proto.InternalMessageInfo - -func (m *OrgSearchResponse) GetOffset() uint64 { - if m != nil { - return m.Offset +func (x *OrgSearchResponse) GetOffset() uint64 { + if x != nil { + return x.Offset } return 0 } -func (m *OrgSearchResponse) GetLimit() uint64 { - if m != nil { - return m.Limit +func (x *OrgSearchResponse) GetLimit() uint64 { + if x != nil { + return x.Limit } return 0 } -func (m *OrgSearchResponse) GetTotalResult() uint64 { - if m != nil { - return m.TotalResult +func (x *OrgSearchResponse) GetTotalResult() uint64 { + if x != nil { + return x.TotalResult } return 0 } -func (m *OrgSearchResponse) GetResult() []*Org { - if m != nil { - return m.Result +func (x *OrgSearchResponse) GetResult() []*Org { + if x != nil { + return x.Result } return nil } type OrgSetUpRequest struct { - Org *CreateOrgRequest `protobuf:"bytes,1,opt,name=org,proto3" json:"org,omitempty"` - User *CreateUserRequest `protobuf:"bytes,2,opt,name=user,proto3" json:"user,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Org *CreateOrgRequest `protobuf:"bytes,1,opt,name=org,proto3" json:"org,omitempty"` + User *CreateUserRequest `protobuf:"bytes,2,opt,name=user,proto3" json:"user,omitempty"` } -func (m *OrgSetUpRequest) Reset() { *m = OrgSetUpRequest{} } -func (m *OrgSetUpRequest) String() string { return proto.CompactTextString(m) } -func (*OrgSetUpRequest) ProtoMessage() {} +func (x *OrgSetUpRequest) Reset() { + *x = OrgSetUpRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_admin_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OrgSetUpRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OrgSetUpRequest) ProtoMessage() {} + +func (x *OrgSetUpRequest) ProtoReflect() protoreflect.Message { + mi := &file_admin_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OrgSetUpRequest.ProtoReflect.Descriptor instead. func (*OrgSetUpRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_73a7fc70dcc2027c, []int{7} + return file_admin_proto_rawDescGZIP(), []int{7} } -func (m *OrgSetUpRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_OrgSetUpRequest.Unmarshal(m, b) -} -func (m *OrgSetUpRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_OrgSetUpRequest.Marshal(b, m, deterministic) -} -func (m *OrgSetUpRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_OrgSetUpRequest.Merge(m, src) -} -func (m *OrgSetUpRequest) XXX_Size() int { - return xxx_messageInfo_OrgSetUpRequest.Size(m) -} -func (m *OrgSetUpRequest) XXX_DiscardUnknown() { - xxx_messageInfo_OrgSetUpRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_OrgSetUpRequest proto.InternalMessageInfo - -func (m *OrgSetUpRequest) GetOrg() *CreateOrgRequest { - if m != nil { - return m.Org +func (x *OrgSetUpRequest) GetOrg() *CreateOrgRequest { + if x != nil { + return x.Org } return nil } -func (m *OrgSetUpRequest) GetUser() *CreateUserRequest { - if m != nil { - return m.User +func (x *OrgSetUpRequest) GetUser() *CreateUserRequest { + if x != nil { + return x.User } return nil } type OrgSetUpResponse struct { - Org *Org `protobuf:"bytes,1,opt,name=org,proto3" json:"org,omitempty"` - User *User `protobuf:"bytes,2,opt,name=user,proto3" json:"user,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Org *Org `protobuf:"bytes,1,opt,name=org,proto3" json:"org,omitempty"` + User *User `protobuf:"bytes,2,opt,name=user,proto3" json:"user,omitempty"` } -func (m *OrgSetUpResponse) Reset() { *m = OrgSetUpResponse{} } -func (m *OrgSetUpResponse) String() string { return proto.CompactTextString(m) } -func (*OrgSetUpResponse) ProtoMessage() {} +func (x *OrgSetUpResponse) Reset() { + *x = OrgSetUpResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_admin_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OrgSetUpResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OrgSetUpResponse) ProtoMessage() {} + +func (x *OrgSetUpResponse) ProtoReflect() protoreflect.Message { + mi := &file_admin_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OrgSetUpResponse.ProtoReflect.Descriptor instead. func (*OrgSetUpResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_73a7fc70dcc2027c, []int{8} + return file_admin_proto_rawDescGZIP(), []int{8} } -func (m *OrgSetUpResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_OrgSetUpResponse.Unmarshal(m, b) -} -func (m *OrgSetUpResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_OrgSetUpResponse.Marshal(b, m, deterministic) -} -func (m *OrgSetUpResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_OrgSetUpResponse.Merge(m, src) -} -func (m *OrgSetUpResponse) XXX_Size() int { - return xxx_messageInfo_OrgSetUpResponse.Size(m) -} -func (m *OrgSetUpResponse) XXX_DiscardUnknown() { - xxx_messageInfo_OrgSetUpResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_OrgSetUpResponse proto.InternalMessageInfo - -func (m *OrgSetUpResponse) GetOrg() *Org { - if m != nil { - return m.Org +func (x *OrgSetUpResponse) GetOrg() *Org { + if x != nil { + return x.Org } return nil } -func (m *OrgSetUpResponse) GetUser() *User { - if m != nil { - return m.User +func (x *OrgSetUpResponse) GetUser() *User { + if x != nil { + return x.User } return nil } type CreateUserRequest struct { - UserName string `protobuf:"bytes,1,opt,name=user_name,json=userName,proto3" json:"user_name,omitempty"` - FirstName string `protobuf:"bytes,2,opt,name=first_name,json=firstName,proto3" json:"first_name,omitempty"` - LastName string `protobuf:"bytes,3,opt,name=last_name,json=lastName,proto3" json:"last_name,omitempty"` - NickName string `protobuf:"bytes,4,opt,name=nick_name,json=nickName,proto3" json:"nick_name,omitempty"` - PreferredLanguage string `protobuf:"bytes,5,opt,name=preferred_language,json=preferredLanguage,proto3" json:"preferred_language,omitempty"` - Gender Gender `protobuf:"varint,6,opt,name=gender,proto3,enum=caos.zitadel.admin.api.v1.Gender" json:"gender,omitempty"` - Email string `protobuf:"bytes,7,opt,name=email,proto3" json:"email,omitempty"` - IsEmailVerified bool `protobuf:"varint,8,opt,name=is_email_verified,json=isEmailVerified,proto3" json:"is_email_verified,omitempty"` - Phone string `protobuf:"bytes,9,opt,name=phone,proto3" json:"phone,omitempty"` - IsPhoneVerified bool `protobuf:"varint,10,opt,name=is_phone_verified,json=isPhoneVerified,proto3" json:"is_phone_verified,omitempty"` - Country string `protobuf:"bytes,11,opt,name=country,proto3" json:"country,omitempty"` - Locality string `protobuf:"bytes,12,opt,name=locality,proto3" json:"locality,omitempty"` - PostalCode string `protobuf:"bytes,13,opt,name=postal_code,json=postalCode,proto3" json:"postal_code,omitempty"` - Region string `protobuf:"bytes,14,opt,name=region,proto3" json:"region,omitempty"` - StreetAddress string `protobuf:"bytes,15,opt,name=street_address,json=streetAddress,proto3" json:"street_address,omitempty"` - Password string `protobuf:"bytes,16,opt,name=password,proto3" json:"password,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserName string `protobuf:"bytes,1,opt,name=user_name,json=userName,proto3" json:"user_name,omitempty"` + FirstName string `protobuf:"bytes,2,opt,name=first_name,json=firstName,proto3" json:"first_name,omitempty"` + LastName string `protobuf:"bytes,3,opt,name=last_name,json=lastName,proto3" json:"last_name,omitempty"` + NickName string `protobuf:"bytes,4,opt,name=nick_name,json=nickName,proto3" json:"nick_name,omitempty"` + PreferredLanguage string `protobuf:"bytes,5,opt,name=preferred_language,json=preferredLanguage,proto3" json:"preferred_language,omitempty"` + Gender Gender `protobuf:"varint,6,opt,name=gender,proto3,enum=caos.zitadel.admin.api.v1.Gender" json:"gender,omitempty"` + Email string `protobuf:"bytes,7,opt,name=email,proto3" json:"email,omitempty"` + IsEmailVerified bool `protobuf:"varint,8,opt,name=is_email_verified,json=isEmailVerified,proto3" json:"is_email_verified,omitempty"` + Phone string `protobuf:"bytes,9,opt,name=phone,proto3" json:"phone,omitempty"` + IsPhoneVerified bool `protobuf:"varint,10,opt,name=is_phone_verified,json=isPhoneVerified,proto3" json:"is_phone_verified,omitempty"` + Country string `protobuf:"bytes,11,opt,name=country,proto3" json:"country,omitempty"` + Locality string `protobuf:"bytes,12,opt,name=locality,proto3" json:"locality,omitempty"` + PostalCode string `protobuf:"bytes,13,opt,name=postal_code,json=postalCode,proto3" json:"postal_code,omitempty"` + Region string `protobuf:"bytes,14,opt,name=region,proto3" json:"region,omitempty"` + StreetAddress string `protobuf:"bytes,15,opt,name=street_address,json=streetAddress,proto3" json:"street_address,omitempty"` + Password string `protobuf:"bytes,16,opt,name=password,proto3" json:"password,omitempty"` } -func (m *CreateUserRequest) Reset() { *m = CreateUserRequest{} } -func (m *CreateUserRequest) String() string { return proto.CompactTextString(m) } -func (*CreateUserRequest) ProtoMessage() {} +func (x *CreateUserRequest) Reset() { + *x = CreateUserRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_admin_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateUserRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateUserRequest) ProtoMessage() {} + +func (x *CreateUserRequest) ProtoReflect() protoreflect.Message { + mi := &file_admin_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateUserRequest.ProtoReflect.Descriptor instead. func (*CreateUserRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_73a7fc70dcc2027c, []int{9} + return file_admin_proto_rawDescGZIP(), []int{9} } -func (m *CreateUserRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CreateUserRequest.Unmarshal(m, b) -} -func (m *CreateUserRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CreateUserRequest.Marshal(b, m, deterministic) -} -func (m *CreateUserRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateUserRequest.Merge(m, src) -} -func (m *CreateUserRequest) XXX_Size() int { - return xxx_messageInfo_CreateUserRequest.Size(m) -} -func (m *CreateUserRequest) XXX_DiscardUnknown() { - xxx_messageInfo_CreateUserRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_CreateUserRequest proto.InternalMessageInfo - -func (m *CreateUserRequest) GetUserName() string { - if m != nil { - return m.UserName +func (x *CreateUserRequest) GetUserName() string { + if x != nil { + return x.UserName } return "" } -func (m *CreateUserRequest) GetFirstName() string { - if m != nil { - return m.FirstName +func (x *CreateUserRequest) GetFirstName() string { + if x != nil { + return x.FirstName } return "" } -func (m *CreateUserRequest) GetLastName() string { - if m != nil { - return m.LastName +func (x *CreateUserRequest) GetLastName() string { + if x != nil { + return x.LastName } return "" } -func (m *CreateUserRequest) GetNickName() string { - if m != nil { - return m.NickName +func (x *CreateUserRequest) GetNickName() string { + if x != nil { + return x.NickName } return "" } -func (m *CreateUserRequest) GetPreferredLanguage() string { - if m != nil { - return m.PreferredLanguage +func (x *CreateUserRequest) GetPreferredLanguage() string { + if x != nil { + return x.PreferredLanguage } return "" } -func (m *CreateUserRequest) GetGender() Gender { - if m != nil { - return m.Gender +func (x *CreateUserRequest) GetGender() Gender { + if x != nil { + return x.Gender } return Gender_GENDER_UNSPECIFIED } -func (m *CreateUserRequest) GetEmail() string { - if m != nil { - return m.Email +func (x *CreateUserRequest) GetEmail() string { + if x != nil { + return x.Email } return "" } -func (m *CreateUserRequest) GetIsEmailVerified() bool { - if m != nil { - return m.IsEmailVerified +func (x *CreateUserRequest) GetIsEmailVerified() bool { + if x != nil { + return x.IsEmailVerified } return false } -func (m *CreateUserRequest) GetPhone() string { - if m != nil { - return m.Phone +func (x *CreateUserRequest) GetPhone() string { + if x != nil { + return x.Phone } return "" } -func (m *CreateUserRequest) GetIsPhoneVerified() bool { - if m != nil { - return m.IsPhoneVerified +func (x *CreateUserRequest) GetIsPhoneVerified() bool { + if x != nil { + return x.IsPhoneVerified } return false } -func (m *CreateUserRequest) GetCountry() string { - if m != nil { - return m.Country +func (x *CreateUserRequest) GetCountry() string { + if x != nil { + return x.Country } return "" } -func (m *CreateUserRequest) GetLocality() string { - if m != nil { - return m.Locality +func (x *CreateUserRequest) GetLocality() string { + if x != nil { + return x.Locality } return "" } -func (m *CreateUserRequest) GetPostalCode() string { - if m != nil { - return m.PostalCode +func (x *CreateUserRequest) GetPostalCode() string { + if x != nil { + return x.PostalCode } return "" } -func (m *CreateUserRequest) GetRegion() string { - if m != nil { - return m.Region +func (x *CreateUserRequest) GetRegion() string { + if x != nil { + return x.Region } return "" } -func (m *CreateUserRequest) GetStreetAddress() string { - if m != nil { - return m.StreetAddress +func (x *CreateUserRequest) GetStreetAddress() string { + if x != nil { + return x.StreetAddress } return "" } -func (m *CreateUserRequest) GetPassword() string { - if m != nil { - return m.Password +func (x *CreateUserRequest) GetPassword() string { + if x != nil { + return x.Password } return "" } type User struct { - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - State UserState `protobuf:"varint,2,opt,name=state,proto3,enum=caos.zitadel.admin.api.v1.UserState" json:"state,omitempty"` - CreationDate *timestamp.Timestamp `protobuf:"bytes,3,opt,name=creation_date,json=creationDate,proto3" json:"creation_date,omitempty"` - ChangeDate *timestamp.Timestamp `protobuf:"bytes,4,opt,name=change_date,json=changeDate,proto3" json:"change_date,omitempty"` - UserName string `protobuf:"bytes,5,opt,name=user_name,json=userName,proto3" json:"user_name,omitempty"` - FirstName string `protobuf:"bytes,6,opt,name=first_name,json=firstName,proto3" json:"first_name,omitempty"` - LastName string `protobuf:"bytes,7,opt,name=last_name,json=lastName,proto3" json:"last_name,omitempty"` - NickName string `protobuf:"bytes,8,opt,name=nick_name,json=nickName,proto3" json:"nick_name,omitempty"` - DisplayName string `protobuf:"bytes,9,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` - PreferredLanguage string `protobuf:"bytes,10,opt,name=preferred_language,json=preferredLanguage,proto3" json:"preferred_language,omitempty"` - Gender Gender `protobuf:"varint,11,opt,name=gender,proto3,enum=caos.zitadel.admin.api.v1.Gender" json:"gender,omitempty"` - Email string `protobuf:"bytes,12,opt,name=email,proto3" json:"email,omitempty"` - IsEmailVerified bool `protobuf:"varint,13,opt,name=isEmailVerified,proto3" json:"isEmailVerified,omitempty"` - Phone string `protobuf:"bytes,14,opt,name=phone,proto3" json:"phone,omitempty"` - IsPhoneVerified bool `protobuf:"varint,15,opt,name=isPhoneVerified,proto3" json:"isPhoneVerified,omitempty"` - Country string `protobuf:"bytes,16,opt,name=country,proto3" json:"country,omitempty"` - Locality string `protobuf:"bytes,17,opt,name=locality,proto3" json:"locality,omitempty"` - PostalCode string `protobuf:"bytes,18,opt,name=postal_code,json=postalCode,proto3" json:"postal_code,omitempty"` - Region string `protobuf:"bytes,19,opt,name=region,proto3" json:"region,omitempty"` - StreetAddress string `protobuf:"bytes,20,opt,name=street_address,json=streetAddress,proto3" json:"street_address,omitempty"` - Sequence uint64 `protobuf:"varint,21,opt,name=sequence,proto3" json:"sequence,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + State UserState `protobuf:"varint,2,opt,name=state,proto3,enum=caos.zitadel.admin.api.v1.UserState" json:"state,omitempty"` + CreationDate *timestamp.Timestamp `protobuf:"bytes,3,opt,name=creation_date,json=creationDate,proto3" json:"creation_date,omitempty"` + ChangeDate *timestamp.Timestamp `protobuf:"bytes,4,opt,name=change_date,json=changeDate,proto3" json:"change_date,omitempty"` + UserName string `protobuf:"bytes,5,opt,name=user_name,json=userName,proto3" json:"user_name,omitempty"` + FirstName string `protobuf:"bytes,6,opt,name=first_name,json=firstName,proto3" json:"first_name,omitempty"` + LastName string `protobuf:"bytes,7,opt,name=last_name,json=lastName,proto3" json:"last_name,omitempty"` + NickName string `protobuf:"bytes,8,opt,name=nick_name,json=nickName,proto3" json:"nick_name,omitempty"` + DisplayName string `protobuf:"bytes,9,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` + PreferredLanguage string `protobuf:"bytes,10,opt,name=preferred_language,json=preferredLanguage,proto3" json:"preferred_language,omitempty"` + Gender Gender `protobuf:"varint,11,opt,name=gender,proto3,enum=caos.zitadel.admin.api.v1.Gender" json:"gender,omitempty"` + Email string `protobuf:"bytes,12,opt,name=email,proto3" json:"email,omitempty"` + IsEmailVerified bool `protobuf:"varint,13,opt,name=isEmailVerified,proto3" json:"isEmailVerified,omitempty"` + Phone string `protobuf:"bytes,14,opt,name=phone,proto3" json:"phone,omitempty"` + IsPhoneVerified bool `protobuf:"varint,15,opt,name=isPhoneVerified,proto3" json:"isPhoneVerified,omitempty"` + Country string `protobuf:"bytes,16,opt,name=country,proto3" json:"country,omitempty"` + Locality string `protobuf:"bytes,17,opt,name=locality,proto3" json:"locality,omitempty"` + PostalCode string `protobuf:"bytes,18,opt,name=postal_code,json=postalCode,proto3" json:"postal_code,omitempty"` + Region string `protobuf:"bytes,19,opt,name=region,proto3" json:"region,omitempty"` + StreetAddress string `protobuf:"bytes,20,opt,name=street_address,json=streetAddress,proto3" json:"street_address,omitempty"` + Sequence uint64 `protobuf:"varint,21,opt,name=sequence,proto3" json:"sequence,omitempty"` } -func (m *User) Reset() { *m = User{} } -func (m *User) String() string { return proto.CompactTextString(m) } -func (*User) ProtoMessage() {} +func (x *User) Reset() { + *x = User{} + if protoimpl.UnsafeEnabled { + mi := &file_admin_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *User) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*User) ProtoMessage() {} + +func (x *User) ProtoReflect() protoreflect.Message { + mi := &file_admin_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use User.ProtoReflect.Descriptor instead. func (*User) Descriptor() ([]byte, []int) { - return fileDescriptor_73a7fc70dcc2027c, []int{10} + return file_admin_proto_rawDescGZIP(), []int{10} } -func (m *User) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_User.Unmarshal(m, b) -} -func (m *User) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_User.Marshal(b, m, deterministic) -} -func (m *User) XXX_Merge(src proto.Message) { - xxx_messageInfo_User.Merge(m, src) -} -func (m *User) XXX_Size() int { - return xxx_messageInfo_User.Size(m) -} -func (m *User) XXX_DiscardUnknown() { - xxx_messageInfo_User.DiscardUnknown(m) -} - -var xxx_messageInfo_User proto.InternalMessageInfo - -func (m *User) GetId() string { - if m != nil { - return m.Id +func (x *User) GetId() string { + if x != nil { + return x.Id } return "" } -func (m *User) GetState() UserState { - if m != nil { - return m.State +func (x *User) GetState() UserState { + if x != nil { + return x.State } return UserState_USERSTATE_UNSPECIFIED } -func (m *User) GetCreationDate() *timestamp.Timestamp { - if m != nil { - return m.CreationDate +func (x *User) GetCreationDate() *timestamp.Timestamp { + if x != nil { + return x.CreationDate } return nil } -func (m *User) GetChangeDate() *timestamp.Timestamp { - if m != nil { - return m.ChangeDate +func (x *User) GetChangeDate() *timestamp.Timestamp { + if x != nil { + return x.ChangeDate } return nil } -func (m *User) GetUserName() string { - if m != nil { - return m.UserName +func (x *User) GetUserName() string { + if x != nil { + return x.UserName } return "" } -func (m *User) GetFirstName() string { - if m != nil { - return m.FirstName +func (x *User) GetFirstName() string { + if x != nil { + return x.FirstName } return "" } -func (m *User) GetLastName() string { - if m != nil { - return m.LastName +func (x *User) GetLastName() string { + if x != nil { + return x.LastName } return "" } -func (m *User) GetNickName() string { - if m != nil { - return m.NickName +func (x *User) GetNickName() string { + if x != nil { + return x.NickName } return "" } -func (m *User) GetDisplayName() string { - if m != nil { - return m.DisplayName +func (x *User) GetDisplayName() string { + if x != nil { + return x.DisplayName } return "" } -func (m *User) GetPreferredLanguage() string { - if m != nil { - return m.PreferredLanguage +func (x *User) GetPreferredLanguage() string { + if x != nil { + return x.PreferredLanguage } return "" } -func (m *User) GetGender() Gender { - if m != nil { - return m.Gender +func (x *User) GetGender() Gender { + if x != nil { + return x.Gender } return Gender_GENDER_UNSPECIFIED } -func (m *User) GetEmail() string { - if m != nil { - return m.Email +func (x *User) GetEmail() string { + if x != nil { + return x.Email } return "" } -func (m *User) GetIsEmailVerified() bool { - if m != nil { - return m.IsEmailVerified +func (x *User) GetIsEmailVerified() bool { + if x != nil { + return x.IsEmailVerified } return false } -func (m *User) GetPhone() string { - if m != nil { - return m.Phone +func (x *User) GetPhone() string { + if x != nil { + return x.Phone } return "" } -func (m *User) GetIsPhoneVerified() bool { - if m != nil { - return m.IsPhoneVerified +func (x *User) GetIsPhoneVerified() bool { + if x != nil { + return x.IsPhoneVerified } return false } -func (m *User) GetCountry() string { - if m != nil { - return m.Country +func (x *User) GetCountry() string { + if x != nil { + return x.Country } return "" } -func (m *User) GetLocality() string { - if m != nil { - return m.Locality +func (x *User) GetLocality() string { + if x != nil { + return x.Locality } return "" } -func (m *User) GetPostalCode() string { - if m != nil { - return m.PostalCode +func (x *User) GetPostalCode() string { + if x != nil { + return x.PostalCode } return "" } -func (m *User) GetRegion() string { - if m != nil { - return m.Region +func (x *User) GetRegion() string { + if x != nil { + return x.Region } return "" } -func (m *User) GetStreetAddress() string { - if m != nil { - return m.StreetAddress +func (x *User) GetStreetAddress() string { + if x != nil { + return x.StreetAddress } return "" } -func (m *User) GetSequence() uint64 { - if m != nil { - return m.Sequence +func (x *User) GetSequence() uint64 { + if x != nil { + return x.Sequence } return 0 } type CreateOrgRequest struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Domain string `protobuf:"bytes,2,opt,name=domain,proto3" json:"domain,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Domain string `protobuf:"bytes,2,opt,name=domain,proto3" json:"domain,omitempty"` } -func (m *CreateOrgRequest) Reset() { *m = CreateOrgRequest{} } -func (m *CreateOrgRequest) String() string { return proto.CompactTextString(m) } -func (*CreateOrgRequest) ProtoMessage() {} +func (x *CreateOrgRequest) Reset() { + *x = CreateOrgRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_admin_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateOrgRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateOrgRequest) ProtoMessage() {} + +func (x *CreateOrgRequest) ProtoReflect() protoreflect.Message { + mi := &file_admin_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateOrgRequest.ProtoReflect.Descriptor instead. func (*CreateOrgRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_73a7fc70dcc2027c, []int{11} + return file_admin_proto_rawDescGZIP(), []int{11} } -func (m *CreateOrgRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CreateOrgRequest.Unmarshal(m, b) -} -func (m *CreateOrgRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CreateOrgRequest.Marshal(b, m, deterministic) -} -func (m *CreateOrgRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateOrgRequest.Merge(m, src) -} -func (m *CreateOrgRequest) XXX_Size() int { - return xxx_messageInfo_CreateOrgRequest.Size(m) -} -func (m *CreateOrgRequest) XXX_DiscardUnknown() { - xxx_messageInfo_CreateOrgRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_CreateOrgRequest proto.InternalMessageInfo - -func (m *CreateOrgRequest) GetName() string { - if m != nil { - return m.Name +func (x *CreateOrgRequest) GetName() string { + if x != nil { + return x.Name } return "" } -func (m *CreateOrgRequest) GetDomain() string { - if m != nil { - return m.Domain +func (x *CreateOrgRequest) GetDomain() string { + if x != nil { + return x.Domain } return "" } type OrgIamPolicy struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + OrgId string `protobuf:"bytes,1,opt,name=org_id,json=orgId,proto3" json:"org_id,omitempty"` Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` UserLoginMustBeDomain bool `protobuf:"varint,3,opt,name=user_login_must_be_domain,json=userLoginMustBeDomain,proto3" json:"user_login_must_be_domain,omitempty"` @@ -1089,334 +1299,1373 @@ type OrgIamPolicy struct { Sequence uint64 `protobuf:"varint,5,opt,name=sequence,proto3" json:"sequence,omitempty"` CreationDate *timestamp.Timestamp `protobuf:"bytes,6,opt,name=creation_date,json=creationDate,proto3" json:"creation_date,omitempty"` ChangeDate *timestamp.Timestamp `protobuf:"bytes,7,opt,name=change_date,json=changeDate,proto3" json:"change_date,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` } -func (m *OrgIamPolicy) Reset() { *m = OrgIamPolicy{} } -func (m *OrgIamPolicy) String() string { return proto.CompactTextString(m) } -func (*OrgIamPolicy) ProtoMessage() {} +func (x *OrgIamPolicy) Reset() { + *x = OrgIamPolicy{} + if protoimpl.UnsafeEnabled { + mi := &file_admin_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OrgIamPolicy) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OrgIamPolicy) ProtoMessage() {} + +func (x *OrgIamPolicy) ProtoReflect() protoreflect.Message { + mi := &file_admin_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OrgIamPolicy.ProtoReflect.Descriptor instead. func (*OrgIamPolicy) Descriptor() ([]byte, []int) { - return fileDescriptor_73a7fc70dcc2027c, []int{12} + return file_admin_proto_rawDescGZIP(), []int{12} } -func (m *OrgIamPolicy) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_OrgIamPolicy.Unmarshal(m, b) -} -func (m *OrgIamPolicy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_OrgIamPolicy.Marshal(b, m, deterministic) -} -func (m *OrgIamPolicy) XXX_Merge(src proto.Message) { - xxx_messageInfo_OrgIamPolicy.Merge(m, src) -} -func (m *OrgIamPolicy) XXX_Size() int { - return xxx_messageInfo_OrgIamPolicy.Size(m) -} -func (m *OrgIamPolicy) XXX_DiscardUnknown() { - xxx_messageInfo_OrgIamPolicy.DiscardUnknown(m) -} - -var xxx_messageInfo_OrgIamPolicy proto.InternalMessageInfo - -func (m *OrgIamPolicy) GetOrgId() string { - if m != nil { - return m.OrgId +func (x *OrgIamPolicy) GetOrgId() string { + if x != nil { + return x.OrgId } return "" } -func (m *OrgIamPolicy) GetDescription() string { - if m != nil { - return m.Description +func (x *OrgIamPolicy) GetDescription() string { + if x != nil { + return x.Description } return "" } -func (m *OrgIamPolicy) GetUserLoginMustBeDomain() bool { - if m != nil { - return m.UserLoginMustBeDomain +func (x *OrgIamPolicy) GetUserLoginMustBeDomain() bool { + if x != nil { + return x.UserLoginMustBeDomain } return false } -func (m *OrgIamPolicy) GetDefault() bool { - if m != nil { - return m.Default +func (x *OrgIamPolicy) GetDefault() bool { + if x != nil { + return x.Default } return false } -func (m *OrgIamPolicy) GetSequence() uint64 { - if m != nil { - return m.Sequence +func (x *OrgIamPolicy) GetSequence() uint64 { + if x != nil { + return x.Sequence } return 0 } -func (m *OrgIamPolicy) GetCreationDate() *timestamp.Timestamp { - if m != nil { - return m.CreationDate +func (x *OrgIamPolicy) GetCreationDate() *timestamp.Timestamp { + if x != nil { + return x.CreationDate } return nil } -func (m *OrgIamPolicy) GetChangeDate() *timestamp.Timestamp { - if m != nil { - return m.ChangeDate +func (x *OrgIamPolicy) GetChangeDate() *timestamp.Timestamp { + if x != nil { + return x.ChangeDate } return nil } type OrgIamPolicyRequest struct { - OrgId string `protobuf:"bytes,1,opt,name=org_id,json=orgId,proto3" json:"org_id,omitempty"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - UserLoginMustBeDomain bool `protobuf:"varint,3,opt,name=user_login_must_be_domain,json=userLoginMustBeDomain,proto3" json:"user_login_must_be_domain,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OrgId string `protobuf:"bytes,1,opt,name=org_id,json=orgId,proto3" json:"org_id,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + UserLoginMustBeDomain bool `protobuf:"varint,3,opt,name=user_login_must_be_domain,json=userLoginMustBeDomain,proto3" json:"user_login_must_be_domain,omitempty"` } -func (m *OrgIamPolicyRequest) Reset() { *m = OrgIamPolicyRequest{} } -func (m *OrgIamPolicyRequest) String() string { return proto.CompactTextString(m) } -func (*OrgIamPolicyRequest) ProtoMessage() {} +func (x *OrgIamPolicyRequest) Reset() { + *x = OrgIamPolicyRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_admin_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OrgIamPolicyRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OrgIamPolicyRequest) ProtoMessage() {} + +func (x *OrgIamPolicyRequest) ProtoReflect() protoreflect.Message { + mi := &file_admin_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OrgIamPolicyRequest.ProtoReflect.Descriptor instead. func (*OrgIamPolicyRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_73a7fc70dcc2027c, []int{13} + return file_admin_proto_rawDescGZIP(), []int{13} } -func (m *OrgIamPolicyRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_OrgIamPolicyRequest.Unmarshal(m, b) -} -func (m *OrgIamPolicyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_OrgIamPolicyRequest.Marshal(b, m, deterministic) -} -func (m *OrgIamPolicyRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_OrgIamPolicyRequest.Merge(m, src) -} -func (m *OrgIamPolicyRequest) XXX_Size() int { - return xxx_messageInfo_OrgIamPolicyRequest.Size(m) -} -func (m *OrgIamPolicyRequest) XXX_DiscardUnknown() { - xxx_messageInfo_OrgIamPolicyRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_OrgIamPolicyRequest proto.InternalMessageInfo - -func (m *OrgIamPolicyRequest) GetOrgId() string { - if m != nil { - return m.OrgId +func (x *OrgIamPolicyRequest) GetOrgId() string { + if x != nil { + return x.OrgId } return "" } -func (m *OrgIamPolicyRequest) GetDescription() string { - if m != nil { - return m.Description +func (x *OrgIamPolicyRequest) GetDescription() string { + if x != nil { + return x.Description } return "" } -func (m *OrgIamPolicyRequest) GetUserLoginMustBeDomain() bool { - if m != nil { - return m.UserLoginMustBeDomain +func (x *OrgIamPolicyRequest) GetUserLoginMustBeDomain() bool { + if x != nil { + return x.UserLoginMustBeDomain } return false } type OrgIamPolicyID struct { - OrgId string `protobuf:"bytes,1,opt,name=org_id,json=orgId,proto3" json:"org_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OrgId string `protobuf:"bytes,1,opt,name=org_id,json=orgId,proto3" json:"org_id,omitempty"` } -func (m *OrgIamPolicyID) Reset() { *m = OrgIamPolicyID{} } -func (m *OrgIamPolicyID) String() string { return proto.CompactTextString(m) } -func (*OrgIamPolicyID) ProtoMessage() {} +func (x *OrgIamPolicyID) Reset() { + *x = OrgIamPolicyID{} + if protoimpl.UnsafeEnabled { + mi := &file_admin_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OrgIamPolicyID) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OrgIamPolicyID) ProtoMessage() {} + +func (x *OrgIamPolicyID) ProtoReflect() protoreflect.Message { + mi := &file_admin_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OrgIamPolicyID.ProtoReflect.Descriptor instead. func (*OrgIamPolicyID) Descriptor() ([]byte, []int) { - return fileDescriptor_73a7fc70dcc2027c, []int{14} + return file_admin_proto_rawDescGZIP(), []int{14} } -func (m *OrgIamPolicyID) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_OrgIamPolicyID.Unmarshal(m, b) -} -func (m *OrgIamPolicyID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_OrgIamPolicyID.Marshal(b, m, deterministic) -} -func (m *OrgIamPolicyID) XXX_Merge(src proto.Message) { - xxx_messageInfo_OrgIamPolicyID.Merge(m, src) -} -func (m *OrgIamPolicyID) XXX_Size() int { - return xxx_messageInfo_OrgIamPolicyID.Size(m) -} -func (m *OrgIamPolicyID) XXX_DiscardUnknown() { - xxx_messageInfo_OrgIamPolicyID.DiscardUnknown(m) -} - -var xxx_messageInfo_OrgIamPolicyID proto.InternalMessageInfo - -func (m *OrgIamPolicyID) GetOrgId() string { - if m != nil { - return m.OrgId +func (x *OrgIamPolicyID) GetOrgId() string { + if x != nil { + return x.OrgId } return "" } -func init() { - proto.RegisterEnum("caos.zitadel.admin.api.v1.OrgState", OrgState_name, OrgState_value) - proto.RegisterEnum("caos.zitadel.admin.api.v1.OrgSearchKey", OrgSearchKey_name, OrgSearchKey_value) - proto.RegisterEnum("caos.zitadel.admin.api.v1.OrgSearchMethod", OrgSearchMethod_name, OrgSearchMethod_value) - proto.RegisterEnum("caos.zitadel.admin.api.v1.UserState", UserState_name, UserState_value) - proto.RegisterEnum("caos.zitadel.admin.api.v1.Gender", Gender_name, Gender_value) - proto.RegisterType((*OrgID)(nil), "caos.zitadel.admin.api.v1.OrgID") - proto.RegisterType((*UniqueOrgRequest)(nil), "caos.zitadel.admin.api.v1.UniqueOrgRequest") - proto.RegisterType((*UniqueOrgResponse)(nil), "caos.zitadel.admin.api.v1.UniqueOrgResponse") - proto.RegisterType((*Org)(nil), "caos.zitadel.admin.api.v1.Org") - proto.RegisterType((*OrgSearchRequest)(nil), "caos.zitadel.admin.api.v1.OrgSearchRequest") - proto.RegisterType((*OrgSearchQuery)(nil), "caos.zitadel.admin.api.v1.OrgSearchQuery") - proto.RegisterType((*OrgSearchResponse)(nil), "caos.zitadel.admin.api.v1.OrgSearchResponse") - proto.RegisterType((*OrgSetUpRequest)(nil), "caos.zitadel.admin.api.v1.OrgSetUpRequest") - proto.RegisterType((*OrgSetUpResponse)(nil), "caos.zitadel.admin.api.v1.OrgSetUpResponse") - proto.RegisterType((*CreateUserRequest)(nil), "caos.zitadel.admin.api.v1.CreateUserRequest") - proto.RegisterType((*User)(nil), "caos.zitadel.admin.api.v1.User") - proto.RegisterType((*CreateOrgRequest)(nil), "caos.zitadel.admin.api.v1.CreateOrgRequest") - proto.RegisterType((*OrgIamPolicy)(nil), "caos.zitadel.admin.api.v1.OrgIamPolicy") - proto.RegisterType((*OrgIamPolicyRequest)(nil), "caos.zitadel.admin.api.v1.OrgIamPolicyRequest") - proto.RegisterType((*OrgIamPolicyID)(nil), "caos.zitadel.admin.api.v1.OrgIamPolicyID") +type FailedEventID struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Database string `protobuf:"bytes,1,opt,name=database,proto3" json:"database,omitempty"` + ViewName string `protobuf:"bytes,2,opt,name=view_name,json=viewName,proto3" json:"view_name,omitempty"` + FailedSequence uint64 `protobuf:"varint,3,opt,name=failed_sequence,json=failedSequence,proto3" json:"failed_sequence,omitempty"` } -func init() { proto.RegisterFile("admin.proto", fileDescriptor_73a7fc70dcc2027c) } +func (x *FailedEventID) Reset() { + *x = FailedEventID{} + if protoimpl.UnsafeEnabled { + mi := &file_admin_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} -var fileDescriptor_73a7fc70dcc2027c = []byte{ - // 2038 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0xcf, 0x6f, 0xdb, 0xc8, - 0x15, 0x0e, 0xf5, 0xcb, 0xd2, 0x93, 0x2d, 0x53, 0x13, 0xc7, 0x61, 0xe4, 0xa4, 0x71, 0xb8, 0x9b, - 0x26, 0x51, 0x12, 0x29, 0xeb, 0x45, 0xbb, 0x4d, 0x8a, 0xa2, 0x95, 0x2d, 0xae, 0x23, 0xc4, 0x96, - 0xbc, 0x94, 0x9c, 0x6e, 0x7b, 0x51, 0x19, 0x71, 0x4c, 0xb3, 0xa1, 0x48, 0x66, 0x86, 0x4a, 0xaa, - 0x2d, 0xf6, 0x62, 0xa0, 0x40, 0x81, 0x02, 0x6d, 0xb1, 0xbd, 0xee, 0xa1, 0xc7, 0xde, 0xf6, 0x50, - 0xe4, 0xda, 0x73, 0xef, 0xfd, 0x17, 0xfa, 0x0f, 0xf4, 0x9a, 0x53, 0x31, 0x33, 0x24, 0x45, 0x49, - 0xb6, 0xec, 0xb4, 0xc0, 0x62, 0x4f, 0x12, 0xdf, 0xfb, 0xe6, 0xcd, 0xc7, 0x6f, 0xe6, 0x9b, 0x1f, - 0x84, 0xa2, 0x61, 0x0e, 0x6d, 0xb7, 0xe6, 0x13, 0x2f, 0xf0, 0xd0, 0xb5, 0x81, 0xe1, 0xd1, 0xda, - 0x17, 0x76, 0x60, 0x98, 0xd8, 0xa9, 0x89, 0x8c, 0xe1, 0xdb, 0xb5, 0xd7, 0x1f, 0x55, 0xae, 0x5b, - 0x9e, 0x67, 0x39, 0xb8, 0x6e, 0xf8, 0x76, 0xdd, 0x70, 0x5d, 0x2f, 0x30, 0x02, 0xdb, 0x73, 0xa9, - 0x68, 0x58, 0xd9, 0x08, 0xb3, 0xfc, 0xe9, 0xc5, 0xe8, 0xa8, 0x8e, 0x87, 0x7e, 0x30, 0x0e, 0x93, - 0x37, 0x67, 0x93, 0x81, 0x3d, 0xc4, 0x34, 0x30, 0x86, 0x7e, 0x08, 0xb8, 0x3e, 0x0b, 0xa0, 0x01, - 0x19, 0x0d, 0x82, 0x30, 0x7b, 0xf5, 0xb5, 0xe1, 0xd8, 0xa6, 0x11, 0xe0, 0x7a, 0xf4, 0x27, 0x4c, - 0x3c, 0xe0, 0x3f, 0x83, 0x87, 0x16, 0x76, 0x1f, 0xd2, 0x37, 0x86, 0x65, 0x61, 0x52, 0xf7, 0x7c, - 0x4e, 0xeb, 0x14, 0x8a, 0x8a, 0x31, 0x0a, 0x8e, 0x45, 0x3a, 0x42, 0x89, 0x8c, 0x7a, 0x15, 0xb2, - 0x1d, 0x62, 0xb5, 0x9a, 0xa8, 0x04, 0x29, 0xdb, 0x54, 0xa4, 0x4d, 0xe9, 0x6e, 0x41, 0x4f, 0xd9, - 0xa6, 0x7a, 0x00, 0xf2, 0xa1, 0x6b, 0xbf, 0x1a, 0xe1, 0x0e, 0xb1, 0x74, 0xfc, 0x6a, 0x84, 0x69, - 0x80, 0x36, 0x20, 0xe3, 0x1a, 0x43, 0x2c, 0x50, 0xdb, 0x4b, 0xef, 0xb6, 0x33, 0x24, 0x25, 0x4b, - 0x3a, 0x0f, 0xa2, 0x9b, 0x90, 0x33, 0xbd, 0xa1, 0x61, 0xbb, 0x4a, 0x6a, 0x3a, 0x1d, 0x86, 0xd5, - 0x47, 0x50, 0x4e, 0x54, 0xa4, 0xbe, 0xe7, 0x52, 0x8c, 0x36, 0xa0, 0x60, 0xd3, 0xfe, 0x88, 0xc7, - 0x79, 0xdd, 0xbc, 0x9e, 0xb7, 0xa9, 0xc0, 0xa9, 0xef, 0x24, 0x48, 0x77, 0x88, 0x35, 0xcb, 0x0d, - 0x3d, 0x86, 0x2c, 0x0d, 0x8c, 0x00, 0xf3, 0x9e, 0x4a, 0x5b, 0x1f, 0xd4, 0xce, 0x1c, 0xba, 0x5a, - 0x87, 0x58, 0x5d, 0x06, 0xd5, 0x45, 0x0b, 0xf4, 0x53, 0x58, 0x19, 0x10, 0xcc, 0xc5, 0xe9, 0x33, - 0x39, 0x95, 0xf4, 0xa6, 0x74, 0xb7, 0xb8, 0x55, 0xa9, 0x89, 0x61, 0xa8, 0x45, 0xc3, 0x50, 0xeb, - 0x45, 0xe3, 0xa4, 0x2f, 0x47, 0x0d, 0x9a, 0xac, 0xc0, 0x8f, 0xa1, 0x38, 0x38, 0x36, 0x5c, 0x0b, - 0x8b, 0xe6, 0x99, 0x73, 0x9b, 0x83, 0x80, 0xf3, 0xc6, 0x28, 0x14, 0x30, 0xcb, 0x5f, 0x45, 0xe8, - 0xb6, 0x1e, 0xeb, 0x96, 0xe3, 0xd1, 0x48, 0xae, 0xff, 0x48, 0x20, 0x33, 0xf6, 0xd8, 0x20, 0x83, - 0xe3, 0x68, 0x04, 0xd6, 0x21, 0xe7, 0x1d, 0x1d, 0x51, 0x1c, 0x70, 0x35, 0x32, 0x7a, 0xf8, 0x84, - 0xd6, 0x20, 0xeb, 0xd8, 0x43, 0x3b, 0xe0, 0x8a, 0x64, 0x74, 0xf1, 0x80, 0x3e, 0x87, 0x12, 0xf5, - 0x48, 0x60, 0xbb, 0x56, 0x7f, 0xe0, 0x39, 0xa3, 0xa1, 0xcb, 0xdf, 0xb6, 0xb4, 0x75, 0xe7, 0x1c, - 0xc1, 0x78, 0x97, 0xcf, 0xf0, 0x78, 0x3b, 0xff, 0x6e, 0x3b, 0x7b, 0x22, 0xa5, 0x36, 0x2f, 0xe9, - 0x2b, 0x61, 0xa1, 0x1d, 0x5e, 0x07, 0xc9, 0x90, 0x36, 0xe8, 0x80, 0xbf, 0x7d, 0x5e, 0x67, 0x7f, - 0xd1, 0x0e, 0x2c, 0xbd, 0x1a, 0x61, 0x62, 0x63, 0xaa, 0x64, 0x37, 0xd3, 0x77, 0x8b, 0x5b, 0xf7, - 0x2e, 0xd2, 0xc9, 0x67, 0x23, 0x4c, 0xc6, 0x7a, 0xd4, 0x52, 0xfd, 0x46, 0x82, 0xd2, 0x74, 0x0e, - 0xed, 0x40, 0xfa, 0x25, 0x1e, 0xf3, 0xd7, 0xfd, 0x9f, 0x88, 0xb3, 0xd6, 0x68, 0x1b, 0x72, 0x43, - 0x1c, 0x1c, 0x7b, 0x66, 0x38, 0x63, 0xaa, 0x17, 0xa9, 0xb3, 0xcf, 0x5b, 0xe8, 0x61, 0x4b, 0x26, - 0xf1, 0x6b, 0xc3, 0x19, 0x89, 0x19, 0x53, 0xd0, 0xc5, 0x83, 0xfa, 0xb5, 0x04, 0xe5, 0xc4, 0x28, - 0x85, 0xb3, 0xfa, 0xfd, 0x86, 0xe9, 0x16, 0x2c, 0x07, 0x5e, 0x60, 0x38, 0x7d, 0x82, 0xe9, 0xc8, - 0x09, 0x78, 0x07, 0x19, 0xbd, 0xc8, 0x63, 0x3a, 0x0f, 0xa1, 0x1f, 0x42, 0x2e, 0x4c, 0x66, 0xb8, - 0xb8, 0xdf, 0x5b, 0xfc, 0x02, 0x7a, 0x88, 0x56, 0xbf, 0x92, 0x60, 0x95, 0xd3, 0x0b, 0x0e, 0xfd, - 0x68, 0x0e, 0xfd, 0x04, 0xd2, 0x1e, 0xb1, 0x38, 0xb3, 0xe2, 0xd6, 0xfd, 0x05, 0x85, 0x76, 0xd8, - 0xbc, 0x4f, 0xf8, 0x5f, 0x67, 0xed, 0xd0, 0xcf, 0x20, 0x33, 0xa2, 0x98, 0xf0, 0x57, 0x28, 0x6e, - 0x3d, 0x38, 0xb7, 0xfd, 0x21, 0xc5, 0x24, 0x2a, 0xc0, 0x5b, 0xaa, 0xe3, 0x70, 0x62, 0x73, 0x4e, - 0xa1, 0x62, 0x8f, 0x92, 0xa4, 0xce, 0x7b, 0x3b, 0xce, 0xe3, 0xe3, 0x29, 0x1e, 0x37, 0x17, 0x34, - 0xe1, 0x0c, 0x44, 0xd7, 0x7f, 0xcf, 0x42, 0x79, 0x8e, 0x16, 0xba, 0x03, 0x05, 0x96, 0xed, 0x27, - 0x16, 0x37, 0x78, 0xb7, 0xbd, 0x44, 0xb2, 0xb2, 0xa4, 0xfc, 0x53, 0xd2, 0xf3, 0x2c, 0xd9, 0x66, - 0x5e, 0xbd, 0x07, 0x70, 0x64, 0x13, 0x1a, 0x08, 0x64, 0x6a, 0x0e, 0x59, 0xe0, 0x59, 0x0e, 0xbd, - 0x03, 0x05, 0xc7, 0x88, 0x90, 0xe9, 0xf9, 0x9a, 0x2c, 0xc9, 0x81, 0xb7, 0xa1, 0xe0, 0xda, 0x83, - 0x97, 0x02, 0x98, 0xe1, 0x40, 0x36, 0x7b, 0x49, 0x9a, 0xc3, 0x58, 0x8a, 0xc3, 0x3e, 0x01, 0xe4, - 0x13, 0x7c, 0x84, 0x09, 0xc1, 0x66, 0xdf, 0x31, 0x5c, 0x6b, 0x64, 0x58, 0xe1, 0x42, 0x92, 0xc0, - 0x97, 0x63, 0xcc, 0x5e, 0x08, 0x41, 0x8f, 0x21, 0x67, 0x61, 0xd7, 0xc4, 0x84, 0xaf, 0x2f, 0xa5, - 0xad, 0x5b, 0x0b, 0x94, 0xda, 0xe5, 0x40, 0x3d, 0x6c, 0x80, 0x54, 0xc8, 0xe2, 0xa1, 0x61, 0x3b, - 0xca, 0x12, 0xef, 0x66, 0xf9, 0xdd, 0x76, 0x81, 0x2c, 0x71, 0xfe, 0xbf, 0x92, 0x74, 0x91, 0x42, - 0x55, 0x28, 0xdb, 0xb4, 0xcf, 0xff, 0xf7, 0x5f, 0x63, 0x62, 0x1f, 0xd9, 0xd8, 0x54, 0xf2, 0x7c, - 0x5d, 0x58, 0xb5, 0xa9, 0xc6, 0xe2, 0xcf, 0xc3, 0x30, 0xba, 0x01, 0x59, 0xff, 0xd8, 0x73, 0xb1, - 0x52, 0x48, 0xec, 0x10, 0xca, 0x9a, 0x2e, 0xa2, 0x61, 0x29, 0xfe, 0x7f, 0x52, 0x0a, 0xa2, 0x52, - 0x07, 0x2c, 0x1e, 0x97, 0x52, 0x61, 0x69, 0xe0, 0x8d, 0xdc, 0x80, 0x8c, 0x95, 0xe2, 0x8c, 0x06, - 0x51, 0x02, 0x7d, 0x08, 0x79, 0xc7, 0x1b, 0x18, 0x8e, 0x1d, 0x8c, 0x95, 0xe5, 0x59, 0x61, 0xa3, - 0x0c, 0xba, 0x07, 0x45, 0xdf, 0xa3, 0xcc, 0x7e, 0x03, 0xcf, 0xc4, 0xca, 0xca, 0x0c, 0x10, 0x44, - 0x72, 0xc7, 0x33, 0x31, 0xda, 0x64, 0x2e, 0xb4, 0x6c, 0xcf, 0x55, 0x4a, 0x33, 0xa8, 0x30, 0x8e, - 0xea, 0x50, 0xa2, 0x01, 0xc1, 0x38, 0xe8, 0x1b, 0xa6, 0x49, 0x30, 0xa5, 0xca, 0xea, 0x0c, 0x72, - 0x45, 0xe4, 0x1b, 0x22, 0x8d, 0x3e, 0x80, 0xbc, 0x6f, 0x50, 0xfa, 0xc6, 0x23, 0xa6, 0x22, 0x27, - 0x55, 0x79, 0xaa, 0xc7, 0x09, 0xf5, 0x77, 0x39, 0xc8, 0xb0, 0xf9, 0x3a, 0xb7, 0x11, 0x3e, 0x99, - 0xde, 0x08, 0x3f, 0x3c, 0xc7, 0x04, 0xdf, 0xa1, 0x9d, 0x70, 0x23, 0x69, 0x39, 0xb1, 0x1d, 0x4e, - 0x6c, 0x76, 0x63, 0xca, 0x66, 0x62, 0x5b, 0x4c, 0x58, 0x6b, 0x23, 0x69, 0xad, 0x25, 0xd1, 0x36, - 0xb6, 0xd3, 0x46, 0xd2, 0x4e, 0x79, 0x91, 0x8c, 0x4d, 0x74, 0x0b, 0x96, 0x4d, 0x9b, 0xfa, 0x8e, - 0x31, 0x16, 0x79, 0x3e, 0x0f, 0xf5, 0x62, 0x18, 0xe3, 0x90, 0x87, 0xa7, 0xfa, 0x0c, 0x38, 0x70, - 0xa1, 0xbb, 0x8a, 0xef, 0xeb, 0xae, 0xb5, 0xc8, 0x5d, 0xcb, 0x62, 0x43, 0x11, 0x7e, 0xba, 0x0b, - 0xb3, 0xb6, 0xe1, 0x53, 0xf2, 0x14, 0x37, 0xad, 0x45, 0x6e, 0x2a, 0x89, 0xf6, 0xc2, 0x44, 0xbc, - 0xfd, 0x94, 0x57, 0xf8, 0x14, 0x3c, 0xc5, 0x42, 0xca, 0xc4, 0x42, 0x7c, 0xe6, 0x4d, 0x8c, 0x53, - 0x49, 0x18, 0xa7, 0x1c, 0xea, 0x1b, 0xd9, 0xe5, 0xe6, 0xb4, 0x5d, 0x10, 0x4f, 0x27, 0x4d, 0xb2, - 0x1e, 0x9b, 0xe4, 0xb2, 0x38, 0xcf, 0x84, 0xd6, 0xb8, 0x3d, 0x67, 0x8d, 0x35, 0x9e, 0x9f, 0x31, - 0x44, 0x05, 0xf2, 0x94, 0x2d, 0xcb, 0xee, 0x00, 0x2b, 0x57, 0xf8, 0x46, 0x18, 0x3f, 0xab, 0xbb, - 0x20, 0xcf, 0xee, 0x49, 0x8b, 0xcf, 0xa4, 0xeb, 0xd3, 0x67, 0xd2, 0xf8, 0x6c, 0xf5, 0x36, 0x05, - 0xcb, 0xec, 0xd8, 0x6b, 0x0c, 0x0f, 0x3c, 0xc7, 0x1e, 0x8c, 0xd1, 0x15, 0xc8, 0x79, 0xc4, 0xea, - 0xc7, 0xe6, 0xca, 0x7a, 0xc4, 0x6a, 0x99, 0x68, 0x13, 0x8a, 0x26, 0xa6, 0x03, 0x62, 0xf3, 0x33, - 0x73, 0x58, 0x24, 0x19, 0x42, 0x3f, 0x82, 0x6b, 0x7c, 0x1e, 0x3b, 0x9e, 0x65, 0xbb, 0xfd, 0xe1, - 0x88, 0x06, 0xfd, 0x17, 0xb8, 0x1f, 0x76, 0x9a, 0xe6, 0xc2, 0x5f, 0x61, 0x80, 0x3d, 0x96, 0xdf, - 0x1f, 0xd1, 0x60, 0x1b, 0x37, 0x79, 0x92, 0xc9, 0x6f, 0xe2, 0x23, 0x43, 0xec, 0xe9, 0x0c, 0x17, - 0x3d, 0x4e, 0x49, 0x90, 0x9d, 0x96, 0x60, 0xde, 0xb5, 0xb9, 0xff, 0xcf, 0xb5, 0x4b, 0xef, 0xe3, - 0x5a, 0xf5, 0xf7, 0x12, 0x5c, 0x4e, 0xea, 0x16, 0x0d, 0xc2, 0xb7, 0x2f, 0x9f, 0x7a, 0x87, 0x9f, - 0x14, 0x63, 0x26, 0xad, 0xe6, 0x19, 0x24, 0xaa, 0x07, 0x90, 0x8f, 0x2e, 0x01, 0x48, 0x81, 0xb5, - 0x8e, 0xbe, 0xdb, 0xed, 0x35, 0x7a, 0x5a, 0xff, 0xb0, 0xdd, 0x3d, 0xd0, 0x76, 0x5a, 0x9f, 0xb6, - 0xb4, 0xa6, 0x7c, 0x09, 0x5d, 0x86, 0xd5, 0x38, 0xd3, 0xd8, 0xe9, 0xb5, 0x9e, 0x6b, 0xb2, 0x84, - 0xae, 0x40, 0x39, 0x0e, 0xb6, 0xda, 0x61, 0x38, 0x55, 0xfd, 0x0d, 0x9f, 0x3c, 0xf1, 0x61, 0x13, - 0x5d, 0x07, 0x85, 0xc1, 0xb4, 0x86, 0xbe, 0xf3, 0xf4, 0x99, 0xf6, 0x8b, 0x99, 0xca, 0xd7, 0xe0, - 0xca, 0x54, 0xb6, 0xa3, 0xef, 0xf6, 0xdb, 0x8d, 0x7d, 0x56, 0xff, 0x2a, 0x5c, 0x9e, 0x4a, 0x35, - 0x3b, 0xfb, 0x8d, 0x56, 0x5b, 0x4e, 0xa1, 0x75, 0x40, 0x53, 0x09, 0x4e, 0x41, 0x4e, 0x57, 0x9d, - 0xf0, 0x34, 0x37, 0x39, 0x9e, 0xa2, 0x0a, 0xac, 0xc7, 0xd0, 0x7d, 0xad, 0xf7, 0xb4, 0xd3, 0xec, - 0x6b, 0x9f, 0x1d, 0x36, 0xf6, 0xba, 0xf2, 0x25, 0x74, 0x13, 0x36, 0x66, 0x73, 0xdd, 0x5e, 0x43, - 0xef, 0x75, 0xfb, 0x3f, 0x6f, 0xf5, 0x9e, 0xca, 0xd2, 0x14, 0xf3, 0x10, 0xb0, 0xd3, 0x69, 0xf7, - 0x1a, 0xad, 0x76, 0x57, 0x4e, 0x55, 0xbf, 0x91, 0xa0, 0x10, 0x6f, 0x1b, 0xec, 0x3d, 0x0e, 0xbb, - 0x9a, 0x7e, 0x9a, 0x78, 0x6b, 0x20, 0x4f, 0x52, 0xb1, 0x7a, 0xeb, 0x80, 0x26, 0xd1, 0x89, 0x7c, - 0x4c, 0xd5, 0x49, 0xbc, 0xa9, 0xed, 0x69, 0x3d, 0xad, 0x29, 0xa7, 0xa7, 0x8b, 0xec, 0x75, 0x76, - 0x9e, 0x69, 0x4d, 0x39, 0x33, 0x0d, 0xee, 0x1e, 0x76, 0x0f, 0xb4, 0x76, 0x53, 0xce, 0x4e, 0x87, - 0x5b, 0xed, 0x56, 0xaf, 0xd5, 0xd8, 0x93, 0x73, 0xd5, 0xcf, 0x21, 0x27, 0x16, 0x59, 0xd6, 0xf9, - 0xae, 0xd6, 0x6e, 0x6a, 0xfa, 0x0c, 0xd5, 0x32, 0xac, 0x84, 0xf1, 0x4f, 0xb5, 0xfd, 0xc6, 0x1e, - 0xe3, 0xb9, 0x0a, 0xc5, 0x30, 0xc4, 0x03, 0x29, 0x84, 0xa0, 0x14, 0x06, 0x9a, 0xad, 0xe7, 0x9a, - 0xde, 0xd5, 0xe4, 0xf4, 0xd6, 0x5f, 0x8b, 0xb0, 0xdc, 0x60, 0x8b, 0x79, 0x17, 0x93, 0xd7, 0xf6, - 0x00, 0xa3, 0x67, 0xb0, 0xf4, 0x14, 0x1b, 0x4e, 0x70, 0xfc, 0x05, 0x5a, 0x9f, 0x73, 0x8f, 0x36, - 0xf4, 0x83, 0x71, 0xe5, 0x8c, 0xb8, 0x2a, 0x9f, 0xfc, 0xeb, 0xdf, 0x7f, 0x49, 0x01, 0xca, 0xd7, - 0x8f, 0xc3, 0x0a, 0xbb, 0x90, 0xd5, 0xb1, 0x61, 0x8e, 0xdf, 0xbb, 0x54, 0x89, 0x97, 0xca, 0xa3, - 0x5c, 0x9d, 0xf0, 0xf6, 0x6d, 0xc8, 0x3f, 0x0f, 0x3f, 0x14, 0x9c, 0x59, 0xeb, 0xea, 0x5c, 0xbc, - 0xcb, 0x3f, 0x39, 0xa8, 0x65, 0x5e, 0xac, 0x88, 0x0a, 0xf1, 0xc7, 0x06, 0xf4, 0x27, 0x09, 0x8a, - 0x2d, 0xda, 0x21, 0x96, 0xb8, 0x91, 0xa3, 0x45, 0xd7, 0x85, 0xd9, 0xcf, 0x05, 0x95, 0x07, 0x17, - 0x03, 0x8b, 0x1b, 0x80, 0x7a, 0xfb, 0xe4, 0xad, 0x02, 0x90, 0xb7, 0x8d, 0x61, 0x8d, 0xbd, 0x0b, - 0xe7, 0x52, 0x46, 0xab, 0x75, 0x8f, 0x58, 0xb4, 0xde, 0xb7, 0xa9, 0xf8, 0x46, 0x80, 0x7c, 0x80, - 0x5d, 0x1c, 0x74, 0x88, 0xb5, 0xcd, 0x3c, 0xbf, 0xb9, 0xf8, 0xa6, 0xd0, 0x6a, 0x56, 0xce, 0xb9, - 0x4b, 0xa8, 0x9b, 0xa7, 0x74, 0xbb, 0x8c, 0x40, 0x74, 0xfb, 0x5b, 0xdb, 0xfc, 0x92, 0x69, 0x00, - 0xc2, 0x72, 0x1d, 0x62, 0xd1, 0x85, 0x12, 0xcc, 0xde, 0xd7, 0x17, 0x4a, 0x30, 0x77, 0x6d, 0x54, - 0xbf, 0x7f, 0x0a, 0x17, 0xa4, 0xae, 0x84, 0x12, 0x50, 0x0e, 0x7e, 0x22, 0x55, 0xd1, 0x1f, 0x24, - 0xc8, 0xf3, 0xeb, 0x53, 0x87, 0x58, 0xe8, 0xdc, 0xbb, 0xec, 0xe4, 0xea, 0x57, 0xb9, 0x7f, 0x21, - 0x6c, 0x82, 0x4d, 0x11, 0x0a, 0x8c, 0xcd, 0x1b, 0x62, 0x07, 0x58, 0x8c, 0x88, 0xba, 0x1c, 0xd3, - 0x09, 0x46, 0x3e, 0x63, 0xf3, 0xb5, 0x04, 0xab, 0x62, 0x48, 0x26, 0xfb, 0xe9, 0x39, 0x97, 0xff, - 0xc4, 0xb2, 0x5d, 0xb9, 0x73, 0x41, 0xa8, 0xfa, 0x83, 0x93, 0xb7, 0x4a, 0x19, 0x56, 0x19, 0x1f, - 0x9f, 0x47, 0x26, 0x22, 0x55, 0x90, 0x12, 0x0e, 0x98, 0xd8, 0x01, 0xbe, 0xac, 0xdb, 0xc6, 0x50, - 0x80, 0xd0, 0xdf, 0x24, 0x40, 0xf1, 0xa9, 0x61, 0xc2, 0xb0, 0x76, 0xc1, 0x6e, 0x23, 0xe9, 0x2e, - 0x4c, 0xf3, 0xf1, 0xc9, 0x5b, 0x05, 0x81, 0x9c, 0xa0, 0x39, 0x51, 0xef, 0x86, 0x7a, 0x26, 0x4f, - 0xa6, 0x24, 0xa3, 0x7a, 0xe8, 0x9b, 0xdf, 0x0d, 0xaa, 0x95, 0x85, 0x54, 0xff, 0x2c, 0x01, 0x6a, - 0x62, 0x07, 0xcf, 0x50, 0x7d, 0x8f, 0x71, 0x3f, 0x6b, 0x49, 0xfb, 0xe4, 0xe4, 0xad, 0x72, 0x19, - 0xca, 0x09, 0x52, 0x26, 0xef, 0x47, 0x0c, 0x74, 0xf5, 0x4c, 0x56, 0xdb, 0xff, 0x90, 0xbe, 0x6a, - 0xfc, 0x51, 0x42, 0x0d, 0x58, 0xe1, 0xdd, 0x6e, 0x52, 0xb1, 0x52, 0xab, 0xf7, 0xd1, 0xbd, 0xe3, - 0x20, 0xf0, 0xe9, 0x93, 0x7a, 0xdd, 0xb2, 0x83, 0xe3, 0xd1, 0x8b, 0xda, 0xc0, 0x1b, 0xd6, 0x19, - 0xcf, 0x7a, 0xc8, 0xb3, 0xee, 0xbf, 0xb4, 0xea, 0xbc, 0xd1, 0x56, 0xfa, 0x51, 0xed, 0xa3, 0xaa, - 0x94, 0xda, 0x92, 0x0d, 0xdf, 0x77, 0xec, 0x01, 0x3f, 0x37, 0xd5, 0x7f, 0x4d, 0x3d, 0x77, 0x3a, - 0x62, 0x11, 0x7f, 0xf0, 0x64, 0x0e, 0xf3, 0x64, 0x0e, 0xf3, 0xcb, 0xea, 0xb9, 0x5d, 0xf2, 0xaf, - 0xca, 0x0c, 0xfb, 0x22, 0xc7, 0x95, 0xf8, 0xf8, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xeb, 0x9f, - 0x83, 0xf6, 0x97, 0x16, 0x00, 0x00, +func (x *FailedEventID) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FailedEventID) ProtoMessage() {} + +func (x *FailedEventID) ProtoReflect() protoreflect.Message { + mi := &file_admin_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FailedEventID.ProtoReflect.Descriptor instead. +func (*FailedEventID) Descriptor() ([]byte, []int) { + return file_admin_proto_rawDescGZIP(), []int{15} +} + +func (x *FailedEventID) GetDatabase() string { + if x != nil { + return x.Database + } + return "" +} + +func (x *FailedEventID) GetViewName() string { + if x != nil { + return x.ViewName + } + return "" +} + +func (x *FailedEventID) GetFailedSequence() uint64 { + if x != nil { + return x.FailedSequence + } + return 0 +} + +type FailedEvents struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + FailedEvents []*FailedEvent `protobuf:"bytes,1,rep,name=failed_events,json=failedEvents,proto3" json:"failed_events,omitempty"` +} + +func (x *FailedEvents) Reset() { + *x = FailedEvents{} + if protoimpl.UnsafeEnabled { + mi := &file_admin_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FailedEvents) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FailedEvents) ProtoMessage() {} + +func (x *FailedEvents) ProtoReflect() protoreflect.Message { + mi := &file_admin_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FailedEvents.ProtoReflect.Descriptor instead. +func (*FailedEvents) Descriptor() ([]byte, []int) { + return file_admin_proto_rawDescGZIP(), []int{16} +} + +func (x *FailedEvents) GetFailedEvents() []*FailedEvent { + if x != nil { + return x.FailedEvents + } + return nil +} + +type FailedEvent struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Database string `protobuf:"bytes,1,opt,name=database,proto3" json:"database,omitempty"` + ViewName string `protobuf:"bytes,2,opt,name=view_name,json=viewName,proto3" json:"view_name,omitempty"` + FailedSequence uint64 `protobuf:"varint,3,opt,name=failed_sequence,json=failedSequence,proto3" json:"failed_sequence,omitempty"` + FailureCount uint64 `protobuf:"varint,4,opt,name=failure_count,json=failureCount,proto3" json:"failure_count,omitempty"` + ErrorMessage string `protobuf:"bytes,5,opt,name=error_message,json=errorMessage,proto3" json:"error_message,omitempty"` +} + +func (x *FailedEvent) Reset() { + *x = FailedEvent{} + if protoimpl.UnsafeEnabled { + mi := &file_admin_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FailedEvent) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FailedEvent) ProtoMessage() {} + +func (x *FailedEvent) ProtoReflect() protoreflect.Message { + mi := &file_admin_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FailedEvent.ProtoReflect.Descriptor instead. +func (*FailedEvent) Descriptor() ([]byte, []int) { + return file_admin_proto_rawDescGZIP(), []int{17} +} + +func (x *FailedEvent) GetDatabase() string { + if x != nil { + return x.Database + } + return "" +} + +func (x *FailedEvent) GetViewName() string { + if x != nil { + return x.ViewName + } + return "" +} + +func (x *FailedEvent) GetFailedSequence() uint64 { + if x != nil { + return x.FailedSequence + } + return 0 +} + +func (x *FailedEvent) GetFailureCount() uint64 { + if x != nil { + return x.FailureCount + } + return 0 +} + +func (x *FailedEvent) GetErrorMessage() string { + if x != nil { + return x.ErrorMessage + } + return "" +} + +type ViewID struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Database string `protobuf:"bytes,1,opt,name=database,proto3" json:"database,omitempty"` + ViewName string `protobuf:"bytes,2,opt,name=view_name,json=viewName,proto3" json:"view_name,omitempty"` +} + +func (x *ViewID) Reset() { + *x = ViewID{} + if protoimpl.UnsafeEnabled { + mi := &file_admin_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ViewID) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ViewID) ProtoMessage() {} + +func (x *ViewID) ProtoReflect() protoreflect.Message { + mi := &file_admin_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ViewID.ProtoReflect.Descriptor instead. +func (*ViewID) Descriptor() ([]byte, []int) { + return file_admin_proto_rawDescGZIP(), []int{18} +} + +func (x *ViewID) GetDatabase() string { + if x != nil { + return x.Database + } + return "" +} + +func (x *ViewID) GetViewName() string { + if x != nil { + return x.ViewName + } + return "" +} + +type Views struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Views []*View `protobuf:"bytes,1,rep,name=views,proto3" json:"views,omitempty"` +} + +func (x *Views) Reset() { + *x = Views{} + if protoimpl.UnsafeEnabled { + mi := &file_admin_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Views) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Views) ProtoMessage() {} + +func (x *Views) ProtoReflect() protoreflect.Message { + mi := &file_admin_proto_msgTypes[19] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Views.ProtoReflect.Descriptor instead. +func (*Views) Descriptor() ([]byte, []int) { + return file_admin_proto_rawDescGZIP(), []int{19} +} + +func (x *Views) GetViews() []*View { + if x != nil { + return x.Views + } + return nil +} + +type View struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Database string `protobuf:"bytes,1,opt,name=database,proto3" json:"database,omitempty"` + ViewName string `protobuf:"bytes,2,opt,name=view_name,json=viewName,proto3" json:"view_name,omitempty"` + Sequence uint64 `protobuf:"varint,3,opt,name=sequence,proto3" json:"sequence,omitempty"` +} + +func (x *View) Reset() { + *x = View{} + if protoimpl.UnsafeEnabled { + mi := &file_admin_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *View) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*View) ProtoMessage() {} + +func (x *View) ProtoReflect() protoreflect.Message { + mi := &file_admin_proto_msgTypes[20] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use View.ProtoReflect.Descriptor instead. +func (*View) Descriptor() ([]byte, []int) { + return file_admin_proto_rawDescGZIP(), []int{20} +} + +func (x *View) GetDatabase() string { + if x != nil { + return x.Database + } + return "" +} + +func (x *View) GetViewName() string { + if x != nil { + return x.ViewName + } + return "" +} + +func (x *View) GetSequence() uint64 { + if x != nil { + return x.Sequence + } + return 0 +} + +var File_admin_proto protoreflect.FileDescriptor + +var file_admin_proto_rawDesc = []byte{ + 0x0a, 0x0b, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x19, 0x63, + 0x61, 0x6f, 0x73, 0x2e, 0x7a, 0x69, 0x74, 0x61, 0x64, 0x65, 0x6c, 0x2e, 0x61, 0x64, 0x6d, 0x69, + 0x6e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2c, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x73, 0x77, 0x61, 0x67, 0x67, 0x65, 0x72, 0x2f, + 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x61, 0x75, 0x74, 0x68, 0x6f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x22, 0x17, 0x0a, 0x05, 0x4f, 0x72, 0x67, 0x49, 0x44, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x50, 0x0a, 0x10, + 0x55, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x4f, 0x72, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x1b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, + 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, + 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, + 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x22, 0x30, + 0x0a, 0x11, 0x55, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x4f, 0x72, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x73, 0x5f, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x69, 0x73, 0x55, 0x6e, 0x69, 0x71, 0x75, 0x65, + 0x22, 0xfa, 0x01, 0x0a, 0x03, 0x4f, 0x72, 0x67, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x39, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x23, 0x2e, 0x63, 0x61, 0x6f, 0x73, 0x2e, 0x7a, + 0x69, 0x74, 0x61, 0x64, 0x65, 0x6c, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x72, 0x67, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, + 0x61, 0x74, 0x65, 0x12, 0x3f, 0x0a, 0x0d, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x64, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x44, 0x61, 0x74, 0x65, 0x12, 0x3b, 0x0a, 0x0b, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x64, + 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x44, 0x61, 0x74, + 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x22, 0xf1, 0x01, + 0x0a, 0x10, 0x4f, 0x72, 0x67, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, + 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, + 0x12, 0x58, 0x0a, 0x0e, 0x73, 0x6f, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x63, 0x6f, 0x6c, 0x75, + 0x6d, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x27, 0x2e, 0x63, 0x61, 0x6f, 0x73, 0x2e, + 0x7a, 0x69, 0x74, 0x61, 0x64, 0x65, 0x6c, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x72, 0x67, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4b, 0x65, + 0x79, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x82, 0x01, 0x02, 0x20, 0x00, 0x52, 0x0d, 0x73, 0x6f, 0x72, + 0x74, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x73, + 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x61, 0x73, 0x63, 0x12, 0x43, 0x0a, 0x07, + 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, + 0x63, 0x61, 0x6f, 0x73, 0x2e, 0x7a, 0x69, 0x74, 0x61, 0x64, 0x65, 0x6c, 0x2e, 0x61, 0x64, 0x6d, + 0x69, 0x6e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x72, 0x67, 0x53, 0x65, 0x61, + 0x72, 0x63, 0x68, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x07, 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, + 0x73, 0x22, 0xaf, 0x01, 0x0a, 0x0e, 0x4f, 0x72, 0x67, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x12, 0x43, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x27, 0x2e, 0x63, 0x61, 0x6f, 0x73, 0x2e, 0x7a, 0x69, 0x74, 0x61, 0x64, 0x65, 0x6c, + 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x72, + 0x67, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4b, 0x65, 0x79, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x82, + 0x01, 0x02, 0x20, 0x00, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x42, 0x0a, 0x06, 0x6d, 0x65, 0x74, + 0x68, 0x6f, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2a, 0x2e, 0x63, 0x61, 0x6f, 0x73, + 0x2e, 0x7a, 0x69, 0x74, 0x61, 0x64, 0x65, 0x6c, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x72, 0x67, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4d, + 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x14, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x22, 0x9c, 0x01, 0x0a, 0x11, 0x4f, 0x72, 0x67, 0x53, 0x65, 0x61, 0x72, 0x63, + 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, + 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, + 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x74, 0x6f, 0x74, 0x61, 0x6c, + 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x74, + 0x6f, 0x74, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x36, 0x0a, 0x06, 0x72, 0x65, + 0x73, 0x75, 0x6c, 0x74, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x61, 0x6f, + 0x73, 0x2e, 0x7a, 0x69, 0x74, 0x61, 0x64, 0x65, 0x6c, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x72, 0x67, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x22, 0x92, 0x01, 0x0a, 0x0f, 0x4f, 0x72, 0x67, 0x53, 0x65, 0x74, 0x55, 0x70, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x03, 0x6f, 0x72, 0x67, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x63, 0x61, 0x6f, 0x73, 0x2e, 0x7a, 0x69, 0x74, 0x61, 0x64, + 0x65, 0x6c, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x52, 0x03, 0x6f, 0x72, 0x67, 0x12, 0x40, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x63, 0x61, 0x6f, 0x73, 0x2e, 0x7a, 0x69, 0x74, 0x61, 0x64, + 0x65, 0x6c, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x79, 0x0a, 0x10, 0x4f, 0x72, 0x67, 0x53, 0x65, + 0x74, 0x55, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x03, 0x6f, + 0x72, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x61, 0x6f, 0x73, 0x2e, + 0x7a, 0x69, 0x74, 0x61, 0x64, 0x65, 0x6c, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x72, 0x67, 0x52, 0x03, 0x6f, 0x72, 0x67, 0x12, 0x33, 0x0a, + 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x63, 0x61, + 0x6f, 0x73, 0x2e, 0x7a, 0x69, 0x74, 0x61, 0x64, 0x65, 0x6c, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, + 0x65, 0x72, 0x22, 0xb3, 0x05, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, + 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x27, 0x0a, 0x09, 0x75, 0x73, 0x65, 0x72, + 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, + 0x72, 0x05, 0x10, 0x01, 0x18, 0xc8, 0x01, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, + 0x65, 0x12, 0x29, 0x0a, 0x0a, 0x66, 0x69, 0x72, 0x73, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0x18, 0xc8, + 0x01, 0x52, 0x09, 0x66, 0x69, 0x72, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x27, 0x0a, 0x09, + 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0x18, 0xc8, 0x01, 0x52, 0x08, 0x6c, 0x61, 0x73, + 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x09, 0x6e, 0x69, 0x63, 0x6b, 0x5f, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x72, 0x03, 0x18, + 0xc8, 0x01, 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x37, 0x0a, 0x12, + 0x70, 0x72, 0x65, 0x66, 0x65, 0x72, 0x72, 0x65, 0x64, 0x5f, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, + 0x67, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x72, 0x03, 0x18, + 0xc8, 0x01, 0x52, 0x11, 0x70, 0x72, 0x65, 0x66, 0x65, 0x72, 0x72, 0x65, 0x64, 0x4c, 0x61, 0x6e, + 0x67, 0x75, 0x61, 0x67, 0x65, 0x12, 0x39, 0x0a, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x21, 0x2e, 0x63, 0x61, 0x6f, 0x73, 0x2e, 0x7a, 0x69, 0x74, + 0x61, 0x64, 0x65, 0x6c, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x31, 0x2e, 0x47, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x52, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, + 0x12, 0x22, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x0c, 0xfa, 0x42, 0x09, 0x72, 0x07, 0x10, 0x01, 0x18, 0xc8, 0x01, 0x60, 0x01, 0x52, 0x05, 0x65, + 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x2a, 0x0a, 0x11, 0x69, 0x73, 0x5f, 0x65, 0x6d, 0x61, 0x69, 0x6c, + 0x5f, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x0f, 0x69, 0x73, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, + 0x12, 0x1d, 0x0a, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x18, 0x14, 0x52, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x12, + 0x2a, 0x0a, 0x11, 0x69, 0x73, 0x5f, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x5f, 0x76, 0x65, 0x72, 0x69, + 0x66, 0x69, 0x65, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x69, 0x73, 0x50, 0x68, + 0x6f, 0x6e, 0x65, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x12, 0x22, 0x0a, 0x07, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x42, 0x08, 0xfa, 0x42, + 0x05, 0x72, 0x03, 0x18, 0xc8, 0x01, 0x52, 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x12, + 0x24, 0x0a, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x0c, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x72, 0x03, 0x18, 0xc8, 0x01, 0x52, 0x08, 0x6c, 0x6f, 0x63, + 0x61, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x29, 0x0a, 0x0b, 0x70, 0x6f, 0x73, 0x74, 0x61, 0x6c, 0x5f, + 0x63, 0x6f, 0x64, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x72, + 0x03, 0x18, 0xc8, 0x01, 0x52, 0x0a, 0x70, 0x6f, 0x73, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x64, 0x65, + 0x12, 0x20, 0x0a, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x08, 0xfa, 0x42, 0x05, 0x72, 0x03, 0x18, 0xc8, 0x01, 0x52, 0x06, 0x72, 0x65, 0x67, 0x69, + 0x6f, 0x6e, 0x12, 0x2f, 0x0a, 0x0e, 0x73, 0x74, 0x72, 0x65, 0x65, 0x74, 0x5f, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x72, + 0x03, 0x18, 0xc8, 0x01, 0x52, 0x0d, 0x73, 0x74, 0x72, 0x65, 0x65, 0x74, 0x41, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x12, 0x23, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, + 0x10, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x18, 0x48, 0x52, 0x08, + 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x85, 0x06, 0x0a, 0x04, 0x55, 0x73, 0x65, + 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, + 0x64, 0x12, 0x3a, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x24, 0x2e, 0x63, 0x61, 0x6f, 0x73, 0x2e, 0x7a, 0x69, 0x74, 0x61, 0x64, 0x65, 0x6c, 0x2e, + 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, + 0x72, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x3f, 0x0a, + 0x0d, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x52, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x65, 0x12, 0x3b, + 0x0a, 0x0b, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, + 0x0a, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x44, 0x61, 0x74, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x75, + 0x73, 0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x75, 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x66, 0x69, 0x72, 0x73, + 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x66, 0x69, + 0x72, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x61, 0x73, 0x74, 0x5f, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x61, 0x73, 0x74, + 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6e, 0x69, 0x63, 0x6b, 0x5f, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, + 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, + 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x2d, 0x0a, 0x12, 0x70, 0x72, 0x65, 0x66, 0x65, 0x72, 0x72, 0x65, + 0x64, 0x5f, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x11, 0x70, 0x72, 0x65, 0x66, 0x65, 0x72, 0x72, 0x65, 0x64, 0x4c, 0x61, 0x6e, 0x67, 0x75, + 0x61, 0x67, 0x65, 0x12, 0x39, 0x0a, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x0b, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x21, 0x2e, 0x63, 0x61, 0x6f, 0x73, 0x2e, 0x7a, 0x69, 0x74, 0x61, 0x64, + 0x65, 0x6c, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, + 0x47, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x52, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x14, + 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, + 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x28, 0x0a, 0x0f, 0x69, 0x73, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x56, + 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x69, + 0x73, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x12, 0x14, + 0x0a, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x70, + 0x68, 0x6f, 0x6e, 0x65, 0x12, 0x28, 0x0a, 0x0f, 0x69, 0x73, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x56, + 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x69, + 0x73, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x12, 0x18, + 0x0a, 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x18, 0x10, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x6f, 0x63, 0x61, + 0x6c, 0x69, 0x74, 0x79, 0x18, 0x11, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x6f, 0x63, 0x61, + 0x6c, 0x69, 0x74, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x6f, 0x73, 0x74, 0x61, 0x6c, 0x5f, 0x63, + 0x6f, 0x64, 0x65, 0x18, 0x12, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x6f, 0x73, 0x74, 0x61, + 0x6c, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, + 0x13, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x12, 0x25, 0x0a, + 0x0e, 0x73, 0x74, 0x72, 0x65, 0x65, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, + 0x14, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x73, 0x74, 0x72, 0x65, 0x65, 0x74, 0x41, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, + 0x18, 0x15, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, + 0x22, 0x47, 0x0a, 0x10, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x67, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x22, 0xb5, 0x02, 0x0a, 0x0c, 0x4f, 0x72, + 0x67, 0x49, 0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x15, 0x0a, 0x06, 0x6f, 0x72, + 0x67, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x72, 0x67, 0x49, + 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x38, 0x0a, 0x19, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x6c, 0x6f, 0x67, 0x69, + 0x6e, 0x5f, 0x6d, 0x75, 0x73, 0x74, 0x5f, 0x62, 0x65, 0x5f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x15, 0x75, 0x73, 0x65, 0x72, 0x4c, 0x6f, 0x67, 0x69, + 0x6e, 0x4d, 0x75, 0x73, 0x74, 0x42, 0x65, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x18, 0x0a, + 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, + 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, + 0x6e, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, + 0x6e, 0x63, 0x65, 0x12, 0x3f, 0x0a, 0x0d, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x64, 0x61, 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x44, 0x61, 0x74, 0x65, 0x12, 0x3b, 0x0a, 0x0b, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x64, + 0x61, 0x74, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x44, 0x61, 0x74, + 0x65, 0x22, 0x88, 0x01, 0x0a, 0x13, 0x4f, 0x72, 0x67, 0x49, 0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69, + 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x15, 0x0a, 0x06, 0x6f, 0x72, 0x67, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x72, 0x67, 0x49, 0x64, + 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x38, 0x0a, 0x19, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x6c, 0x6f, 0x67, 0x69, 0x6e, + 0x5f, 0x6d, 0x75, 0x73, 0x74, 0x5f, 0x62, 0x65, 0x5f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x15, 0x75, 0x73, 0x65, 0x72, 0x4c, 0x6f, 0x67, 0x69, 0x6e, + 0x4d, 0x75, 0x73, 0x74, 0x42, 0x65, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x22, 0x27, 0x0a, 0x0e, + 0x4f, 0x72, 0x67, 0x49, 0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x49, 0x44, 0x12, 0x15, + 0x0a, 0x06, 0x6f, 0x72, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x6f, 0x72, 0x67, 0x49, 0x64, 0x22, 0x71, 0x0a, 0x0d, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x45, + 0x76, 0x65, 0x6e, 0x74, 0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, + 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, + 0x73, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x76, 0x69, 0x65, 0x77, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x76, 0x69, 0x65, 0x77, 0x4e, 0x61, 0x6d, 0x65, 0x12, + 0x27, 0x0a, 0x0f, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x5f, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, + 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0e, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, + 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x22, 0x5b, 0x0a, 0x0c, 0x46, 0x61, 0x69, 0x6c, + 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x4b, 0x0a, 0x0d, 0x66, 0x61, 0x69, 0x6c, + 0x65, 0x64, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x26, 0x2e, 0x63, 0x61, 0x6f, 0x73, 0x2e, 0x7a, 0x69, 0x74, 0x61, 0x64, 0x65, 0x6c, 0x2e, 0x61, + 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x61, 0x69, 0x6c, + 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x0c, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x45, + 0x76, 0x65, 0x6e, 0x74, 0x73, 0x22, 0xb9, 0x01, 0x0a, 0x0b, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, + 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, + 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x76, 0x69, 0x65, 0x77, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x76, 0x69, 0x65, 0x77, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x27, + 0x0a, 0x0f, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x5f, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0e, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x53, + 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x66, 0x61, 0x69, 0x6c, 0x75, + 0x72, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, + 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x0d, + 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0c, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x22, 0x41, 0x0a, 0x06, 0x56, 0x69, 0x65, 0x77, 0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x64, + 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, + 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x76, 0x69, 0x65, 0x77, 0x5f, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x76, 0x69, 0x65, 0x77, + 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x3e, 0x0a, 0x05, 0x56, 0x69, 0x65, 0x77, 0x73, 0x12, 0x35, 0x0a, + 0x05, 0x76, 0x69, 0x65, 0x77, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x63, + 0x61, 0x6f, 0x73, 0x2e, 0x7a, 0x69, 0x74, 0x61, 0x64, 0x65, 0x6c, 0x2e, 0x61, 0x64, 0x6d, 0x69, + 0x6e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x69, 0x65, 0x77, 0x52, 0x05, 0x76, + 0x69, 0x65, 0x77, 0x73, 0x22, 0x5b, 0x0a, 0x04, 0x56, 0x69, 0x65, 0x77, 0x12, 0x1a, 0x0a, 0x08, + 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x76, 0x69, 0x65, 0x77, + 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x76, 0x69, 0x65, + 0x77, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, + 0x65, 0x2a, 0x50, 0x0a, 0x08, 0x4f, 0x72, 0x67, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x18, 0x0a, + 0x14, 0x4f, 0x52, 0x47, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, + 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x4f, 0x52, 0x47, 0x53, 0x54, + 0x41, 0x54, 0x45, 0x5f, 0x41, 0x43, 0x54, 0x49, 0x56, 0x45, 0x10, 0x01, 0x12, 0x15, 0x0a, 0x11, + 0x4f, 0x52, 0x47, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x49, 0x4e, 0x41, 0x43, 0x54, 0x49, 0x56, + 0x45, 0x10, 0x02, 0x2a, 0x78, 0x0a, 0x0c, 0x4f, 0x72, 0x67, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, + 0x4b, 0x65, 0x79, 0x12, 0x1c, 0x0a, 0x18, 0x4f, 0x52, 0x47, 0x53, 0x45, 0x41, 0x52, 0x43, 0x48, + 0x4b, 0x45, 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, + 0x00, 0x12, 0x19, 0x0a, 0x15, 0x4f, 0x52, 0x47, 0x53, 0x45, 0x41, 0x52, 0x43, 0x48, 0x4b, 0x45, + 0x59, 0x5f, 0x4f, 0x52, 0x47, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x10, 0x01, 0x12, 0x17, 0x0a, 0x13, + 0x4f, 0x52, 0x47, 0x53, 0x45, 0x41, 0x52, 0x43, 0x48, 0x4b, 0x45, 0x59, 0x5f, 0x44, 0x4f, 0x4d, + 0x41, 0x49, 0x4e, 0x10, 0x02, 0x12, 0x16, 0x0a, 0x12, 0x4f, 0x52, 0x47, 0x53, 0x45, 0x41, 0x52, + 0x43, 0x48, 0x4b, 0x45, 0x59, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x10, 0x03, 0x2a, 0x6c, 0x0a, + 0x0f, 0x4f, 0x72, 0x67, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, + 0x12, 0x1a, 0x0a, 0x16, 0x4f, 0x52, 0x47, 0x53, 0x45, 0x41, 0x52, 0x43, 0x48, 0x4d, 0x45, 0x54, + 0x48, 0x4f, 0x44, 0x5f, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x53, 0x10, 0x00, 0x12, 0x1f, 0x0a, 0x1b, + 0x4f, 0x52, 0x47, 0x53, 0x45, 0x41, 0x52, 0x43, 0x48, 0x4d, 0x45, 0x54, 0x48, 0x4f, 0x44, 0x5f, + 0x53, 0x54, 0x41, 0x52, 0x54, 0x53, 0x5f, 0x57, 0x49, 0x54, 0x48, 0x10, 0x01, 0x12, 0x1c, 0x0a, + 0x18, 0x4f, 0x52, 0x47, 0x53, 0x45, 0x41, 0x52, 0x43, 0x48, 0x4d, 0x45, 0x54, 0x48, 0x4f, 0x44, + 0x5f, 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x53, 0x10, 0x02, 0x2a, 0xaf, 0x01, 0x0a, 0x09, + 0x55, 0x73, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x19, 0x0a, 0x15, 0x55, 0x53, 0x45, + 0x52, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, + 0x45, 0x44, 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x55, 0x53, 0x45, 0x52, 0x53, 0x54, 0x41, 0x54, + 0x45, 0x5f, 0x41, 0x43, 0x54, 0x49, 0x56, 0x45, 0x10, 0x01, 0x12, 0x16, 0x0a, 0x12, 0x55, 0x53, + 0x45, 0x52, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x49, 0x4e, 0x41, 0x43, 0x54, 0x49, 0x56, 0x45, + 0x10, 0x02, 0x12, 0x15, 0x0a, 0x11, 0x55, 0x53, 0x45, 0x52, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, + 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45, 0x44, 0x10, 0x03, 0x12, 0x14, 0x0a, 0x10, 0x55, 0x53, 0x45, + 0x52, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x4c, 0x4f, 0x43, 0x4b, 0x45, 0x44, 0x10, 0x04, 0x12, + 0x15, 0x0a, 0x11, 0x55, 0x53, 0x45, 0x52, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x53, 0x55, 0x53, + 0x50, 0x45, 0x4e, 0x44, 0x10, 0x05, 0x12, 0x15, 0x0a, 0x11, 0x55, 0x53, 0x45, 0x52, 0x53, 0x54, + 0x41, 0x54, 0x45, 0x5f, 0x49, 0x4e, 0x49, 0x54, 0x49, 0x41, 0x4c, 0x10, 0x06, 0x2a, 0x58, 0x0a, + 0x06, 0x47, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x12, 0x47, 0x45, 0x4e, 0x44, 0x45, + 0x52, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, + 0x11, 0x0a, 0x0d, 0x47, 0x45, 0x4e, 0x44, 0x45, 0x52, 0x5f, 0x46, 0x45, 0x4d, 0x41, 0x4c, 0x45, + 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x47, 0x45, 0x4e, 0x44, 0x45, 0x52, 0x5f, 0x4d, 0x41, 0x4c, + 0x45, 0x10, 0x02, 0x12, 0x12, 0x0a, 0x0e, 0x47, 0x45, 0x4e, 0x44, 0x45, 0x52, 0x5f, 0x44, 0x49, + 0x56, 0x45, 0x52, 0x53, 0x45, 0x10, 0x03, 0x32, 0xa2, 0x0f, 0x0a, 0x0c, 0x41, 0x64, 0x6d, 0x69, + 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4b, 0x0a, 0x07, 0x48, 0x65, 0x61, 0x6c, + 0x74, 0x68, 0x7a, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x16, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, + 0x70, 0x74, 0x79, 0x22, 0x10, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0a, 0x12, 0x08, 0x2f, 0x68, 0x65, + 0x61, 0x6c, 0x74, 0x68, 0x7a, 0x12, 0x47, 0x0a, 0x05, 0x52, 0x65, 0x61, 0x64, 0x79, 0x12, 0x16, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x0e, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x08, 0x12, 0x06, 0x2f, 0x72, 0x65, 0x61, 0x64, 0x79, 0x12, 0x4e, + 0x0a, 0x08, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, + 0x74, 0x79, 0x1a, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x22, 0x11, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x0b, 0x12, 0x09, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x12, 0x8f, + 0x01, 0x0a, 0x0b, 0x49, 0x73, 0x4f, 0x72, 0x67, 0x55, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x12, 0x2b, + 0x2e, 0x63, 0x61, 0x6f, 0x73, 0x2e, 0x7a, 0x69, 0x74, 0x61, 0x64, 0x65, 0x6c, 0x2e, 0x61, 0x64, + 0x6d, 0x69, 0x6e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x6e, 0x69, 0x71, 0x75, + 0x65, 0x4f, 0x72, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x63, 0x61, + 0x6f, 0x73, 0x2e, 0x7a, 0x69, 0x74, 0x61, 0x64, 0x65, 0x6c, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x4f, 0x72, + 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x25, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x11, 0x12, 0x0f, 0x2f, 0x6f, 0x72, 0x67, 0x73, 0x2f, 0x5f, 0x69, 0x73, 0x75, 0x6e, 0x69, 0x71, + 0x75, 0x65, 0x82, 0xb5, 0x18, 0x0a, 0x0a, 0x08, 0x69, 0x61, 0x6d, 0x2e, 0x72, 0x65, 0x61, 0x64, + 0x12, 0x70, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x4f, 0x72, 0x67, 0x42, 0x79, 0x49, 0x44, 0x12, 0x20, + 0x2e, 0x63, 0x61, 0x6f, 0x73, 0x2e, 0x7a, 0x69, 0x74, 0x61, 0x64, 0x65, 0x6c, 0x2e, 0x61, 0x64, + 0x6d, 0x69, 0x6e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x72, 0x67, 0x49, 0x44, + 0x1a, 0x1e, 0x2e, 0x63, 0x61, 0x6f, 0x73, 0x2e, 0x7a, 0x69, 0x74, 0x61, 0x64, 0x65, 0x6c, 0x2e, + 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x72, 0x67, + 0x22, 0x20, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0c, 0x12, 0x0a, 0x2f, 0x6f, 0x72, 0x67, 0x73, 0x2f, + 0x7b, 0x69, 0x64, 0x7d, 0x82, 0xb5, 0x18, 0x0a, 0x0a, 0x08, 0x69, 0x61, 0x6d, 0x2e, 0x72, 0x65, + 0x61, 0x64, 0x12, 0x8f, 0x01, 0x0a, 0x0a, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4f, 0x72, 0x67, + 0x73, 0x12, 0x2b, 0x2e, 0x63, 0x61, 0x6f, 0x73, 0x2e, 0x7a, 0x69, 0x74, 0x61, 0x64, 0x65, 0x6c, + 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x72, + 0x67, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, + 0x2e, 0x63, 0x61, 0x6f, 0x73, 0x2e, 0x7a, 0x69, 0x74, 0x61, 0x64, 0x65, 0x6c, 0x2e, 0x61, 0x64, + 0x6d, 0x69, 0x6e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x72, 0x67, 0x53, 0x65, + 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x26, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x12, 0x22, 0x0d, 0x2f, 0x6f, 0x72, 0x67, 0x73, 0x2f, 0x5f, 0x73, 0x65, 0x61, + 0x72, 0x63, 0x68, 0x3a, 0x01, 0x2a, 0x82, 0xb5, 0x18, 0x0a, 0x0a, 0x08, 0x69, 0x61, 0x6d, 0x2e, + 0x72, 0x65, 0x61, 0x64, 0x12, 0x8b, 0x01, 0x0a, 0x08, 0x53, 0x65, 0x74, 0x55, 0x70, 0x4f, 0x72, + 0x67, 0x12, 0x2a, 0x2e, 0x63, 0x61, 0x6f, 0x73, 0x2e, 0x7a, 0x69, 0x74, 0x61, 0x64, 0x65, 0x6c, + 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x72, + 0x67, 0x53, 0x65, 0x74, 0x55, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, + 0x63, 0x61, 0x6f, 0x73, 0x2e, 0x7a, 0x69, 0x74, 0x61, 0x64, 0x65, 0x6c, 0x2e, 0x61, 0x64, 0x6d, + 0x69, 0x6e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x72, 0x67, 0x53, 0x65, 0x74, + 0x55, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x26, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x11, 0x22, 0x0c, 0x2f, 0x6f, 0x72, 0x67, 0x73, 0x2f, 0x5f, 0x73, 0x65, 0x74, 0x75, 0x70, + 0x3a, 0x01, 0x2a, 0x82, 0xb5, 0x18, 0x0b, 0x0a, 0x09, 0x69, 0x61, 0x6d, 0x2e, 0x77, 0x72, 0x69, + 0x74, 0x65, 0x12, 0x9c, 0x01, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x4f, 0x72, 0x67, 0x49, 0x61, 0x6d, + 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x29, 0x2e, 0x63, 0x61, 0x6f, 0x73, 0x2e, 0x7a, 0x69, + 0x74, 0x61, 0x64, 0x65, 0x6c, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x2e, 0x4f, 0x72, 0x67, 0x49, 0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x49, + 0x44, 0x1a, 0x27, 0x2e, 0x63, 0x61, 0x6f, 0x73, 0x2e, 0x7a, 0x69, 0x74, 0x61, 0x64, 0x65, 0x6c, + 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x72, + 0x67, 0x49, 0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x22, 0x35, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x1a, 0x12, 0x18, 0x2f, 0x6f, 0x72, 0x67, 0x73, 0x2f, 0x7b, 0x6f, 0x72, 0x67, 0x5f, 0x69, + 0x64, 0x7d, 0x2f, 0x69, 0x61, 0x6d, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x82, 0xb5, 0x18, 0x11, + 0x0a, 0x0f, 0x69, 0x61, 0x6d, 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x72, 0x65, 0x61, + 0x64, 0x12, 0xa8, 0x01, 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x67, 0x49, + 0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x2e, 0x2e, 0x63, 0x61, 0x6f, 0x73, 0x2e, + 0x7a, 0x69, 0x74, 0x61, 0x64, 0x65, 0x6c, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x72, 0x67, 0x49, 0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69, 0x63, + 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x63, 0x61, 0x6f, 0x73, 0x2e, + 0x7a, 0x69, 0x74, 0x61, 0x64, 0x65, 0x6c, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x72, 0x67, 0x49, 0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69, 0x63, + 0x79, 0x22, 0x39, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x22, 0x18, 0x2f, 0x6f, 0x72, 0x67, 0x73, + 0x2f, 0x7b, 0x6f, 0x72, 0x67, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x69, 0x61, 0x6d, 0x70, 0x6f, 0x6c, + 0x69, 0x63, 0x79, 0x3a, 0x01, 0x2a, 0x82, 0xb5, 0x18, 0x12, 0x0a, 0x10, 0x69, 0x61, 0x6d, 0x2e, + 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x77, 0x72, 0x69, 0x74, 0x65, 0x12, 0xa8, 0x01, 0x0a, + 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x67, 0x49, 0x61, 0x6d, 0x50, 0x6f, 0x6c, + 0x69, 0x63, 0x79, 0x12, 0x2e, 0x2e, 0x63, 0x61, 0x6f, 0x73, 0x2e, 0x7a, 0x69, 0x74, 0x61, 0x64, + 0x65, 0x6c, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, + 0x4f, 0x72, 0x67, 0x49, 0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x63, 0x61, 0x6f, 0x73, 0x2e, 0x7a, 0x69, 0x74, 0x61, 0x64, + 0x65, 0x6c, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, + 0x4f, 0x72, 0x67, 0x49, 0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x22, 0x39, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x1d, 0x1a, 0x18, 0x2f, 0x6f, 0x72, 0x67, 0x73, 0x2f, 0x7b, 0x6f, 0x72, 0x67, + 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x69, 0x61, 0x6d, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x3a, 0x01, + 0x2a, 0x82, 0xb5, 0x18, 0x12, 0x0a, 0x10, 0x69, 0x61, 0x6d, 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, + 0x79, 0x2e, 0x77, 0x72, 0x69, 0x74, 0x65, 0x12, 0x90, 0x01, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x4f, 0x72, 0x67, 0x49, 0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x29, + 0x2e, 0x63, 0x61, 0x6f, 0x73, 0x2e, 0x7a, 0x69, 0x74, 0x61, 0x64, 0x65, 0x6c, 0x2e, 0x61, 0x64, + 0x6d, 0x69, 0x6e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x72, 0x67, 0x49, 0x61, + 0x6d, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x49, 0x44, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, + 0x79, 0x22, 0x37, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x2a, 0x18, 0x2f, 0x6f, 0x72, 0x67, 0x73, + 0x2f, 0x7b, 0x6f, 0x72, 0x67, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x69, 0x61, 0x6d, 0x70, 0x6f, 0x6c, + 0x69, 0x63, 0x79, 0x82, 0xb5, 0x18, 0x13, 0x0a, 0x11, 0x69, 0x61, 0x6d, 0x2e, 0x70, 0x6f, 0x6c, + 0x69, 0x63, 0x79, 0x2e, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x62, 0x0a, 0x08, 0x47, 0x65, + 0x74, 0x56, 0x69, 0x65, 0x77, 0x73, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x20, + 0x2e, 0x63, 0x61, 0x6f, 0x73, 0x2e, 0x7a, 0x69, 0x74, 0x61, 0x64, 0x65, 0x6c, 0x2e, 0x61, 0x64, + 0x6d, 0x69, 0x6e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x69, 0x65, 0x77, 0x73, + 0x22, 0x1c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x08, 0x12, 0x06, 0x2f, 0x76, 0x69, 0x65, 0x77, 0x73, + 0x82, 0xb5, 0x18, 0x0a, 0x0a, 0x08, 0x69, 0x61, 0x6d, 0x2e, 0x72, 0x65, 0x61, 0x64, 0x12, 0x7c, + 0x0a, 0x09, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x56, 0x69, 0x65, 0x77, 0x12, 0x21, 0x2e, 0x63, 0x61, + 0x6f, 0x73, 0x2e, 0x7a, 0x69, 0x74, 0x61, 0x64, 0x65, 0x6c, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x69, 0x65, 0x77, 0x49, 0x44, 0x1a, 0x16, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x34, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x22, 0x1d, + 0x2f, 0x76, 0x69, 0x65, 0x77, 0x73, 0x2f, 0x7b, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, + 0x7d, 0x2f, 0x7b, 0x76, 0x69, 0x65, 0x77, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x82, 0xb5, 0x18, + 0x0b, 0x0a, 0x09, 0x69, 0x61, 0x6d, 0x2e, 0x77, 0x72, 0x69, 0x74, 0x65, 0x12, 0x77, 0x0a, 0x0f, + 0x47, 0x65, 0x74, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, + 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x27, 0x2e, 0x63, 0x61, 0x6f, 0x73, 0x2e, 0x7a, + 0x69, 0x74, 0x61, 0x64, 0x65, 0x6c, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, + 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0f, 0x12, 0x0d, 0x2f, 0x66, 0x61, 0x69, 0x6c, 0x65, + 0x64, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x82, 0xb5, 0x18, 0x0a, 0x0a, 0x08, 0x69, 0x61, 0x6d, + 0x2e, 0x72, 0x65, 0x61, 0x64, 0x12, 0xa4, 0x01, 0x0a, 0x11, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, + 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x28, 0x2e, 0x63, 0x61, + 0x6f, 0x73, 0x2e, 0x7a, 0x69, 0x74, 0x61, 0x64, 0x65, 0x6c, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x45, 0x76, + 0x65, 0x6e, 0x74, 0x49, 0x44, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x4d, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x38, 0x2a, 0x36, 0x2f, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x65, 0x76, + 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x7b, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x7d, 0x2f, + 0x7b, 0x76, 0x69, 0x65, 0x77, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x7b, 0x66, 0x61, 0x69, + 0x6c, 0x65, 0x64, 0x5f, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x7d, 0x82, 0xb5, 0x18, + 0x0b, 0x0a, 0x09, 0x69, 0x61, 0x6d, 0x2e, 0x77, 0x72, 0x69, 0x74, 0x65, 0x42, 0xbe, 0x01, 0x5a, + 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x61, 0x6f, 0x73, + 0x2f, 0x7a, 0x69, 0x74, 0x61, 0x64, 0x65, 0x6c, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x64, 0x6d, + 0x69, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x92, 0x41, 0x8e, 0x01, 0x12, + 0x41, 0x0a, 0x0d, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x20, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x22, 0x2b, 0x12, 0x29, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x61, 0x6f, 0x73, 0x2f, 0x7a, 0x69, 0x74, 0x61, + 0x64, 0x65, 0x6c, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x32, 0x03, 0x30, + 0x2e, 0x31, 0x2a, 0x01, 0x02, 0x32, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x32, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3a, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x10, 0x61, 0x70, 0x70, + 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_admin_proto_rawDescOnce sync.Once + file_admin_proto_rawDescData = file_admin_proto_rawDesc +) + +func file_admin_proto_rawDescGZIP() []byte { + file_admin_proto_rawDescOnce.Do(func() { + file_admin_proto_rawDescData = protoimpl.X.CompressGZIP(file_admin_proto_rawDescData) + }) + return file_admin_proto_rawDescData +} + +var file_admin_proto_enumTypes = make([]protoimpl.EnumInfo, 5) +var file_admin_proto_msgTypes = make([]protoimpl.MessageInfo, 21) +var file_admin_proto_goTypes = []interface{}{ + (OrgState)(0), // 0: caos.zitadel.admin.api.v1.OrgState + (OrgSearchKey)(0), // 1: caos.zitadel.admin.api.v1.OrgSearchKey + (OrgSearchMethod)(0), // 2: caos.zitadel.admin.api.v1.OrgSearchMethod + (UserState)(0), // 3: caos.zitadel.admin.api.v1.UserState + (Gender)(0), // 4: caos.zitadel.admin.api.v1.Gender + (*OrgID)(nil), // 5: caos.zitadel.admin.api.v1.OrgID + (*UniqueOrgRequest)(nil), // 6: caos.zitadel.admin.api.v1.UniqueOrgRequest + (*UniqueOrgResponse)(nil), // 7: caos.zitadel.admin.api.v1.UniqueOrgResponse + (*Org)(nil), // 8: caos.zitadel.admin.api.v1.Org + (*OrgSearchRequest)(nil), // 9: caos.zitadel.admin.api.v1.OrgSearchRequest + (*OrgSearchQuery)(nil), // 10: caos.zitadel.admin.api.v1.OrgSearchQuery + (*OrgSearchResponse)(nil), // 11: caos.zitadel.admin.api.v1.OrgSearchResponse + (*OrgSetUpRequest)(nil), // 12: caos.zitadel.admin.api.v1.OrgSetUpRequest + (*OrgSetUpResponse)(nil), // 13: caos.zitadel.admin.api.v1.OrgSetUpResponse + (*CreateUserRequest)(nil), // 14: caos.zitadel.admin.api.v1.CreateUserRequest + (*User)(nil), // 15: caos.zitadel.admin.api.v1.User + (*CreateOrgRequest)(nil), // 16: caos.zitadel.admin.api.v1.CreateOrgRequest + (*OrgIamPolicy)(nil), // 17: caos.zitadel.admin.api.v1.OrgIamPolicy + (*OrgIamPolicyRequest)(nil), // 18: caos.zitadel.admin.api.v1.OrgIamPolicyRequest + (*OrgIamPolicyID)(nil), // 19: caos.zitadel.admin.api.v1.OrgIamPolicyID + (*FailedEventID)(nil), // 20: caos.zitadel.admin.api.v1.FailedEventID + (*FailedEvents)(nil), // 21: caos.zitadel.admin.api.v1.FailedEvents + (*FailedEvent)(nil), // 22: caos.zitadel.admin.api.v1.FailedEvent + (*ViewID)(nil), // 23: caos.zitadel.admin.api.v1.ViewID + (*Views)(nil), // 24: caos.zitadel.admin.api.v1.Views + (*View)(nil), // 25: caos.zitadel.admin.api.v1.View + (*timestamp.Timestamp)(nil), // 26: google.protobuf.Timestamp + (*empty.Empty)(nil), // 27: google.protobuf.Empty + (*_struct.Struct)(nil), // 28: google.protobuf.Struct +} +var file_admin_proto_depIdxs = []int32{ + 0, // 0: caos.zitadel.admin.api.v1.Org.state:type_name -> caos.zitadel.admin.api.v1.OrgState + 26, // 1: caos.zitadel.admin.api.v1.Org.creation_date:type_name -> google.protobuf.Timestamp + 26, // 2: caos.zitadel.admin.api.v1.Org.change_date:type_name -> google.protobuf.Timestamp + 1, // 3: caos.zitadel.admin.api.v1.OrgSearchRequest.sorting_column:type_name -> caos.zitadel.admin.api.v1.OrgSearchKey + 10, // 4: caos.zitadel.admin.api.v1.OrgSearchRequest.queries:type_name -> caos.zitadel.admin.api.v1.OrgSearchQuery + 1, // 5: caos.zitadel.admin.api.v1.OrgSearchQuery.key:type_name -> caos.zitadel.admin.api.v1.OrgSearchKey + 2, // 6: caos.zitadel.admin.api.v1.OrgSearchQuery.method:type_name -> caos.zitadel.admin.api.v1.OrgSearchMethod + 8, // 7: caos.zitadel.admin.api.v1.OrgSearchResponse.result:type_name -> caos.zitadel.admin.api.v1.Org + 16, // 8: caos.zitadel.admin.api.v1.OrgSetUpRequest.org:type_name -> caos.zitadel.admin.api.v1.CreateOrgRequest + 14, // 9: caos.zitadel.admin.api.v1.OrgSetUpRequest.user:type_name -> caos.zitadel.admin.api.v1.CreateUserRequest + 8, // 10: caos.zitadel.admin.api.v1.OrgSetUpResponse.org:type_name -> caos.zitadel.admin.api.v1.Org + 15, // 11: caos.zitadel.admin.api.v1.OrgSetUpResponse.user:type_name -> caos.zitadel.admin.api.v1.User + 4, // 12: caos.zitadel.admin.api.v1.CreateUserRequest.gender:type_name -> caos.zitadel.admin.api.v1.Gender + 3, // 13: caos.zitadel.admin.api.v1.User.state:type_name -> caos.zitadel.admin.api.v1.UserState + 26, // 14: caos.zitadel.admin.api.v1.User.creation_date:type_name -> google.protobuf.Timestamp + 26, // 15: caos.zitadel.admin.api.v1.User.change_date:type_name -> google.protobuf.Timestamp + 4, // 16: caos.zitadel.admin.api.v1.User.gender:type_name -> caos.zitadel.admin.api.v1.Gender + 26, // 17: caos.zitadel.admin.api.v1.OrgIamPolicy.creation_date:type_name -> google.protobuf.Timestamp + 26, // 18: caos.zitadel.admin.api.v1.OrgIamPolicy.change_date:type_name -> google.protobuf.Timestamp + 22, // 19: caos.zitadel.admin.api.v1.FailedEvents.failed_events:type_name -> caos.zitadel.admin.api.v1.FailedEvent + 25, // 20: caos.zitadel.admin.api.v1.Views.views:type_name -> caos.zitadel.admin.api.v1.View + 27, // 21: caos.zitadel.admin.api.v1.AdminService.Healthz:input_type -> google.protobuf.Empty + 27, // 22: caos.zitadel.admin.api.v1.AdminService.Ready:input_type -> google.protobuf.Empty + 27, // 23: caos.zitadel.admin.api.v1.AdminService.Validate:input_type -> google.protobuf.Empty + 6, // 24: caos.zitadel.admin.api.v1.AdminService.IsOrgUnique:input_type -> caos.zitadel.admin.api.v1.UniqueOrgRequest + 5, // 25: caos.zitadel.admin.api.v1.AdminService.GetOrgByID:input_type -> caos.zitadel.admin.api.v1.OrgID + 9, // 26: caos.zitadel.admin.api.v1.AdminService.SearchOrgs:input_type -> caos.zitadel.admin.api.v1.OrgSearchRequest + 12, // 27: caos.zitadel.admin.api.v1.AdminService.SetUpOrg:input_type -> caos.zitadel.admin.api.v1.OrgSetUpRequest + 19, // 28: caos.zitadel.admin.api.v1.AdminService.GetOrgIamPolicy:input_type -> caos.zitadel.admin.api.v1.OrgIamPolicyID + 18, // 29: caos.zitadel.admin.api.v1.AdminService.CreateOrgIamPolicy:input_type -> caos.zitadel.admin.api.v1.OrgIamPolicyRequest + 18, // 30: caos.zitadel.admin.api.v1.AdminService.UpdateOrgIamPolicy:input_type -> caos.zitadel.admin.api.v1.OrgIamPolicyRequest + 19, // 31: caos.zitadel.admin.api.v1.AdminService.DeleteOrgIamPolicy:input_type -> caos.zitadel.admin.api.v1.OrgIamPolicyID + 27, // 32: caos.zitadel.admin.api.v1.AdminService.GetViews:input_type -> google.protobuf.Empty + 23, // 33: caos.zitadel.admin.api.v1.AdminService.ClearView:input_type -> caos.zitadel.admin.api.v1.ViewID + 27, // 34: caos.zitadel.admin.api.v1.AdminService.GetFailedEvents:input_type -> google.protobuf.Empty + 20, // 35: caos.zitadel.admin.api.v1.AdminService.RemoveFailedEvent:input_type -> caos.zitadel.admin.api.v1.FailedEventID + 27, // 36: caos.zitadel.admin.api.v1.AdminService.Healthz:output_type -> google.protobuf.Empty + 27, // 37: caos.zitadel.admin.api.v1.AdminService.Ready:output_type -> google.protobuf.Empty + 28, // 38: caos.zitadel.admin.api.v1.AdminService.Validate:output_type -> google.protobuf.Struct + 7, // 39: caos.zitadel.admin.api.v1.AdminService.IsOrgUnique:output_type -> caos.zitadel.admin.api.v1.UniqueOrgResponse + 8, // 40: caos.zitadel.admin.api.v1.AdminService.GetOrgByID:output_type -> caos.zitadel.admin.api.v1.Org + 11, // 41: caos.zitadel.admin.api.v1.AdminService.SearchOrgs:output_type -> caos.zitadel.admin.api.v1.OrgSearchResponse + 13, // 42: caos.zitadel.admin.api.v1.AdminService.SetUpOrg:output_type -> caos.zitadel.admin.api.v1.OrgSetUpResponse + 17, // 43: caos.zitadel.admin.api.v1.AdminService.GetOrgIamPolicy:output_type -> caos.zitadel.admin.api.v1.OrgIamPolicy + 17, // 44: caos.zitadel.admin.api.v1.AdminService.CreateOrgIamPolicy:output_type -> caos.zitadel.admin.api.v1.OrgIamPolicy + 17, // 45: caos.zitadel.admin.api.v1.AdminService.UpdateOrgIamPolicy:output_type -> caos.zitadel.admin.api.v1.OrgIamPolicy + 27, // 46: caos.zitadel.admin.api.v1.AdminService.DeleteOrgIamPolicy:output_type -> google.protobuf.Empty + 24, // 47: caos.zitadel.admin.api.v1.AdminService.GetViews:output_type -> caos.zitadel.admin.api.v1.Views + 27, // 48: caos.zitadel.admin.api.v1.AdminService.ClearView:output_type -> google.protobuf.Empty + 21, // 49: caos.zitadel.admin.api.v1.AdminService.GetFailedEvents:output_type -> caos.zitadel.admin.api.v1.FailedEvents + 27, // 50: caos.zitadel.admin.api.v1.AdminService.RemoveFailedEvent:output_type -> google.protobuf.Empty + 36, // [36:51] is the sub-list for method output_type + 21, // [21:36] is the sub-list for method input_type + 21, // [21:21] is the sub-list for extension type_name + 21, // [21:21] is the sub-list for extension extendee + 0, // [0:21] is the sub-list for field type_name +} + +func init() { file_admin_proto_init() } +func file_admin_proto_init() { + if File_admin_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_admin_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OrgID); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_admin_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UniqueOrgRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_admin_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UniqueOrgResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_admin_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Org); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_admin_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OrgSearchRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_admin_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OrgSearchQuery); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_admin_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OrgSearchResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_admin_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OrgSetUpRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_admin_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OrgSetUpResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_admin_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateUserRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_admin_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*User); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_admin_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateOrgRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_admin_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OrgIamPolicy); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_admin_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OrgIamPolicyRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_admin_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OrgIamPolicyID); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_admin_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FailedEventID); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_admin_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FailedEvents); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_admin_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FailedEvent); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_admin_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ViewID); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_admin_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Views); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_admin_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*View); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_admin_proto_rawDesc, + NumEnums: 5, + NumMessages: 21, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_admin_proto_goTypes, + DependencyIndexes: file_admin_proto_depIdxs, + EnumInfos: file_admin_proto_enumTypes, + MessageInfos: file_admin_proto_msgTypes, + }.Build() + File_admin_proto = out.File + file_admin_proto_rawDesc = nil + file_admin_proto_goTypes = nil + file_admin_proto_depIdxs = nil } // Reference imports to suppress errors if they are not otherwise used. @@ -1446,6 +2695,10 @@ type AdminServiceClient interface { CreateOrgIamPolicy(ctx context.Context, in *OrgIamPolicyRequest, opts ...grpc.CallOption) (*OrgIamPolicy, error) UpdateOrgIamPolicy(ctx context.Context, in *OrgIamPolicyRequest, opts ...grpc.CallOption) (*OrgIamPolicy, error) DeleteOrgIamPolicy(ctx context.Context, in *OrgIamPolicyID, opts ...grpc.CallOption) (*empty.Empty, error) + GetViews(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*Views, error) + ClearView(ctx context.Context, in *ViewID, opts ...grpc.CallOption) (*empty.Empty, error) + GetFailedEvents(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*FailedEvents, error) + RemoveFailedEvent(ctx context.Context, in *FailedEventID, opts ...grpc.CallOption) (*empty.Empty, error) } type adminServiceClient struct { @@ -1555,6 +2808,42 @@ func (c *adminServiceClient) DeleteOrgIamPolicy(ctx context.Context, in *OrgIamP return out, nil } +func (c *adminServiceClient) GetViews(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*Views, error) { + out := new(Views) + err := c.cc.Invoke(ctx, "/caos.zitadel.admin.api.v1.AdminService/GetViews", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *adminServiceClient) ClearView(ctx context.Context, in *ViewID, opts ...grpc.CallOption) (*empty.Empty, error) { + out := new(empty.Empty) + err := c.cc.Invoke(ctx, "/caos.zitadel.admin.api.v1.AdminService/ClearView", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *adminServiceClient) GetFailedEvents(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*FailedEvents, error) { + out := new(FailedEvents) + err := c.cc.Invoke(ctx, "/caos.zitadel.admin.api.v1.AdminService/GetFailedEvents", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *adminServiceClient) RemoveFailedEvent(ctx context.Context, in *FailedEventID, opts ...grpc.CallOption) (*empty.Empty, error) { + out := new(empty.Empty) + err := c.cc.Invoke(ctx, "/caos.zitadel.admin.api.v1.AdminService/RemoveFailedEvent", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // AdminServiceServer is the server API for AdminService service. type AdminServiceServer interface { // Healthz returns status OK as soon as the service started @@ -1572,45 +2861,61 @@ type AdminServiceServer interface { CreateOrgIamPolicy(context.Context, *OrgIamPolicyRequest) (*OrgIamPolicy, error) UpdateOrgIamPolicy(context.Context, *OrgIamPolicyRequest) (*OrgIamPolicy, error) DeleteOrgIamPolicy(context.Context, *OrgIamPolicyID) (*empty.Empty, error) + GetViews(context.Context, *empty.Empty) (*Views, error) + ClearView(context.Context, *ViewID) (*empty.Empty, error) + GetFailedEvents(context.Context, *empty.Empty) (*FailedEvents, error) + RemoveFailedEvent(context.Context, *FailedEventID) (*empty.Empty, error) } // UnimplementedAdminServiceServer can be embedded to have forward compatible implementations. type UnimplementedAdminServiceServer struct { } -func (*UnimplementedAdminServiceServer) Healthz(ctx context.Context, req *empty.Empty) (*empty.Empty, error) { +func (*UnimplementedAdminServiceServer) Healthz(context.Context, *empty.Empty) (*empty.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method Healthz not implemented") } -func (*UnimplementedAdminServiceServer) Ready(ctx context.Context, req *empty.Empty) (*empty.Empty, error) { +func (*UnimplementedAdminServiceServer) Ready(context.Context, *empty.Empty) (*empty.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method Ready not implemented") } -func (*UnimplementedAdminServiceServer) Validate(ctx context.Context, req *empty.Empty) (*_struct.Struct, error) { +func (*UnimplementedAdminServiceServer) Validate(context.Context, *empty.Empty) (*_struct.Struct, error) { return nil, status.Errorf(codes.Unimplemented, "method Validate not implemented") } -func (*UnimplementedAdminServiceServer) IsOrgUnique(ctx context.Context, req *UniqueOrgRequest) (*UniqueOrgResponse, error) { +func (*UnimplementedAdminServiceServer) IsOrgUnique(context.Context, *UniqueOrgRequest) (*UniqueOrgResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method IsOrgUnique not implemented") } -func (*UnimplementedAdminServiceServer) GetOrgByID(ctx context.Context, req *OrgID) (*Org, error) { +func (*UnimplementedAdminServiceServer) GetOrgByID(context.Context, *OrgID) (*Org, error) { return nil, status.Errorf(codes.Unimplemented, "method GetOrgByID not implemented") } -func (*UnimplementedAdminServiceServer) SearchOrgs(ctx context.Context, req *OrgSearchRequest) (*OrgSearchResponse, error) { +func (*UnimplementedAdminServiceServer) SearchOrgs(context.Context, *OrgSearchRequest) (*OrgSearchResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SearchOrgs not implemented") } -func (*UnimplementedAdminServiceServer) SetUpOrg(ctx context.Context, req *OrgSetUpRequest) (*OrgSetUpResponse, error) { +func (*UnimplementedAdminServiceServer) SetUpOrg(context.Context, *OrgSetUpRequest) (*OrgSetUpResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SetUpOrg not implemented") } -func (*UnimplementedAdminServiceServer) GetOrgIamPolicy(ctx context.Context, req *OrgIamPolicyID) (*OrgIamPolicy, error) { +func (*UnimplementedAdminServiceServer) GetOrgIamPolicy(context.Context, *OrgIamPolicyID) (*OrgIamPolicy, error) { return nil, status.Errorf(codes.Unimplemented, "method GetOrgIamPolicy not implemented") } -func (*UnimplementedAdminServiceServer) CreateOrgIamPolicy(ctx context.Context, req *OrgIamPolicyRequest) (*OrgIamPolicy, error) { +func (*UnimplementedAdminServiceServer) CreateOrgIamPolicy(context.Context, *OrgIamPolicyRequest) (*OrgIamPolicy, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateOrgIamPolicy not implemented") } -func (*UnimplementedAdminServiceServer) UpdateOrgIamPolicy(ctx context.Context, req *OrgIamPolicyRequest) (*OrgIamPolicy, error) { +func (*UnimplementedAdminServiceServer) UpdateOrgIamPolicy(context.Context, *OrgIamPolicyRequest) (*OrgIamPolicy, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateOrgIamPolicy not implemented") } -func (*UnimplementedAdminServiceServer) DeleteOrgIamPolicy(ctx context.Context, req *OrgIamPolicyID) (*empty.Empty, error) { +func (*UnimplementedAdminServiceServer) DeleteOrgIamPolicy(context.Context, *OrgIamPolicyID) (*empty.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method DeleteOrgIamPolicy not implemented") } +func (*UnimplementedAdminServiceServer) GetViews(context.Context, *empty.Empty) (*Views, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetViews not implemented") +} +func (*UnimplementedAdminServiceServer) ClearView(context.Context, *ViewID) (*empty.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method ClearView not implemented") +} +func (*UnimplementedAdminServiceServer) GetFailedEvents(context.Context, *empty.Empty) (*FailedEvents, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetFailedEvents not implemented") +} +func (*UnimplementedAdminServiceServer) RemoveFailedEvent(context.Context, *FailedEventID) (*empty.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method RemoveFailedEvent not implemented") +} func RegisterAdminServiceServer(s *grpc.Server, srv AdminServiceServer) { s.RegisterService(&_AdminService_serviceDesc, srv) @@ -1814,6 +3119,78 @@ func _AdminService_DeleteOrgIamPolicy_Handler(srv interface{}, ctx context.Conte return interceptor(ctx, in, info, handler) } +func _AdminService_GetViews_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(empty.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AdminServiceServer).GetViews(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/caos.zitadel.admin.api.v1.AdminService/GetViews", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AdminServiceServer).GetViews(ctx, req.(*empty.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _AdminService_ClearView_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ViewID) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AdminServiceServer).ClearView(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/caos.zitadel.admin.api.v1.AdminService/ClearView", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AdminServiceServer).ClearView(ctx, req.(*ViewID)) + } + return interceptor(ctx, in, info, handler) +} + +func _AdminService_GetFailedEvents_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(empty.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AdminServiceServer).GetFailedEvents(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/caos.zitadel.admin.api.v1.AdminService/GetFailedEvents", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AdminServiceServer).GetFailedEvents(ctx, req.(*empty.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _AdminService_RemoveFailedEvent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(FailedEventID) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AdminServiceServer).RemoveFailedEvent(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/caos.zitadel.admin.api.v1.AdminService/RemoveFailedEvent", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AdminServiceServer).RemoveFailedEvent(ctx, req.(*FailedEventID)) + } + return interceptor(ctx, in, info, handler) +} + var _AdminService_serviceDesc = grpc.ServiceDesc{ ServiceName: "caos.zitadel.admin.api.v1.AdminService", HandlerType: (*AdminServiceServer)(nil), @@ -1862,6 +3239,22 @@ var _AdminService_serviceDesc = grpc.ServiceDesc{ MethodName: "DeleteOrgIamPolicy", Handler: _AdminService_DeleteOrgIamPolicy_Handler, }, + { + MethodName: "GetViews", + Handler: _AdminService_GetViews_Handler, + }, + { + MethodName: "ClearView", + Handler: _AdminService_ClearView_Handler, + }, + { + MethodName: "GetFailedEvents", + Handler: _AdminService_GetFailedEvents_Handler, + }, + { + MethodName: "RemoveFailedEvent", + Handler: _AdminService_RemoveFailedEvent_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "admin.proto", diff --git a/pkg/admin/api/grpc/admin.pb.gw.go b/pkg/admin/api/grpc/admin.pb.gw.go index 65b6206302..5f73b8f4aa 100644 --- a/pkg/admin/api/grpc/admin.pb.gw.go +++ b/pkg/admin/api/grpc/admin.pb.gw.go @@ -38,15 +38,6 @@ func request_AdminService_Healthz_0(ctx context.Context, marshaler runtime.Marsh } -func local_request_AdminService_Healthz_0(ctx context.Context, marshaler runtime.Marshaler, server AdminServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq empty.Empty - var metadata runtime.ServerMetadata - - msg, err := server.Healthz(ctx, &protoReq) - return msg, metadata, err - -} - func request_AdminService_Ready_0(ctx context.Context, marshaler runtime.Marshaler, client AdminServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq empty.Empty var metadata runtime.ServerMetadata @@ -56,15 +47,6 @@ func request_AdminService_Ready_0(ctx context.Context, marshaler runtime.Marshal } -func local_request_AdminService_Ready_0(ctx context.Context, marshaler runtime.Marshaler, server AdminServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq empty.Empty - var metadata runtime.ServerMetadata - - msg, err := server.Ready(ctx, &protoReq) - return msg, metadata, err - -} - func request_AdminService_Validate_0(ctx context.Context, marshaler runtime.Marshaler, client AdminServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq empty.Empty var metadata runtime.ServerMetadata @@ -74,15 +56,6 @@ func request_AdminService_Validate_0(ctx context.Context, marshaler runtime.Mars } -func local_request_AdminService_Validate_0(ctx context.Context, marshaler runtime.Marshaler, server AdminServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq empty.Empty - var metadata runtime.ServerMetadata - - msg, err := server.Validate(ctx, &protoReq) - return msg, metadata, err - -} - var ( filter_AdminService_IsOrgUnique_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} ) @@ -91,27 +64,11 @@ func request_AdminService_IsOrgUnique_0(ctx context.Context, marshaler runtime.M var protoReq UniqueOrgRequest var metadata runtime.ServerMetadata - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AdminService_IsOrgUnique_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.IsOrgUnique(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AdminService_IsOrgUnique_0(ctx context.Context, marshaler runtime.Marshaler, server AdminServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq UniqueOrgRequest - var metadata runtime.ServerMetadata - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_AdminService_IsOrgUnique_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.IsOrgUnique(ctx, &protoReq) + msg, err := client.IsOrgUnique(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } @@ -143,33 +100,6 @@ func request_AdminService_GetOrgByID_0(ctx context.Context, marshaler runtime.Ma } -func local_request_AdminService_GetOrgByID_0(ctx context.Context, marshaler runtime.Marshaler, server AdminServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq OrgID - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") - } - - protoReq.Id, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) - } - - msg, err := server.GetOrgByID(ctx, &protoReq) - return msg, metadata, err - -} - func request_AdminService_SearchOrgs_0(ctx context.Context, marshaler runtime.Marshaler, client AdminServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq OrgSearchRequest var metadata runtime.ServerMetadata @@ -187,23 +117,6 @@ func request_AdminService_SearchOrgs_0(ctx context.Context, marshaler runtime.Ma } -func local_request_AdminService_SearchOrgs_0(ctx context.Context, marshaler runtime.Marshaler, server AdminServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq OrgSearchRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.SearchOrgs(ctx, &protoReq) - return msg, metadata, err - -} - func request_AdminService_SetUpOrg_0(ctx context.Context, marshaler runtime.Marshaler, client AdminServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq OrgSetUpRequest var metadata runtime.ServerMetadata @@ -221,23 +134,6 @@ func request_AdminService_SetUpOrg_0(ctx context.Context, marshaler runtime.Mars } -func local_request_AdminService_SetUpOrg_0(ctx context.Context, marshaler runtime.Marshaler, server AdminServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq OrgSetUpRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.SetUpOrg(ctx, &protoReq) - return msg, metadata, err - -} - func request_AdminService_GetOrgIamPolicy_0(ctx context.Context, marshaler runtime.Marshaler, client AdminServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq OrgIamPolicyID var metadata runtime.ServerMetadata @@ -265,33 +161,6 @@ func request_AdminService_GetOrgIamPolicy_0(ctx context.Context, marshaler runti } -func local_request_AdminService_GetOrgIamPolicy_0(ctx context.Context, marshaler runtime.Marshaler, server AdminServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq OrgIamPolicyID - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["org_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "org_id") - } - - protoReq.OrgId, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "org_id", err) - } - - msg, err := server.GetOrgIamPolicy(ctx, &protoReq) - return msg, metadata, err - -} - func request_AdminService_CreateOrgIamPolicy_0(ctx context.Context, marshaler runtime.Marshaler, client AdminServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq OrgIamPolicyRequest var metadata runtime.ServerMetadata @@ -327,41 +196,6 @@ func request_AdminService_CreateOrgIamPolicy_0(ctx context.Context, marshaler ru } -func local_request_AdminService_CreateOrgIamPolicy_0(ctx context.Context, marshaler runtime.Marshaler, server AdminServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq OrgIamPolicyRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["org_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "org_id") - } - - protoReq.OrgId, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "org_id", err) - } - - msg, err := server.CreateOrgIamPolicy(ctx, &protoReq) - return msg, metadata, err - -} - func request_AdminService_UpdateOrgIamPolicy_0(ctx context.Context, marshaler runtime.Marshaler, client AdminServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq OrgIamPolicyRequest var metadata runtime.ServerMetadata @@ -397,41 +231,6 @@ func request_AdminService_UpdateOrgIamPolicy_0(ctx context.Context, marshaler ru } -func local_request_AdminService_UpdateOrgIamPolicy_0(ctx context.Context, marshaler runtime.Marshaler, server AdminServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq OrgIamPolicyRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["org_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "org_id") - } - - protoReq.OrgId, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "org_id", err) - } - - msg, err := server.UpdateOrgIamPolicy(ctx, &protoReq) - return msg, metadata, err - -} - func request_AdminService_DeleteOrgIamPolicy_0(ctx context.Context, marshaler runtime.Marshaler, client AdminServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq OrgIamPolicyID var metadata runtime.ServerMetadata @@ -459,8 +258,17 @@ func request_AdminService_DeleteOrgIamPolicy_0(ctx context.Context, marshaler ru } -func local_request_AdminService_DeleteOrgIamPolicy_0(ctx context.Context, marshaler runtime.Marshaler, server AdminServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq OrgIamPolicyID +func request_AdminService_GetViews_0(ctx context.Context, marshaler runtime.Marshaler, client AdminServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq empty.Empty + var metadata runtime.ServerMetadata + + msg, err := client.GetViews(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func request_AdminService_ClearView_0(ctx context.Context, marshaler runtime.Marshaler, client AdminServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ViewID var metadata runtime.ServerMetadata var ( @@ -470,248 +278,89 @@ func local_request_AdminService_DeleteOrgIamPolicy_0(ctx context.Context, marsha _ = err ) - val, ok = pathParams["org_id"] + val, ok = pathParams["database"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "org_id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "database") } - protoReq.OrgId, err = runtime.String(val) + protoReq.Database, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "org_id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "database", err) } - msg, err := server.DeleteOrgIamPolicy(ctx, &protoReq) + val, ok = pathParams["view_name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "view_name") + } + + protoReq.ViewName, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "view_name", err) + } + + msg, err := client.ClearView(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -// RegisterAdminServiceHandlerServer registers the http handlers for service AdminService to "mux". -// UnaryRPC :call AdminServiceServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -func RegisterAdminServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AdminServiceServer, opts []grpc.DialOption) error { +func request_AdminService_GetFailedEvents_0(ctx context.Context, marshaler runtime.Marshaler, client AdminServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq empty.Empty + var metadata runtime.ServerMetadata - mux.Handle("GET", pattern_AdminService_Healthz_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AdminService_Healthz_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } + msg, err := client.GetFailedEvents(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err - forward_AdminService_Healthz_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) +} - }) +func request_AdminService_RemoveFailedEvent_0(ctx context.Context, marshaler runtime.Marshaler, client AdminServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq FailedEventID + var metadata runtime.ServerMetadata - mux.Handle("GET", pattern_AdminService_Ready_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AdminService_Ready_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } + var ( + val string + ok bool + err error + _ = err + ) - forward_AdminService_Ready_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + val, ok = pathParams["database"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "database") + } - }) + protoReq.Database, err = runtime.String(val) - mux.Handle("GET", pattern_AdminService_Validate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AdminService_Validate_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "database", err) + } - forward_AdminService_Validate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + val, ok = pathParams["view_name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "view_name") + } - }) + protoReq.ViewName, err = runtime.String(val) - mux.Handle("GET", pattern_AdminService_IsOrgUnique_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AdminService_IsOrgUnique_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "view_name", err) + } - forward_AdminService_IsOrgUnique_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + val, ok = pathParams["failed_sequence"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "failed_sequence") + } - }) + protoReq.FailedSequence, err = runtime.Uint64(val) - mux.Handle("GET", pattern_AdminService_GetOrgByID_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AdminService_GetOrgByID_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "failed_sequence", err) + } - forward_AdminService_GetOrgByID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + msg, err := client.RemoveFailedEvent(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err - }) - - mux.Handle("POST", pattern_AdminService_SearchOrgs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AdminService_SearchOrgs_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AdminService_SearchOrgs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AdminService_SetUpOrg_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AdminService_SetUpOrg_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AdminService_SetUpOrg_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_AdminService_GetOrgIamPolicy_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AdminService_GetOrgIamPolicy_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AdminService_GetOrgIamPolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AdminService_CreateOrgIamPolicy_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AdminService_CreateOrgIamPolicy_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AdminService_CreateOrgIamPolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("PUT", pattern_AdminService_UpdateOrgIamPolicy_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AdminService_UpdateOrgIamPolicy_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AdminService_UpdateOrgIamPolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("DELETE", pattern_AdminService_DeleteOrgIamPolicy_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AdminService_DeleteOrgIamPolicy_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AdminService_DeleteOrgIamPolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil } // RegisterAdminServiceHandlerFromEndpoint is same as RegisterAdminServiceHandler but @@ -972,31 +621,119 @@ func RegisterAdminServiceHandlerClient(ctx context.Context, mux *runtime.ServeMu }) + mux.Handle("GET", pattern_AdminService_GetViews_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_AdminService_GetViews_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_AdminService_GetViews_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_AdminService_ClearView_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_AdminService_ClearView_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_AdminService_ClearView_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_AdminService_GetFailedEvents_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_AdminService_GetFailedEvents_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_AdminService_GetFailedEvents_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_AdminService_RemoveFailedEvent_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_AdminService_RemoveFailedEvent_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_AdminService_RemoveFailedEvent_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } var ( - pattern_AdminService_Healthz_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"healthz"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_AdminService_Healthz_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"healthz"}, "")) - pattern_AdminService_Ready_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"ready"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_AdminService_Ready_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"ready"}, "")) - pattern_AdminService_Validate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"validate"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_AdminService_Validate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"validate"}, "")) - pattern_AdminService_IsOrgUnique_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"orgs", "_isunique"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_AdminService_IsOrgUnique_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"orgs", "_isunique"}, "")) - pattern_AdminService_GetOrgByID_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1}, []string{"orgs", "id"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_AdminService_GetOrgByID_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1}, []string{"orgs", "id"}, "")) - pattern_AdminService_SearchOrgs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"orgs", "_search"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_AdminService_SearchOrgs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"orgs", "_search"}, "")) - pattern_AdminService_SetUpOrg_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"orgs", "_setup"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_AdminService_SetUpOrg_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"orgs", "_setup"}, "")) - pattern_AdminService_GetOrgIamPolicy_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1, 2, 2}, []string{"orgs", "org_id", "iampolicy"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_AdminService_GetOrgIamPolicy_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1, 2, 2}, []string{"orgs", "org_id", "iampolicy"}, "")) - pattern_AdminService_CreateOrgIamPolicy_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1, 2, 2}, []string{"orgs", "org_id", "iampolicy"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_AdminService_CreateOrgIamPolicy_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1, 2, 2}, []string{"orgs", "org_id", "iampolicy"}, "")) - pattern_AdminService_UpdateOrgIamPolicy_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1, 2, 2}, []string{"orgs", "org_id", "iampolicy"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_AdminService_UpdateOrgIamPolicy_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1, 2, 2}, []string{"orgs", "org_id", "iampolicy"}, "")) - pattern_AdminService_DeleteOrgIamPolicy_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1, 2, 2}, []string{"orgs", "org_id", "iampolicy"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_AdminService_DeleteOrgIamPolicy_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1, 2, 2}, []string{"orgs", "org_id", "iampolicy"}, "")) + + pattern_AdminService_GetViews_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"views"}, "")) + + pattern_AdminService_ClearView_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1, 1, 0, 4, 1, 5, 2}, []string{"views", "database", "view_name"}, "")) + + pattern_AdminService_GetFailedEvents_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"failedevents"}, "")) + + pattern_AdminService_RemoveFailedEvent_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1, 1, 0, 4, 1, 5, 2, 1, 0, 4, 1, 5, 3}, []string{"failedevents", "database", "view_name", "failed_sequence"}, "")) ) var ( @@ -1021,4 +758,12 @@ var ( forward_AdminService_UpdateOrgIamPolicy_0 = runtime.ForwardResponseMessage forward_AdminService_DeleteOrgIamPolicy_0 = runtime.ForwardResponseMessage + + forward_AdminService_GetViews_0 = runtime.ForwardResponseMessage + + forward_AdminService_ClearView_0 = runtime.ForwardResponseMessage + + forward_AdminService_GetFailedEvents_0 = runtime.ForwardResponseMessage + + forward_AdminService_RemoveFailedEvent_0 = runtime.ForwardResponseMessage ) diff --git a/pkg/admin/api/grpc/admin.swagger.json b/pkg/admin/api/grpc/admin.swagger.json index d3d14f1001..373756a524 100644 --- a/pkg/admin/api/grpc/admin.swagger.json +++ b/pkg/admin/api/grpc/admin.swagger.json @@ -19,6 +19,59 @@ "application/grpc" ], "paths": { + "/failedevents": { + "get": { + "operationId": "GetFailedEvents", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1FailedEvents" + } + } + }, + "tags": [ + "AdminService" + ] + } + }, + "/failedevents/{database}/{view_name}/{failed_sequence}": { + "delete": { + "operationId": "RemoveFailedEvent", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "properties": {} + } + } + }, + "parameters": [ + { + "name": "database", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "view_name", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "failed_sequence", + "in": "path", + "required": true, + "type": "string", + "format": "uint64" + } + ], + "tags": [ + "AdminService" + ] + } + }, "/healthz": { "get": { "summary": "Healthz returns status OK as soon as the service started", @@ -274,7 +327,7 @@ "200": { "description": "A successful response.", "schema": { - "type": "object" + "$ref": "#/definitions/protobufStruct" } } }, @@ -282,9 +335,68 @@ "AdminService" ] } + }, + "/views": { + "get": { + "operationId": "GetViews", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1Views" + } + } + }, + "tags": [ + "AdminService" + ] + } + }, + "/views/{database}/{view_name}": { + "post": { + "operationId": "ClearView", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "properties": {} + } + } + }, + "parameters": [ + { + "name": "database", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "view_name", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "AdminService" + ] + } } }, "definitions": { + "protobufListValue": { + "type": "object", + "properties": { + "values": { + "type": "array", + "items": { + "$ref": "#/definitions/protobufValue" + }, + "description": "Repeated field of dynamically typed values." + } + }, + "description": "`ListValue` is a wrapper around a repeated field of values.\n\nThe JSON representation for `ListValue` is JSON array." + }, "protobufNullValue": { "type": "string", "enum": [ @@ -293,6 +405,51 @@ "default": "NULL_VALUE", "description": "`NullValue` is a singleton enumeration to represent the null value for the\n`Value` type union.\n\n The JSON representation for `NullValue` is JSON `null`.\n\n - NULL_VALUE: Null value." }, + "protobufStruct": { + "type": "object", + "properties": { + "fields": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/protobufValue" + }, + "description": "Unordered map of dynamically typed values." + } + }, + "description": "`Struct` represents a structured data value, consisting of fields\nwhich map to dynamically typed values. In some languages, `Struct`\nmight be supported by a native representation. For example, in\nscripting languages like JS a struct is represented as an\nobject. The details of that representation are described together\nwith the proto support for the language.\n\nThe JSON representation for `Struct` is JSON object." + }, + "protobufValue": { + "type": "object", + "properties": { + "null_value": { + "$ref": "#/definitions/protobufNullValue", + "description": "Represents a null value." + }, + "number_value": { + "type": "number", + "format": "double", + "description": "Represents a double value." + }, + "string_value": { + "type": "string", + "description": "Represents a string value." + }, + "bool_value": { + "type": "boolean", + "format": "boolean", + "description": "Represents a boolean value." + }, + "struct_value": { + "$ref": "#/definitions/protobufStruct", + "description": "Represents a structured value." + }, + "list_value": { + "$ref": "#/definitions/protobufListValue", + "description": "Represents a repeated `Value`." + } + }, + "description": "`Value` represents a dynamically typed value which can be either\nnull, a number, a string, a boolean, a recursive struct value, or a\nlist of values. A producer of value is expected to set one of that\nvariants, absence of any variant indicates an error.\n\nThe JSON representation for `Value` is JSON value." + }, "v1CreateOrgRequest": { "type": "object", "properties": { @@ -359,6 +516,39 @@ } } }, + "v1FailedEvent": { + "type": "object", + "properties": { + "database": { + "type": "string" + }, + "view_name": { + "type": "string" + }, + "failed_sequence": { + "type": "string", + "format": "uint64" + }, + "failure_count": { + "type": "string", + "format": "uint64" + }, + "error_message": { + "type": "string" + } + } + }, + "v1FailedEvents": { + "type": "object", + "properties": { + "failed_events": { + "type": "array", + "items": { + "$ref": "#/definitions/v1FailedEvent" + } + } + } + }, "v1Gender": { "type": "string", "enum": [ @@ -647,6 +837,32 @@ "USERSTATE_INITIAL" ], "default": "USERSTATE_UNSPECIFIED" + }, + "v1View": { + "type": "object", + "properties": { + "database": { + "type": "string" + }, + "view_name": { + "type": "string" + }, + "sequence": { + "type": "string", + "format": "uint64" + } + } + }, + "v1Views": { + "type": "object", + "properties": { + "views": { + "type": "array", + "items": { + "$ref": "#/definitions/v1View" + } + } + } } } } diff --git a/pkg/admin/api/grpc/administrator.go b/pkg/admin/api/grpc/administrator.go new file mode 100644 index 0000000000..b13f9d8294 --- /dev/null +++ b/pkg/admin/api/grpc/administrator.go @@ -0,0 +1,33 @@ +package grpc + +import ( + "context" + view_model "github.com/caos/zitadel/internal/view/model" + "github.com/golang/protobuf/ptypes/empty" +) + +func (s *Server) GetViews(ctx context.Context, _ *empty.Empty) (_ *Views, err error) { + views, err := s.administrator.GetViews(ctx) + if err != nil { + return nil, err + } + return &Views{Views: viewsFromModel(views)}, nil +} + +func (s *Server) ClearView(ctx context.Context, viewID *ViewID) (_ *empty.Empty, err error) { + err = s.administrator.ClearView(ctx, viewID.Database, viewID.ViewName) + return &empty.Empty{}, err +} + +func (s *Server) GetFailedEvents(ctx context.Context, _ *empty.Empty) (_ *FailedEvents, err error) { + failedEvents, err := s.administrator.GetFailedEvents(ctx) + if err != nil { + return nil, err + } + return &FailedEvents{FailedEvents: failedEventsFromModel(failedEvents)}, nil +} + +func (s *Server) RemoveFailedEvent(ctx context.Context, failedEventID *FailedEventID) (_ *empty.Empty, err error) { + err = s.administrator.RemoveFailedEvent(ctx, &view_model.FailedEvent{Database: failedEventID.Database, ViewName: failedEventID.ViewName, FailedSequence: failedEventID.FailedSequence}) + return &empty.Empty{}, err +} diff --git a/pkg/admin/api/grpc/administrator_converter.go b/pkg/admin/api/grpc/administrator_converter.go new file mode 100644 index 0000000000..ca7a0ed2a7 --- /dev/null +++ b/pkg/admin/api/grpc/administrator_converter.go @@ -0,0 +1,41 @@ +package grpc + +import ( + view_model "github.com/caos/zitadel/internal/view/model" +) + +func viewsFromModel(views []*view_model.View) []*View { + result := make([]*View, len(views)) + for i, view := range views { + result[i] = viewFromModel(view) + } + + return result +} + +func failedEventsFromModel(failedEvents []*view_model.FailedEvent) []*FailedEvent { + result := make([]*FailedEvent, len(failedEvents)) + for i, view := range failedEvents { + result[i] = failedEventFromModel(view) + } + + return result +} + +func viewFromModel(view *view_model.View) *View { + return &View{ + Database: view.Database, + ViewName: view.ViewName, + Sequence: view.CurrentSequence, + } +} + +func failedEventFromModel(failedEvent *view_model.FailedEvent) *FailedEvent { + return &FailedEvent{ + Database: failedEvent.Database, + ViewName: failedEvent.ViewName, + FailedSequence: failedEvent.FailedSequence, + FailureCount: failedEvent.FailureCount, + ErrorMessage: failedEvent.ErrMsg, + } +} diff --git a/pkg/admin/api/grpc/mock/admin.proto.mock.go b/pkg/admin/api/grpc/mock/admin.proto.mock.go index f409cbdd5e..d3dc656fd8 100644 --- a/pkg/admin/api/grpc/mock/admin.proto.mock.go +++ b/pkg/admin/api/grpc/mock/admin.proto.mock.go @@ -37,6 +37,26 @@ func (m *MockAdminServiceClient) EXPECT() *MockAdminServiceClientMockRecorder { return m.recorder } +// ClearView mocks base method +func (m *MockAdminServiceClient) ClearView(arg0 context.Context, arg1 *grpc.ViewID, arg2 ...grpc0.CallOption) (*emptypb.Empty, error) { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ClearView", varargs...) + ret0, _ := ret[0].(*emptypb.Empty) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ClearView indicates an expected call of ClearView +func (mr *MockAdminServiceClientMockRecorder) ClearView(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1}, arg2...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClearView", reflect.TypeOf((*MockAdminServiceClient)(nil).ClearView), varargs...) +} + // CreateOrgIamPolicy mocks base method func (m *MockAdminServiceClient) CreateOrgIamPolicy(arg0 context.Context, arg1 *grpc.OrgIamPolicyRequest, arg2 ...grpc0.CallOption) (*grpc.OrgIamPolicy, error) { m.ctrl.T.Helper() @@ -77,6 +97,26 @@ func (mr *MockAdminServiceClientMockRecorder) DeleteOrgIamPolicy(arg0, arg1 inte return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteOrgIamPolicy", reflect.TypeOf((*MockAdminServiceClient)(nil).DeleteOrgIamPolicy), varargs...) } +// GetFailedEvents mocks base method +func (m *MockAdminServiceClient) GetFailedEvents(arg0 context.Context, arg1 *emptypb.Empty, arg2 ...grpc0.CallOption) (*grpc.FailedEvents, error) { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "GetFailedEvents", varargs...) + ret0, _ := ret[0].(*grpc.FailedEvents) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetFailedEvents indicates an expected call of GetFailedEvents +func (mr *MockAdminServiceClientMockRecorder) GetFailedEvents(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1}, arg2...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetFailedEvents", reflect.TypeOf((*MockAdminServiceClient)(nil).GetFailedEvents), varargs...) +} + // GetOrgByID mocks base method func (m *MockAdminServiceClient) GetOrgByID(arg0 context.Context, arg1 *grpc.OrgID, arg2 ...grpc0.CallOption) (*grpc.Org, error) { m.ctrl.T.Helper() @@ -117,6 +157,26 @@ func (mr *MockAdminServiceClientMockRecorder) GetOrgIamPolicy(arg0, arg1 interfa return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOrgIamPolicy", reflect.TypeOf((*MockAdminServiceClient)(nil).GetOrgIamPolicy), varargs...) } +// GetViews mocks base method +func (m *MockAdminServiceClient) GetViews(arg0 context.Context, arg1 *emptypb.Empty, arg2 ...grpc0.CallOption) (*grpc.Views, error) { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "GetViews", varargs...) + ret0, _ := ret[0].(*grpc.Views) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetViews indicates an expected call of GetViews +func (mr *MockAdminServiceClientMockRecorder) GetViews(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1}, arg2...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetViews", reflect.TypeOf((*MockAdminServiceClient)(nil).GetViews), varargs...) +} + // Healthz mocks base method func (m *MockAdminServiceClient) Healthz(arg0 context.Context, arg1 *emptypb.Empty, arg2 ...grpc0.CallOption) (*emptypb.Empty, error) { m.ctrl.T.Helper() @@ -177,6 +237,26 @@ func (mr *MockAdminServiceClientMockRecorder) Ready(arg0, arg1 interface{}, arg2 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Ready", reflect.TypeOf((*MockAdminServiceClient)(nil).Ready), varargs...) } +// RemoveFailedEvent mocks base method +func (m *MockAdminServiceClient) RemoveFailedEvent(arg0 context.Context, arg1 *grpc.FailedEventID, arg2 ...grpc0.CallOption) (*emptypb.Empty, error) { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "RemoveFailedEvent", varargs...) + ret0, _ := ret[0].(*emptypb.Empty) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// RemoveFailedEvent indicates an expected call of RemoveFailedEvent +func (mr *MockAdminServiceClientMockRecorder) RemoveFailedEvent(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1}, arg2...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RemoveFailedEvent", reflect.TypeOf((*MockAdminServiceClient)(nil).RemoveFailedEvent), varargs...) +} + // SearchOrgs mocks base method func (m *MockAdminServiceClient) SearchOrgs(arg0 context.Context, arg1 *grpc.OrgSearchRequest, arg2 ...grpc0.CallOption) (*grpc.OrgSearchResponse, error) { m.ctrl.T.Helper() diff --git a/pkg/admin/api/grpc/server.go b/pkg/admin/api/grpc/server.go index 7843bc1b60..702d10ee31 100644 --- a/pkg/admin/api/grpc/server.go +++ b/pkg/admin/api/grpc/server.go @@ -15,20 +15,22 @@ import ( var _ AdminServiceServer = (*Server)(nil) type Server struct { - port string - org repository.OrgRepository - verifier auth.TokenVerifier - authZ auth.Config - repo repository.Repository + port string + org repository.OrgRepository + administrator repository.AdministratorRepository + verifier auth.TokenVerifier + authZ auth.Config + repo repository.Repository } func StartServer(conf grpc_util.ServerConfig, authZRepo *authz_repo.EsRepository, authZ auth.Config, repo repository.Repository) *Server { return &Server{ - port: conf.Port, - org: repo, - repo: repo, - authZ: authZ, - verifier: admin_auth.Start(authZRepo), + port: conf.Port, + org: repo, + administrator: repo, + repo: repo, + authZ: authZ, + verifier: admin_auth.Start(authZRepo), } } diff --git a/pkg/admin/api/proto/admin.proto b/pkg/admin/api/proto/admin.proto index 1bb794da72..a3b128e1a3 100644 --- a/pkg/admin/api/proto/admin.proto +++ b/pkg/admin/api/proto/admin.proto @@ -141,6 +141,46 @@ service AdminService { permission: "iam.policy.delete" }; } + + rpc GetViews(google.protobuf.Empty) returns (Views) { + option (google.api.http) = { + get: "/views" + }; + + option (caos.zitadel.utils.v1.auth_option) = { + permission: "iam.read" + }; + } + + rpc ClearView(ViewID) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/views/{database}/{view_name}" + }; + + option (caos.zitadel.utils.v1.auth_option) = { + permission: "iam.write" + }; + } + + rpc GetFailedEvents(google.protobuf.Empty) returns (FailedEvents) { + option (google.api.http) = { + get: "/failedevents" + }; + + option (caos.zitadel.utils.v1.auth_option) = { + permission: "iam.read" + }; + } + + rpc RemoveFailedEvent(FailedEventID) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/failedevents/{database}/{view_name}/{failed_sequence}" + }; + + option (caos.zitadel.utils.v1.auth_option) = { + permission: "iam.write" + }; + } } message OrgID { @@ -298,4 +338,39 @@ message OrgIamPolicyRequest { message OrgIamPolicyID { string org_id = 1; -} \ No newline at end of file +} + +message FailedEventID { + string database = 1; + string view_name = 2; + uint64 failed_sequence = 3; +} + +message FailedEvents { + repeated FailedEvent failed_events = 1; +} + +message FailedEvent { + string database = 1; + string view_name = 2; + uint64 failed_sequence = 3; + uint64 failure_count = 4; + string error_message = 5; +} + +message ViewID { + string database = 1; + string view_name = 2; +} + +message Views { + repeated View views = 1; +} + +message View { + string database = 1; + string view_name = 2; + uint64 sequence = 3; +} + +