diff --git a/.github/workflows/frontend-tests.yml b/.github/workflows/frontend-tests.yml index af4f5dcb8c3ed..0c0923a12ac73 100644 --- a/.github/workflows/frontend-tests.yml +++ b/.github/workflows/frontend-tests.yml @@ -11,7 +11,7 @@ on: - "web/**" jobs: - eslint-checks: + static-checks: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -28,6 +28,9 @@ jobs: - name: Run eslint check run: pnpm lint working-directory: web + - name: Run type checks + run: pnpm type-check + working-directory: web frontend-build: runs-on: ubuntu-latest diff --git a/bin/memos/main.go b/bin/memos/main.go index 9669d8188f661..c28d1aeedca02 100644 --- a/bin/memos/main.go +++ b/bin/memos/main.go @@ -14,7 +14,7 @@ import ( "github.com/usememos/memos/internal/jobs" "github.com/usememos/memos/server" - _profile "github.com/usememos/memos/server/profile" + "github.com/usememos/memos/server/profile" "github.com/usememos/memos/store" "github.com/usememos/memos/store/db" ) @@ -31,21 +31,22 @@ const ( ) var ( - profile *_profile.Profile - mode string - addr string - port int - data string - driver string - dsn string - serveFrontend bool + mode string + addr string + port int + data string + driver string + dsn string + serveFrontend bool + allowedOrigins []string + instanceProfile *profile.Profile rootCmd = &cobra.Command{ Use: "memos", - Short: `An open-source, self-hosted memo hub with knowledge management and social networking.`, + Short: `An open source, lightweight note-taking service. Easily capture and share your great thoughts.`, Run: func(_cmd *cobra.Command, _args []string) { ctx, cancel := context.WithCancel(context.Background()) - dbDriver, err := db.NewDBDriver(profile) + dbDriver, err := db.NewDBDriver(instanceProfile) if err != nil { cancel() slog.Error("failed to create db driver", err) @@ -57,14 +58,14 @@ var ( return } - storeInstance := store.New(dbDriver, profile) + storeInstance := store.New(dbDriver, instanceProfile) if err := storeInstance.MigrateManually(ctx); err != nil { cancel() slog.Error("failed to migrate manually", err) return } - s, err := server.NewServer(ctx, profile, storeInstance) + s, err := server.NewServer(ctx, instanceProfile, storeInstance) if err != nil { cancel() slog.Error("failed to create server", err) @@ -114,6 +115,7 @@ func init() { rootCmd.PersistentFlags().StringVarP(&driver, "driver", "", "", "database driver") rootCmd.PersistentFlags().StringVarP(&dsn, "dsn", "", "", "database source name(aka. DSN)") rootCmd.PersistentFlags().BoolVarP(&serveFrontend, "frontend", "", true, "serve frontend files") + rootCmd.PersistentFlags().StringArrayVarP(&allowedOrigins, "origins", "", []string{}, "CORS allowed domain origins") err := viper.BindPFlag("mode", rootCmd.PersistentFlags().Lookup("mode")) if err != nil { @@ -143,19 +145,24 @@ func init() { if err != nil { panic(err) } + err = viper.BindPFlag("origins", rootCmd.PersistentFlags().Lookup("origins")) + if err != nil { + panic(err) + } viper.SetDefault("mode", "demo") viper.SetDefault("driver", "sqlite") viper.SetDefault("addr", "") viper.SetDefault("port", 8081) viper.SetDefault("frontend", true) + viper.SetDefault("origins", []string{}) viper.SetEnvPrefix("memos") } func initConfig() { viper.AutomaticEnv() var err error - profile, err = _profile.GetProfile() + instanceProfile, err = profile.GetProfile() if err != nil { fmt.Printf("failed to get profile, error: %+v\n", err) return @@ -172,15 +179,15 @@ mode: %s driver: %s frontend: %t --- -`, profile.Version, profile.Data, profile.DSN, profile.Addr, profile.Port, profile.Mode, profile.Driver, profile.Frontend) +`, instanceProfile.Version, instanceProfile.Data, instanceProfile.DSN, instanceProfile.Addr, instanceProfile.Port, instanceProfile.Mode, instanceProfile.Driver, instanceProfile.Frontend) } func printGreetings() { print(greetingBanner) - if len(profile.Addr) == 0 { - fmt.Printf("Version %s has been started on port %d\n", profile.Version, profile.Port) + if len(instanceProfile.Addr) == 0 { + fmt.Printf("Version %s has been started on port %d\n", instanceProfile.Version, instanceProfile.Port) } else { - fmt.Printf("Version %s has been started on address '%s' and port %d\n", profile.Version, profile.Addr, profile.Port) + fmt.Printf("Version %s has been started on address '%s' and port %d\n", instanceProfile.Version, instanceProfile.Addr, instanceProfile.Port) } fmt.Printf(`--- See more in: diff --git a/go.mod b/go.mod index a0eb3ba590952..1087c098f6b7d 100644 --- a/go.mod +++ b/go.mod @@ -22,7 +22,6 @@ require ( github.com/labstack/echo/v4 v4.11.4 github.com/lib/pq v1.10.9 github.com/lithammer/shortuuid/v4 v4.0.0 - github.com/microcosm-cc/bluemonday v1.0.26 github.com/pkg/errors v0.9.1 github.com/spf13/cobra v1.8.0 github.com/spf13/viper v1.18.2 @@ -30,7 +29,6 @@ require ( github.com/swaggo/swag v1.16.3 github.com/yourselfhosted/gomark v0.0.0-20240228170507-6a73bfad2eb6 golang.org/x/crypto v0.19.0 - golang.org/x/exp v0.0.0-20240213143201-ec583247a57a golang.org/x/mod v0.15.0 golang.org/x/net v0.21.0 golang.org/x/oauth2 v0.17.0 @@ -42,21 +40,19 @@ require ( require ( github.com/KyleBanks/depth v1.2.1 // indirect github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df // indirect - github.com/aymerick/douceur v0.2.0 // indirect github.com/cenkalti/backoff/v4 v4.2.1 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dustin/go-humanize v1.0.1 // indirect - github.com/go-openapi/jsonpointer v0.20.0 // indirect - github.com/go-openapi/jsonreference v0.20.2 // indirect - github.com/go-openapi/spec v0.20.9 // indirect - github.com/go-openapi/swag v0.22.4 // indirect + github.com/go-openapi/jsonpointer v0.20.2 // indirect + github.com/go-openapi/jsonreference v0.20.4 // indirect + github.com/go-openapi/spec v0.20.14 // indirect + github.com/go-openapi/swag v0.22.9 // indirect github.com/go-zoox/chalk v1.0.2 // indirect github.com/go-zoox/connect v1.12.0 // indirect github.com/go-zoox/core-utils v1.4.5 // indirect github.com/go-zoox/crypto v1.1.8 // indirect github.com/go-zoox/datetime v1.3.1 // indirect github.com/go-zoox/jwt v1.3.0 // indirect - github.com/gorilla/css v1.0.0 // indirect github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/mailru/easyjson v0.7.7 // indirect @@ -67,6 +63,7 @@ require ( github.com/sagikazarmark/slog-shim v0.1.0 // indirect github.com/sourcegraph/conc v0.3.0 // indirect github.com/stoewer/go-strcase v1.3.0 // indirect + golang.org/x/exp v0.0.0-20240213143201-ec583247a57a // indirect golang.org/x/image v0.15.0 // indirect golang.org/x/tools v0.18.0 // indirect google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect diff --git a/go.sum b/go.sum index 736980018e585..fc71d656275bb 100644 --- a/go.sum +++ b/go.sum @@ -64,8 +64,6 @@ github.com/aws/aws-sdk-go-v2/service/sts v1.27.0 h1:cjTRjh700H36MQ8M0LnDn33W3Jmw github.com/aws/aws-sdk-go-v2/service/sts v1.27.0/go.mod h1:nXfOBMWPokIbOY+Gi7a1psWMSvskUCemZzI+SMB7Akc= github.com/aws/smithy-go v1.20.0 h1:6+kZsCXZwKxZS9RfISnPc4EXlHoyAkm2hPuM8X2BrrQ= github.com/aws/smithy-go v1.20.0/go.mod h1:uo5RKksAl4PzhqaAbjd4rLgFoq5koTsQKYuGe7dklGc= -github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk= -github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= @@ -88,7 +86,6 @@ github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfc github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= @@ -128,21 +125,14 @@ github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgO github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= -github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= -github.com/go-openapi/jsonpointer v0.20.0 h1:ESKJdU9ASRfaPNOPRx12IUyA1vn3R9GiE3KYD14BXdQ= -github.com/go-openapi/jsonpointer v0.20.0/go.mod h1:6PGzBjjIIumbLYysB73Klnms1mwnU4G3YHOECG3CedA= -github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo= -github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= -github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= -github.com/go-openapi/spec v0.20.9 h1:xnlYNQAwKd2VQRRfwTEI0DcK+2cbuvI/0c7jx3gA8/8= -github.com/go-openapi/spec v0.20.9/go.mod h1:2OpW+JddWPrpXSCIX8eOx7lZ5iyuWj3RYR6VaaBKcWA= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= -github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= -github.com/go-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogBU= -github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= +github.com/go-openapi/jsonpointer v0.20.2 h1:mQc3nmndL8ZBzStEo3JYF8wzmeWffDH4VbXz58sAx6Q= +github.com/go-openapi/jsonpointer v0.20.2/go.mod h1:bHen+N0u1KEO3YlmqOjTT9Adn1RfD91Ar825/PuiRVs= +github.com/go-openapi/jsonreference v0.20.4 h1:bKlDxQxQJgwpUSgOENiMPzCTBVuc7vTdXSSgNeAhojU= +github.com/go-openapi/jsonreference v0.20.4/go.mod h1:5pZJyJP2MnYCpoeoMAql78cCHauHj0V9Lhc506VOpw4= +github.com/go-openapi/spec v0.20.14 h1:7CBlRnw+mtjFGlPDRZmAMnq35cRzI91xj03HVyUi/Do= +github.com/go-openapi/spec v0.20.14/go.mod h1:8EOhTpBoFiask8rrgwbLC3zmJfz4zsCUueRuPM6GNkw= +github.com/go-openapi/swag v0.22.9 h1:XX2DssF+mQKM2DHsbgZK74y/zj4mo9I99+89xUmuZCE= +github.com/go-openapi/swag v0.22.9/go.mod h1:3/OXnFfnMAwBD099SwYRk7GD3xOrr1iL7d/XNLXVVwE= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= @@ -228,8 +218,6 @@ github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= -github.com/gorilla/css v1.0.0 h1:BQqNyPTi50JCFMTw/b67hByjMVXZRwGha6wxVGkeihY= -github.com/gorilla/css v1.0.0/go.mod h1:Dn721qIggHpt4+EFCcTLTU/vk5ySda2ReITrtgBl60c= github.com/gorilla/feeds v1.1.1 h1:HwKXxqzcRNg9to+BbvJog4+f3s/xzvtZXICcQGutYfY= github.com/gorilla/feeds v1.1.1/go.mod h1:Nk0jZrvPFZX1OBe5NPiddPw7CfwF6Q9eqzaBbaightA= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= @@ -301,7 +289,6 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxv github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= @@ -322,9 +309,6 @@ github.com/lithammer/shortuuid/v4 v4.0.0/go.mod h1:Zs8puNcrvf2rV9rTH51ZLLcj7ZXqQ github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= @@ -340,8 +324,6 @@ github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzp github.com/mattn/go-sqlite3 v1.14.16 h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwpU1Y= github.com/mattn/go-sqlite3 v1.14.16/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/microcosm-cc/bluemonday v1.0.26 h1:xbqSvqzQMeEHCqMi64VAs4d8uy6Mequs3rQ0k/Khz58= -github.com/microcosm-cc/bluemonday v1.0.26/go.mod h1:JyzOCs9gkyQyjs+6h10UEVSe02CGwkhd72Xdqh78TWs= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= @@ -369,7 +351,6 @@ github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxzi github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/ncruces/go-strftime v0.1.9 h1:bY0MQC28UADQmHmaF5dgpLmImcShSi2kHU9XLdhx/f4= github.com/ncruces/go-strftime v0.1.9/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= @@ -429,8 +410,8 @@ github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94 github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= -github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= +github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= +github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.10.1 h1:L0uuZVXIKlI1SShY2nhFfo44TYvDPQ1w4oFkUJNfhyo= github.com/rs/cors v1.10.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= @@ -478,7 +459,6 @@ github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpE github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= @@ -708,7 +688,6 @@ gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLks gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= @@ -730,7 +709,6 @@ gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/internal/util/resource_name.go b/internal/util/resource_name.go index 6fc10c6660f35..f7a1124a9e708 100644 --- a/internal/util/resource_name.go +++ b/internal/util/resource_name.go @@ -3,5 +3,5 @@ package util import "regexp" var ( - ResourceNameMatcher = regexp.MustCompile("^[a-zA-Z0-9]([a-zA-Z0-9-]{1,30}[a-zA-Z0-9])$") + UIDMatcher = regexp.MustCompile("^[a-zA-Z0-9]([a-zA-Z0-9-]{1,30}[a-zA-Z0-9])$") ) diff --git a/plugin/http-getter/image.go b/plugin/http-getter/image.go index cabc0be3a1fd5..0567830698af9 100644 --- a/plugin/http-getter/image.go +++ b/plugin/http-getter/image.go @@ -6,8 +6,6 @@ import ( "net/http" "net/url" "strings" - - "github.com/microcosm-cc/bluemonday" ) type Image struct { @@ -39,21 +37,9 @@ func GetImage(urlStr string) (*Image, error) { return nil, err } - bodyBytes, err = SanitizeContent(bodyBytes) - if err != nil { - return nil, err - } - image := &Image{ Blob: bodyBytes, Mediatype: mediatype, } return image, nil } - -func SanitizeContent(content []byte) ([]byte, error) { - bodyString := string(content) - - bm := bluemonday.UGCPolicy() - return []byte(bm.Sanitize(bodyString)), nil -} diff --git a/plugin/webhook/webhook.go b/plugin/webhook/webhook.go index aadc5344df2bf..113fabd84e796 100644 --- a/plugin/webhook/webhook.go +++ b/plugin/webhook/webhook.go @@ -30,7 +30,8 @@ type Memo struct { } type Resource struct { - ID int32 `json:"id"` + ID int32 `json:"id"` + UID string `json:"uid"` // Standard fields CreatorID int32 `json:"creatorId"` diff --git a/proto/api/v2/idp_service.proto b/proto/api/v2/idp_service.proto new file mode 100644 index 0000000000000..db2ded42ce616 --- /dev/null +++ b/proto/api/v2/idp_service.proto @@ -0,0 +1,124 @@ +syntax = "proto3"; + +package memos.api.v2; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/protobuf/field_mask.proto"; + +option go_package = "gen/api/v2"; + +service IdentityProviderService { + rpc ListIdentityProviders(ListIdentityProvidersRequest) returns (ListIdentityProvidersResponse) { + option (google.api.http) = {get: "/api/v2/identityProviders"}; + } + rpc GetIdentityProvider(GetIdentityProviderRequest) returns (GetIdentityProviderResponse) { + option (google.api.http) = {get: "/api/v2/{name=identityProviders/*}"}; + option (google.api.method_signature) = "name"; + } + rpc CreateIdentityProvider(CreateIdentityProviderRequest) returns (CreateIdentityProviderResponse) { + option (google.api.http) = {post: "/api/v2/identityProviders"}; + } + // UpdateIdentityProvider updates an identity provider. + rpc UpdateIdentityProvider(UpdateIdentityProviderRequest) returns (UpdateIdentityProviderResponse) { + option (google.api.http) = { + patch: "/api/v2/{identity_provider.name=identityProviders/*}" + body: "identity_provider" + }; + option (google.api.method_signature) = "identity_provider,update_mask"; + } + // DeleteIdentityProvider deletes an identity provider. + rpc DeleteIdentityProvider(DeleteIdentityProviderRequest) returns (DeleteIdentityProviderResponse) { + option (google.api.http) = {delete: "/api/v2/{name=identityProviders/*}"}; + option (google.api.method_signature) = "name"; + } +} + +message IdentityProvider { + // The name of the identityProvider. + // Format: identityProviders/{id} + string name = 1; + + enum Type { + TYPE_UNSPECIFIED = 0; + OAUTH2 = 1; + } + Type type = 2; + + string title = 3; + + string identifier_filter = 4; + + message Config { + message FieldMapping { + string identifier = 1; + string display_name = 2; + string email = 3; + } + + message OAuth2 { + string client_id = 1; + string client_secret = 2; + string auth_url = 3; + string token_url = 4; + string user_info_url = 5; + repeated string scopes = 6; + FieldMapping field_mapping = 7; + } + + oneof config { + OAuth2 oauth2 = 1; + } + } + + Config config = 5; +} + +message ListIdentityProvidersRequest {} + +message ListIdentityProvidersResponse { + repeated IdentityProvider identity_providers = 1; +} + +message GetIdentityProviderRequest { + // The name of the identityProvider to get. + // Format: identityProviders/{id} + string name = 1; +} + +message GetIdentityProviderResponse { + // The identityProvider. + IdentityProvider identity_provider = 1; +} + +message CreateIdentityProviderRequest { + // The identityProvider to create. + IdentityProvider identity_provider = 1; +} + +message CreateIdentityProviderResponse { + // The created identityProvider. + IdentityProvider identity_provider = 1; +} + +message UpdateIdentityProviderRequest { + // The identityProvider to update. + IdentityProvider identity_provider = 1; + + // The update mask applies to the resource. Only the top level fields of + // IdentityProvider are supported. + google.protobuf.FieldMask update_mask = 2; +} + +message UpdateIdentityProviderResponse { + // The updated identityProvider. + IdentityProvider identity_provider = 1; +} + +message DeleteIdentityProviderRequest { + // The name of the identityProvider to delete. + // Format: identityProviders/{id} + string name = 1; +} + +message DeleteIdentityProviderResponse {} diff --git a/proto/api/v2/inbox_service.proto b/proto/api/v2/inbox_service.proto index bb937ca10d195..50d13b42ebc1c 100644 --- a/proto/api/v2/inbox_service.proto +++ b/proto/api/v2/inbox_service.proto @@ -31,11 +31,11 @@ service InboxService { message Inbox { // The name of the inbox. - // Format: inboxes/{uid} + // Format: inboxes/{id} string name = 1; - // Format: users/{username} + // Format: users/{id} string sender = 2; - // Format: users/{username} + // Format: users/{id} string receiver = 3; enum Status { @@ -58,7 +58,7 @@ message Inbox { } message ListInboxesRequest { - // Format: users/{username} + // Format: users/{id} string user = 1; } @@ -78,7 +78,7 @@ message UpdateInboxResponse { message DeleteInboxRequest { // The name of the inbox to delete. - // Format: inboxes/{uid} + // Format: inboxes/{id} string name = 1; } diff --git a/proto/api/v2/link_service.proto b/proto/api/v2/link_service.proto index 47b80a8234ba6..d3373098e1d03 100644 --- a/proto/api/v2/link_service.proto +++ b/proto/api/v2/link_service.proto @@ -8,20 +8,20 @@ option go_package = "gen/api/v2"; service LinkService { rpc GetLinkMetadata(GetLinkMetadataRequest) returns (GetLinkMetadataResponse) { - option (google.api.http) = {get: "/api/v2/metadata"}; + option (google.api.http) = {get: "/api/v2/link_metadata"}; } } -message LinkMetadata { - string title = 1; - string description = 2; - string image = 3; -} - message GetLinkMetadataRequest { string link = 1; } message GetLinkMetadataResponse { - LinkMetadata metadata = 1; + LinkMetadata link_metadata = 1; +} + +message LinkMetadata { + string title = 1; + string description = 2; + string image = 3; } diff --git a/proto/api/v2/memo_relation_service.proto b/proto/api/v2/memo_relation_service.proto index 8bd9175742c82..c8387e3b30165 100644 --- a/proto/api/v2/memo_relation_service.proto +++ b/proto/api/v2/memo_relation_service.proto @@ -5,8 +5,13 @@ package memos.api.v2; option go_package = "gen/api/v2"; message MemoRelation { - int32 memo_id = 1; - int32 related_memo_id = 2; + // The name of memo. + // Format: "memos/{uid}" + string memo = 1; + + // The name of related memo. + // Format: "memos/{uid}" + string related_memo = 2; enum Type { TYPE_UNSPECIFIED = 0; diff --git a/proto/api/v2/memo_service.proto b/proto/api/v2/memo_service.proto index 4ec5dad5fadb9..7fd7ad2a0357c 100644 --- a/proto/api/v2/memo_service.proto +++ b/proto/api/v2/memo_service.proto @@ -26,28 +26,27 @@ service MemoService { rpc ListMemos(ListMemosRequest) returns (ListMemosResponse) { option (google.api.http) = {get: "/api/v2/memos"}; } - // GetMemo gets a memo by id. - rpc GetMemo(GetMemoRequest) returns (GetMemoResponse) { - option (google.api.http) = {get: "/api/v2/memos/{id}"}; - option (google.api.method_signature) = "id"; + // SearchMemos searches memos. + rpc SearchMemos(SearchMemosRequest) returns (SearchMemosResponse) { + option (google.api.http) = {get: "/api/v2/memos:search"}; } - // GetMemoByName gets a memo by name. - rpc GetMemoByName(GetMemoByNameRequest) returns (GetMemoByNameResponse) { - option (google.api.http) = {get: "/api/v2/memos/name/{name}"}; + // GetMemo gets a memo. + rpc GetMemo(GetMemoRequest) returns (GetMemoResponse) { + option (google.api.http) = {get: "/api/v2/{name=memos/*}"}; option (google.api.method_signature) = "name"; } // UpdateMemo updates a memo. rpc UpdateMemo(UpdateMemoRequest) returns (UpdateMemoResponse) { option (google.api.http) = { - patch: "/api/v2/memos/{memo.id}" + patch: "/api/v2/{memo.name=memos/*}" body: "memo" }; option (google.api.method_signature) = "memo,update_mask"; } - // DeleteMemo deletes a memo by id. + // DeleteMemo deletes a memo. rpc DeleteMemo(DeleteMemoRequest) returns (DeleteMemoResponse) { - option (google.api.http) = {delete: "/api/v2/memos/{id}"}; - option (google.api.method_signature) = "id"; + option (google.api.http) = {delete: "/api/v2/{name=memos/*}"}; + option (google.api.method_signature) = "name"; } // ExportMemos exports memos. rpc ExportMemos(ExportMemosRequest) returns (ExportMemosResponse) { @@ -56,38 +55,38 @@ service MemoService { // SetMemoResources sets resources for a memo. rpc SetMemoResources(SetMemoResourcesRequest) returns (SetMemoResourcesResponse) { option (google.api.http) = { - post: "/api/v2/memos/{id}/resources" + post: "/api/v2/{name=memos/*}/resources" body: "*" }; - option (google.api.method_signature) = "id"; + option (google.api.method_signature) = "name"; } // ListMemoResources lists resources for a memo. rpc ListMemoResources(ListMemoResourcesRequest) returns (ListMemoResourcesResponse) { - option (google.api.http) = {get: "/api/v2/memos/{id}/resources"}; - option (google.api.method_signature) = "id"; + option (google.api.http) = {get: "/api/v2/{name=memos/*}/resources"}; + option (google.api.method_signature) = "name"; } // SetMemoRelations sets relations for a memo. rpc SetMemoRelations(SetMemoRelationsRequest) returns (SetMemoRelationsResponse) { option (google.api.http) = { - post: "/api/v2/memos/{id}/relations" + post: "/api/v2/{name=memos/*}/relations" body: "*" }; - option (google.api.method_signature) = "id"; + option (google.api.method_signature) = "name"; } // ListMemoRelations lists relations for a memo. rpc ListMemoRelations(ListMemoRelationsRequest) returns (ListMemoRelationsResponse) { - option (google.api.http) = {get: "/api/v2/memos/{id}/relations"}; - option (google.api.method_signature) = "id"; + option (google.api.http) = {get: "/api/v2/{name=memos/*}/relations"}; + option (google.api.method_signature) = "name"; } // CreateMemoComment creates a comment for a memo. rpc CreateMemoComment(CreateMemoCommentRequest) returns (CreateMemoCommentResponse) { - option (google.api.http) = {post: "/api/v2/memos/{id}/comments"}; - option (google.api.method_signature) = "id"; + option (google.api.http) = {post: "/api/v2/{name=memos/*}/comments"}; + option (google.api.method_signature) = "name"; } // ListMemoComments lists comments for a memo. rpc ListMemoComments(ListMemoCommentsRequest) returns (ListMemoCommentsResponse) { - option (google.api.http) = {get: "/api/v2/memos/{id}/comments"}; - option (google.api.method_signature) = "id"; + option (google.api.http) = {get: "/api/v2/{name=memos/*}/comments"}; + option (google.api.method_signature) = "name"; } // GetUserMemosStats gets stats of memos for a user. rpc GetUserMemosStats(GetUserMemosStatsRequest) returns (GetUserMemosStatsResponse) { @@ -96,18 +95,18 @@ service MemoService { } // ListMemoReactions lists reactions for a memo. rpc ListMemoReactions(ListMemoReactionsRequest) returns (ListMemoReactionsResponse) { - option (google.api.http) = {get: "/api/v2/memos/{id}/reactions"}; - option (google.api.method_signature) = "id"; + option (google.api.http) = {get: "/api/v2/{name=memos/*}/reactions"}; + option (google.api.method_signature) = "name"; } // UpsertMemoReaction upserts a reaction for a memo. rpc UpsertMemoReaction(UpsertMemoReactionRequest) returns (UpsertMemoReactionResponse) { - option (google.api.http) = {post: "/api/v2/memos/{id}/reactions"}; - option (google.api.method_signature) = "id"; + option (google.api.http) = {post: "/api/v2/{name=memos/*}/reactions"}; + option (google.api.method_signature) = "name"; } // DeleteMemoReaction deletes a reaction for a memo. rpc DeleteMemoReaction(DeleteMemoReactionRequest) returns (DeleteMemoReactionResponse) { - option (google.api.http) = {delete: "/api/v2/memos/{id}/reactions/{reaction_id}"}; - option (google.api.method_signature) = "id,reaction_id"; + option (google.api.http) = {delete: "/api/v2/reactions/{reaction_id}"}; + option (google.api.method_signature) = "reaction_id"; } } @@ -122,39 +121,39 @@ enum Visibility { } message Memo { - // id is the system generated unique identifier. - int32 id = 1; + // The name of the memo. + // Format: memos/{id} + // id is the system generated id. + string name = 1; - // name is the user provided name. - string name = 2; + // The user defined id of the memo. + string uid = 2; RowStatus row_status = 3; // The name of the creator. - // Format: users/{username} + // Format: users/{id} string creator = 4; - int32 creator_id = 5; + google.protobuf.Timestamp create_time = 5; - google.protobuf.Timestamp create_time = 6; + google.protobuf.Timestamp update_time = 6; - google.protobuf.Timestamp update_time = 7; + google.protobuf.Timestamp display_time = 78; - google.protobuf.Timestamp display_time = 8; + string content = 8; - string content = 9; + Visibility visibility = 9; - Visibility visibility = 10; + bool pinned = 10; - bool pinned = 11; + optional int32 parent_id = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; - optional int32 parent_id = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + repeated Resource resources = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; - repeated Resource resources = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + repeated MemoRelation relations = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; - repeated MemoRelation relations = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; - - repeated Reaction reactions = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + repeated Reaction reactions = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; } message CreateMemoRequest { @@ -176,7 +175,7 @@ message ListMemosRequest { string page_token = 2; // Filter is used to filter memos returned in the list. - // Format: "creator == users/{username} && visibilities == ['PUBLIC', 'PROTECTED']" + // Format: "creator == users/{uid} && visibilities == ['PUBLIC', 'PROTECTED']" string filter = 3; } @@ -188,19 +187,23 @@ message ListMemosResponse { string next_page_token = 2; } -message GetMemoRequest { - int32 id = 1; +message SearchMemosRequest { + // Filter is used to filter memos returned. + // Format: "creator == users/{uid} && visibilities == ['PUBLIC', 'PROTECTED']" + string filter = 1; } -message GetMemoResponse { - Memo memo = 1; +message SearchMemosResponse { + repeated Memo memos = 1; } -message GetMemoByNameRequest { +message GetMemoRequest { + // The name of the memo. + // Format: memos/{id} string name = 1; } -message GetMemoByNameResponse { +message GetMemoResponse { Memo memo = 1; } @@ -215,7 +218,9 @@ message UpdateMemoResponse { } message DeleteMemoRequest { - int32 id = 1; + // The name of the memo. + // Format: memos/{id} + string name = 1; } message DeleteMemoResponse {} @@ -230,7 +235,9 @@ message ExportMemosResponse { } message SetMemoResourcesRequest { - int32 id = 1; + // The name of the memo. + // Format: memos/{id} + string name = 1; repeated Resource resources = 2; } @@ -238,7 +245,9 @@ message SetMemoResourcesRequest { message SetMemoResourcesResponse {} message ListMemoResourcesRequest { - int32 id = 1; + // The name of the memo. + // Format: memos/{id} + string name = 1; } message ListMemoResourcesResponse { @@ -246,7 +255,9 @@ message ListMemoResourcesResponse { } message SetMemoRelationsRequest { - int32 id = 1; + // The name of the memo. + // Format: memos/{id} + string name = 1; repeated MemoRelation relations = 2; } @@ -254,7 +265,9 @@ message SetMemoRelationsRequest { message SetMemoRelationsResponse {} message ListMemoRelationsRequest { - int32 id = 1; + // The name of the memo. + // Format: memos/{id} + string name = 1; } message ListMemoRelationsResponse { @@ -262,10 +275,11 @@ message ListMemoRelationsResponse { } message CreateMemoCommentRequest { - // id is the memo id to create comment for. - int32 id = 1; + // The name of the memo. + // Format: memos/{id} + string name = 1; - CreateMemoRequest create = 2; + CreateMemoRequest comment = 2; } message CreateMemoCommentResponse { @@ -273,7 +287,9 @@ message CreateMemoCommentResponse { } message ListMemoCommentsRequest { - int32 id = 1; + // The name of the memo. + // Format: memos/{id} + string name = 1; } message ListMemoCommentsResponse { @@ -282,7 +298,7 @@ message ListMemoCommentsResponse { message GetUserMemosStatsRequest { // name is the name of the user to get stats for. - // Format: users/{username} + // Format: users/{id} string name = 1; // timezone location @@ -301,7 +317,9 @@ message GetUserMemosStatsResponse { } message ListMemoReactionsRequest { - int32 id = 1; + // The name of the memo. + // Format: memos/{id} + string name = 1; } message ListMemoReactionsResponse { @@ -309,7 +327,9 @@ message ListMemoReactionsResponse { } message UpsertMemoReactionRequest { - int32 id = 1; + // The name of the memo. + // Format: memos/{id} + string name = 1; Reaction reaction = 2; } @@ -319,9 +339,7 @@ message UpsertMemoReactionResponse { } message DeleteMemoReactionRequest { - int32 id = 1; - - int32 reaction_id = 2; + int32 reaction_id = 1; } message DeleteMemoReactionResponse {} diff --git a/proto/api/v2/reaction_service.proto b/proto/api/v2/reaction_service.proto index 0ca68382bd3ef..c1c7159f63dd4 100644 --- a/proto/api/v2/reaction_service.proto +++ b/proto/api/v2/reaction_service.proto @@ -7,6 +7,8 @@ option go_package = "gen/api/v2"; message Reaction { int32 id = 1; + // The name of the creator. + // Format: users/{id} string creator = 2; string content_id = 3; diff --git a/proto/api/v2/resource_service.proto b/proto/api/v2/resource_service.proto index 79198c8575829..4a12d8bb2ad3f 100644 --- a/proto/api/v2/resource_service.proto +++ b/proto/api/v2/resource_service.proto @@ -18,37 +18,38 @@ service ResourceService { rpc ListResources(ListResourcesRequest) returns (ListResourcesResponse) { option (google.api.http) = {get: "/api/v2/resources"}; } - // GetResource returns a resource by id. - rpc GetResource(GetResourceRequest) returns (GetResourceResponse) { - option (google.api.http) = {get: "/api/v2/resources/{id}"}; - option (google.api.method_signature) = "id"; + // SearchResources searches memos. + rpc SearchResources(SearchResourcesRequest) returns (SearchResourcesResponse) { + option (google.api.http) = {get: "/api/v2/resources:search"}; } - // GetResourceByName returns a resource by name. - rpc GetResourceByName(GetResourceByNameRequest) returns (GetResourceByNameResponse) { - option (google.api.http) = {get: "/api/v2/resources/name/{name}"}; + // GetResource returns a resource by name. + rpc GetResource(GetResourceRequest) returns (GetResourceResponse) { + option (google.api.http) = {get: "/api/v2/{name=resources/*}"}; option (google.api.method_signature) = "name"; } // UpdateResource updates a resource. rpc UpdateResource(UpdateResourceRequest) returns (UpdateResourceResponse) { option (google.api.http) = { - patch: "/api/v2/resources/{resource.id}", + patch: "/api/v2/{resource.name=resources/*}", body: "resource" }; option (google.api.method_signature) = "resource,update_mask"; } - // DeleteResource deletes a resource by id. + // DeleteResource deletes a resource by name. rpc DeleteResource(DeleteResourceRequest) returns (DeleteResourceResponse) { - option (google.api.http) = {delete: "/api/v2/resources/{id}"}; - option (google.api.method_signature) = "id"; + option (google.api.http) = {delete: "/api/v2/{name=resources/*}"}; + option (google.api.method_signature) = "name"; } } message Resource { + // The name of the resource. + // Format: resources/{id} // id is the system generated unique identifier. - int32 id = 1; + string name = 1; - // name is the user provided name. - string name = 2; + // The user defined id of the resource. + string uid = 2; google.protobuf.Timestamp create_time = 3; @@ -60,14 +61,19 @@ message Resource { int64 size = 7; - optional int32 memo_id = 8; + // Format: memos/{id} + optional string memo = 8; } message CreateResourceRequest { string filename = 1; + string external_link = 2; + string type = 3; - optional int32 memo_id = 4; + + // Format: memos/{id} + optional string memo = 4; } message CreateResourceResponse { @@ -80,19 +86,19 @@ message ListResourcesResponse { repeated Resource resources = 1; } -message GetResourceRequest { - int32 id = 1; +message SearchResourcesRequest { + string filter = 1; } -message GetResourceResponse { - Resource resource = 1; +message SearchResourcesResponse { + repeated Resource resources = 1; } -message GetResourceByNameRequest { +message GetResourceRequest { string name = 1; } -message GetResourceByNameResponse { +message GetResourceResponse { Resource resource = 1; } @@ -107,7 +113,7 @@ message UpdateResourceResponse { } message DeleteResourceRequest { - int32 id = 1; + string name = 1; } message DeleteResourceResponse {} diff --git a/proto/api/v2/tag_service.proto b/proto/api/v2/tag_service.proto index 5646bcf656f02..a50cf4d083238 100644 --- a/proto/api/v2/tag_service.proto +++ b/proto/api/v2/tag_service.proto @@ -37,7 +37,7 @@ service TagService { message Tag { string name = 1; // The creator of tags. - // Format: users/{username} + // Format: users/{id} string creator = 2; } @@ -57,7 +57,7 @@ message BatchUpsertTagResponse {} message ListTagsRequest { // The creator of tags. - // Format: users/{username} + // Format: users/{id} string user = 1; } @@ -67,7 +67,7 @@ message ListTagsResponse { message RenameTagRequest { // The creator of tags. - // Format: users/{username} + // Format: users/{id} string user = 1; string old_name = 2; string new_name = 3; @@ -85,7 +85,7 @@ message DeleteTagResponse {} message GetTagSuggestionsRequest { // The creator of tags. - // Format: users/{username} + // Format: users/{id} string user = 1; } diff --git a/proto/api/v2/user_service.proto b/proto/api/v2/user_service.proto index e5372a2101cea..4a5dec8d3f07b 100644 --- a/proto/api/v2/user_service.proto +++ b/proto/api/v2/user_service.proto @@ -16,11 +16,18 @@ service UserService { rpc ListUsers(ListUsersRequest) returns (ListUsersResponse) { option (google.api.http) = {get: "/api/v2/users"}; } + + // SearchUsers searches users by filter. + rpc SearchUsers(SearchUsersRequest) returns (SearchUsersResponse) { + option (google.api.http) = {get: "/api/v2/users:search"}; + } + // GetUser gets a user by name. rpc GetUser(GetUserRequest) returns (GetUserResponse) { option (google.api.http) = {get: "/api/v2/{name=users/*}"}; option (google.api.method_signature) = "name"; } + // CreateUser creates a new user. rpc CreateUser(CreateUserRequest) returns (CreateUserResponse) { option (google.api.http) = { @@ -29,6 +36,7 @@ service UserService { }; option (google.api.method_signature) = "user"; } + // UpdateUser updates a user. rpc UpdateUser(UpdateUserRequest) returns (UpdateUserResponse) { option (google.api.http) = { @@ -37,16 +45,19 @@ service UserService { }; option (google.api.method_signature) = "user,update_mask"; } + // DeleteUser deletes a user. rpc DeleteUser(DeleteUserRequest) returns (DeleteUserResponse) { option (google.api.http) = {delete: "/api/v2/{name=users/*}"}; option (google.api.method_signature) = "name"; } + // GetUserSetting gets the setting of a user. rpc GetUserSetting(GetUserSettingRequest) returns (GetUserSettingResponse) { option (google.api.http) = {get: "/api/v2/{name=users/*}/setting"}; option (google.api.method_signature) = "name"; } + // UpdateUserSetting updates the setting of a user. rpc UpdateUserSetting(UpdateUserSettingRequest) returns (UpdateUserSettingResponse) { option (google.api.http) = { @@ -55,11 +66,13 @@ service UserService { }; option (google.api.method_signature) = "setting,update_mask"; } + // ListUserAccessTokens returns a list of access tokens for a user. rpc ListUserAccessTokens(ListUserAccessTokensRequest) returns (ListUserAccessTokensResponse) { option (google.api.http) = {get: "/api/v2/{name=users/*}/access_tokens"}; option (google.api.method_signature) = "name"; } + // CreateUserAccessToken creates a new access token for a user. rpc CreateUserAccessToken(CreateUserAccessTokenRequest) returns (CreateUserAccessTokenResponse) { option (google.api.http) = { @@ -68,6 +81,7 @@ service UserService { }; option (google.api.method_signature) = "name"; } + // DeleteUserAccessToken deletes an access token for a user. rpc DeleteUserAccessToken(DeleteUserAccessTokenRequest) returns (DeleteUserAccessTokenResponse) { option (google.api.http) = {delete: "/api/v2/{name=users/*}/access_tokens/{access_token}"}; @@ -77,9 +91,10 @@ service UserService { message User { // The name of the user. - // Format: users/{username} + // Format: users/{id} string name = 1; + // The system generated uid of the user. int32 id = 2; enum Role { @@ -98,13 +113,15 @@ message User { string avatar_url = 7; - string password = 8 [(google.api.field_behavior) = INPUT_ONLY]; + string description = 8; - RowStatus row_status = 9; + string password = 9 [(google.api.field_behavior) = INPUT_ONLY]; - google.protobuf.Timestamp create_time = 10; + RowStatus row_status = 10; - google.protobuf.Timestamp update_time = 11; + google.protobuf.Timestamp create_time = 11; + + google.protobuf.Timestamp update_time = 12; } message ListUsersRequest {} @@ -113,9 +130,19 @@ message ListUsersResponse { repeated User users = 1; } +message SearchUsersRequest { + // Filter is used to filter users returned in the list. + // Format: "username == frank" + string filter = 1; +} + +message SearchUsersResponse { + repeated User users = 1; +} + message GetUserRequest { // The name of the user. - // Format: users/{username} + // Format: users/{id} string name = 1; } @@ -143,7 +170,7 @@ message UpdateUserResponse { message DeleteUserRequest { // The name of the user. - // Format: users/{username} + // Format: users/{id} string name = 1; } @@ -151,7 +178,7 @@ message DeleteUserResponse {} message UserSetting { // The name of the user. - // Format: users/{username} + // Format: users/{id} string name = 1; // The preferred locale of the user. string locale = 2; @@ -165,7 +192,7 @@ message UserSetting { message GetUserSettingRequest { // The name of the user. - // Format: users/{username} + // Format: users/{id} string name = 1; } @@ -192,7 +219,7 @@ message UserAccessToken { message ListUserAccessTokensRequest { // The name of the user. - // Format: users/{username} + // Format: users/{id} string name = 1; } @@ -202,7 +229,7 @@ message ListUserAccessTokensResponse { message CreateUserAccessTokenRequest { // The name of the user. - // Format: users/{username} + // Format: users/{id} string name = 1; string description = 2; @@ -216,7 +243,7 @@ message CreateUserAccessTokenResponse { message DeleteUserAccessTokenRequest { // The name of the user. - // Format: users/{username} + // Format: users/{id} string name = 1; // access_token is the access token to delete. string access_token = 2; diff --git a/proto/api/v2/workspace_service.proto b/proto/api/v2/workspace_service.proto index 680c4b4fc4d39..da67e333c23f0 100644 --- a/proto/api/v2/workspace_service.proto +++ b/proto/api/v2/workspace_service.proto @@ -14,18 +14,21 @@ service WorkspaceService { } message WorkspaceProfile { + // The name of intance owner. + // Format: "users/{id}" + string owner = 1; // version is the current version of instance - string version = 1; + string version = 2; // mode is the instance mode (e.g. "prod", "dev" or "demo"). - string mode = 2; - // allow_registration is whether the registration is allowed. - bool allow_registration = 3; - // allow_password_login is whether the password login is allowed. - bool disable_password_login = 4; + string mode = 3; + // disallow_signup is whether the signup is disallowed. + bool disallow_signup = 4; + // disable_password_login is whether the password login is disabled. + bool disable_password_login = 5; // additional_script is the additional script. - string additional_script = 5; + string additional_script = 6; // additional_style is the additional style. - string additional_style = 6; + string additional_style = 7; } message GetWorkspaceProfileRequest {} diff --git a/proto/gen/api/v2/README.md b/proto/gen/api/v2/README.md index ae9bb542aa7eb..c4b862fdd06fa 100644 --- a/proto/gen/api/v2/README.md +++ b/proto/gen/api/v2/README.md @@ -35,6 +35,8 @@ - [ListUserAccessTokensResponse](#memos-api-v2-ListUserAccessTokensResponse) - [ListUsersRequest](#memos-api-v2-ListUsersRequest) - [ListUsersResponse](#memos-api-v2-ListUsersResponse) + - [SearchUsersRequest](#memos-api-v2-SearchUsersRequest) + - [SearchUsersResponse](#memos-api-v2-SearchUsersResponse) - [UpdateUserRequest](#memos-api-v2-UpdateUserRequest) - [UpdateUserResponse](#memos-api-v2-UpdateUserResponse) - [UpdateUserSettingRequest](#memos-api-v2-UpdateUserSettingRequest) @@ -61,6 +63,26 @@ - [AuthService](#memos-api-v2-AuthService) +- [api/v2/idp_service.proto](#api_v2_idp_service-proto) + - [CreateIdentityProviderRequest](#memos-api-v2-CreateIdentityProviderRequest) + - [CreateIdentityProviderResponse](#memos-api-v2-CreateIdentityProviderResponse) + - [DeleteIdentityProviderRequest](#memos-api-v2-DeleteIdentityProviderRequest) + - [DeleteIdentityProviderResponse](#memos-api-v2-DeleteIdentityProviderResponse) + - [GetIdentityProviderRequest](#memos-api-v2-GetIdentityProviderRequest) + - [GetIdentityProviderResponse](#memos-api-v2-GetIdentityProviderResponse) + - [IdentityProvider](#memos-api-v2-IdentityProvider) + - [IdentityProvider.Config](#memos-api-v2-IdentityProvider-Config) + - [IdentityProvider.Config.FieldMapping](#memos-api-v2-IdentityProvider-Config-FieldMapping) + - [IdentityProvider.Config.OAuth2](#memos-api-v2-IdentityProvider-Config-OAuth2) + - [ListIdentityProvidersRequest](#memos-api-v2-ListIdentityProvidersRequest) + - [ListIdentityProvidersResponse](#memos-api-v2-ListIdentityProvidersResponse) + - [UpdateIdentityProviderRequest](#memos-api-v2-UpdateIdentityProviderRequest) + - [UpdateIdentityProviderResponse](#memos-api-v2-UpdateIdentityProviderResponse) + + - [IdentityProvider.Type](#memos-api-v2-IdentityProvider-Type) + + - [IdentityProviderService](#memos-api-v2-IdentityProviderService) + - [api/v2/inbox_service.proto](#api_v2_inbox_service-proto) - [DeleteInboxRequest](#memos-api-v2-DeleteInboxRequest) - [DeleteInboxResponse](#memos-api-v2-DeleteInboxResponse) @@ -97,13 +119,13 @@ - [CreateResourceResponse](#memos-api-v2-CreateResourceResponse) - [DeleteResourceRequest](#memos-api-v2-DeleteResourceRequest) - [DeleteResourceResponse](#memos-api-v2-DeleteResourceResponse) - - [GetResourceByNameRequest](#memos-api-v2-GetResourceByNameRequest) - - [GetResourceByNameResponse](#memos-api-v2-GetResourceByNameResponse) - [GetResourceRequest](#memos-api-v2-GetResourceRequest) - [GetResourceResponse](#memos-api-v2-GetResourceResponse) - [ListResourcesRequest](#memos-api-v2-ListResourcesRequest) - [ListResourcesResponse](#memos-api-v2-ListResourcesResponse) - [Resource](#memos-api-v2-Resource) + - [SearchResourcesRequest](#memos-api-v2-SearchResourcesRequest) + - [SearchResourcesResponse](#memos-api-v2-SearchResourcesResponse) - [UpdateResourceRequest](#memos-api-v2-UpdateResourceRequest) - [UpdateResourceResponse](#memos-api-v2-UpdateResourceResponse) @@ -120,8 +142,6 @@ - [DeleteMemoResponse](#memos-api-v2-DeleteMemoResponse) - [ExportMemosRequest](#memos-api-v2-ExportMemosRequest) - [ExportMemosResponse](#memos-api-v2-ExportMemosResponse) - - [GetMemoByNameRequest](#memos-api-v2-GetMemoByNameRequest) - - [GetMemoByNameResponse](#memos-api-v2-GetMemoByNameResponse) - [GetMemoRequest](#memos-api-v2-GetMemoRequest) - [GetMemoResponse](#memos-api-v2-GetMemoResponse) - [GetUserMemosStatsRequest](#memos-api-v2-GetUserMemosStatsRequest) @@ -138,6 +158,8 @@ - [ListMemosRequest](#memos-api-v2-ListMemosRequest) - [ListMemosResponse](#memos-api-v2-ListMemosResponse) - [Memo](#memos-api-v2-Memo) + - [SearchMemosRequest](#memos-api-v2-SearchMemosRequest) + - [SearchMemosResponse](#memos-api-v2-SearchMemosResponse) - [SetMemoRelationsRequest](#memos-api-v2-SetMemoRelationsRequest) - [SetMemoRelationsResponse](#memos-api-v2-SetMemoRelationsResponse) - [SetMemoResourcesRequest](#memos-api-v2-SetMemoResourcesRequest) @@ -387,7 +409,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| name | [string](#string) | | The name of the user. Format: users/{username} | +| name | [string](#string) | | The name of the user. Format: users/{id} | | description | [string](#string) | | | | expires_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | optional | | @@ -449,7 +471,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| name | [string](#string) | | The name of the user. Format: users/{username} | +| name | [string](#string) | | The name of the user. Format: users/{id} | | access_token | [string](#string) | | access_token is the access token to delete. | @@ -475,7 +497,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| name | [string](#string) | | The name of the user. Format: users/{username} | +| name | [string](#string) | | The name of the user. Format: users/{id} | @@ -500,7 +522,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| name | [string](#string) | | The name of the user. Format: users/{username} | +| name | [string](#string) | | The name of the user. Format: users/{id} | @@ -530,7 +552,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| name | [string](#string) | | The name of the user. Format: users/{username} | +| name | [string](#string) | | The name of the user. Format: users/{id} | @@ -560,7 +582,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| name | [string](#string) | | The name of the user. Format: users/{username} | +| name | [string](#string) | | The name of the user. Format: users/{id} | @@ -607,6 +629,36 @@ Used internally for obfuscating the page token. + + +### SearchUsersRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| filter | [string](#string) | | Filter is used to filter users returned in the list. Format: "username == frank" | + + + + + + + + +### SearchUsersResponse + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| users | [User](#memos-api-v2-User) | repeated | | + + + + + + ### UpdateUserRequest @@ -677,13 +729,14 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| name | [string](#string) | | The name of the user. Format: users/{username} | -| id | [int32](#int32) | | | +| name | [string](#string) | | The name of the user. Format: users/{id} | +| id | [int32](#int32) | | The system generated uid of the user. | | role | [User.Role](#memos-api-v2-User-Role) | | | | username | [string](#string) | | | | email | [string](#string) | | | | nickname | [string](#string) | | | | avatar_url | [string](#string) | | | +| description | [string](#string) | | | | password | [string](#string) | | | | row_status | [RowStatus](#memos-api-v2-RowStatus) | | | | create_time | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | @@ -720,7 +773,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| name | [string](#string) | | The name of the user. Format: users/{username} | +| name | [string](#string) | | The name of the user. Format: users/{id} | | locale | [string](#string) | | The preferred locale of the user. | | appearance | [string](#string) | | The preferred appearance of the user. | | memo_visibility | [string](#string) | | The default visibility of the memo. | @@ -759,6 +812,7 @@ Used internally for obfuscating the page token. | Method Name | Request Type | Response Type | Description | | ----------- | ------------ | ------------- | ------------| | ListUsers | [ListUsersRequest](#memos-api-v2-ListUsersRequest) | [ListUsersResponse](#memos-api-v2-ListUsersResponse) | ListUsers returns a list of users. | +| SearchUsers | [SearchUsersRequest](#memos-api-v2-SearchUsersRequest) | [SearchUsersResponse](#memos-api-v2-SearchUsersResponse) | SearchUsers searches users by filter. | | GetUser | [GetUserRequest](#memos-api-v2-GetUserRequest) | [GetUserResponse](#memos-api-v2-GetUserResponse) | GetUser gets a user by name. | | CreateUser | [CreateUserRequest](#memos-api-v2-CreateUserRequest) | [CreateUserResponse](#memos-api-v2-CreateUserResponse) | CreateUser creates a new user. | | UpdateUser | [UpdateUserRequest](#memos-api-v2-UpdateUserRequest) | [UpdateUserResponse](#memos-api-v2-UpdateUserResponse) | UpdateUser updates a user. | @@ -943,6 +997,261 @@ Used internally for obfuscating the page token. + +
+ +## api/v2/idp_service.proto + + + + + +### CreateIdentityProviderRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| identity_provider | [IdentityProvider](#memos-api-v2-IdentityProvider) | | The identityProvider to create. | + + + + + + + + +### CreateIdentityProviderResponse + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| identity_provider | [IdentityProvider](#memos-api-v2-IdentityProvider) | | The created identityProvider. | + + + + + + + + +### DeleteIdentityProviderRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| name | [string](#string) | | The name of the identityProvider to delete. Format: identityProviders/{id} | + + + + + + + + +### DeleteIdentityProviderResponse + + + + + + + + + +### GetIdentityProviderRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| name | [string](#string) | | The name of the identityProvider to get. Format: identityProviders/{id} | + + + + + + + + +### GetIdentityProviderResponse + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| identity_provider | [IdentityProvider](#memos-api-v2-IdentityProvider) | | The identityProvider. | + + + + + + + + +### IdentityProvider + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| name | [string](#string) | | The name of the identityProvider. Format: identityProviders/{id} | +| type | [IdentityProvider.Type](#memos-api-v2-IdentityProvider-Type) | | | +| title | [string](#string) | | | +| identifier_filter | [string](#string) | | | +| config | [IdentityProvider.Config](#memos-api-v2-IdentityProvider-Config) | | | + + + + + + + + +### IdentityProvider.Config + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| oauth2 | [IdentityProvider.Config.OAuth2](#memos-api-v2-IdentityProvider-Config-OAuth2) | | | + + + + + + + + +### IdentityProvider.Config.FieldMapping + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| identifier | [string](#string) | | | +| display_name | [string](#string) | | | +| email | [string](#string) | | | + + + + + + + + +### IdentityProvider.Config.OAuth2 + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| client_id | [string](#string) | | | +| client_secret | [string](#string) | | | +| auth_url | [string](#string) | | | +| token_url | [string](#string) | | | +| user_info_url | [string](#string) | | | +| scopes | [string](#string) | repeated | | +| field_mapping | [IdentityProvider.Config.FieldMapping](#memos-api-v2-IdentityProvider-Config-FieldMapping) | | | + + + + + + + + +### ListIdentityProvidersRequest + + + + + + + + + +### ListIdentityProvidersResponse + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| identity_providers | [IdentityProvider](#memos-api-v2-IdentityProvider) | repeated | | + + + + + + + + +### UpdateIdentityProviderRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| identity_provider | [IdentityProvider](#memos-api-v2-IdentityProvider) | | The identityProvider to update. | +| update_mask | [google.protobuf.FieldMask](#google-protobuf-FieldMask) | | The update mask applies to the resource. Only the top level fields of IdentityProvider are supported. | + + + + + + + + +### UpdateIdentityProviderResponse + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| identity_provider | [IdentityProvider](#memos-api-v2-IdentityProvider) | | The updated identityProvider. | + + + + + + + + + + +### IdentityProvider.Type + + +| Name | Number | Description | +| ---- | ------ | ----------- | +| TYPE_UNSPECIFIED | 0 | | +| OAUTH2 | 1 | | + + + + + + + + + +### IdentityProviderService + + +| Method Name | Request Type | Response Type | Description | +| ----------- | ------------ | ------------- | ------------| +| ListIdentityProviders | [ListIdentityProvidersRequest](#memos-api-v2-ListIdentityProvidersRequest) | [ListIdentityProvidersResponse](#memos-api-v2-ListIdentityProvidersResponse) | | +| GetIdentityProvider | [GetIdentityProviderRequest](#memos-api-v2-GetIdentityProviderRequest) | [GetIdentityProviderResponse](#memos-api-v2-GetIdentityProviderResponse) | | +| CreateIdentityProvider | [CreateIdentityProviderRequest](#memos-api-v2-CreateIdentityProviderRequest) | [CreateIdentityProviderResponse](#memos-api-v2-CreateIdentityProviderResponse) | | +| UpdateIdentityProvider | [UpdateIdentityProviderRequest](#memos-api-v2-UpdateIdentityProviderRequest) | [UpdateIdentityProviderResponse](#memos-api-v2-UpdateIdentityProviderResponse) | UpdateIdentityProvider updates an identity provider. | +| DeleteIdentityProvider | [DeleteIdentityProviderRequest](#memos-api-v2-DeleteIdentityProviderRequest) | [DeleteIdentityProviderResponse](#memos-api-v2-DeleteIdentityProviderResponse) | DeleteIdentityProvider deletes an identity provider. | + + + + + @@ -958,7 +1267,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| name | [string](#string) | | The name of the inbox to delete. Format: inboxes/{uid} | +| name | [string](#string) | | The name of the inbox to delete. Format: inboxes/{id} | @@ -983,9 +1292,9 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| name | [string](#string) | | The name of the inbox. Format: inboxes/{uid} | -| sender | [string](#string) | | Format: users/{username} | -| receiver | [string](#string) | | Format: users/{username} | +| name | [string](#string) | | The name of the inbox. Format: inboxes/{id} | +| sender | [string](#string) | | Format: users/{id} | +| receiver | [string](#string) | | Format: users/{id} | | status | [Inbox.Status](#memos-api-v2-Inbox-Status) | | | | create_time | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | | type | [Inbox.Type](#memos-api-v2-Inbox-Type) | | | @@ -1004,7 +1313,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| user | [string](#string) | | Format: users/{username} | +| user | [string](#string) | | Format: users/{id} | @@ -1134,7 +1443,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| metadata | [LinkMetadata](#memos-api-v2-LinkMetadata) | | | +| link_metadata | [LinkMetadata](#memos-api-v2-LinkMetadata) | | | @@ -1192,8 +1501,8 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| memo_id | [int32](#int32) | | | -| related_memo_id | [int32](#int32) | | | +| memo | [string](#string) | | The name of memo. Format: "memos/{uid}" | +| related_memo | [string](#string) | | The name of related memo. Format: "memos/{uid}" | | type | [MemoRelation.Type](#memos-api-v2-MemoRelation-Type) | | | @@ -1239,7 +1548,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | id | [int32](#int32) | | | -| creator | [string](#string) | | | +| creator | [string](#string) | | The name of the creator. Format: users/{id} | | content_id | [string](#string) | | | | reaction_type | [Reaction.Type](#memos-api-v2-Reaction-Type) | | | @@ -1298,7 +1607,7 @@ Used internally for obfuscating the page token. | filename | [string](#string) | | | | external_link | [string](#string) | | | | type | [string](#string) | | | -| memo_id | [int32](#int32) | optional | | +| memo | [string](#string) | optional | Format: memos/{id} | @@ -1328,7 +1637,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| id | [int32](#int32) | | | +| name | [string](#string) | | | @@ -1345,9 +1654,9 @@ Used internally for obfuscating the page token. - + -### GetResourceByNameRequest +### GetResourceRequest @@ -1360,9 +1669,9 @@ Used internally for obfuscating the page token. - + -### GetResourceByNameResponse +### GetResourceResponse @@ -1375,77 +1684,77 @@ Used internally for obfuscating the page token. - - -### GetResourceRequest - + +### ListResourcesRequest -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| id | [int32](#int32) | | | - + -### GetResourceResponse +### ListResourcesResponse | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| resource | [Resource](#memos-api-v2-Resource) | | | +| resources | [Resource](#memos-api-v2-Resource) | repeated | | - + -### ListResourcesRequest +### Resource +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| name | [string](#string) | | The name of the resource. Format: resources/{id} id is the system generated unique identifier. | +| uid | [string](#string) | | The user defined id of the resource. | +| create_time | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | +| filename | [string](#string) | | | +| external_link | [string](#string) | | | +| type | [string](#string) | | | +| size | [int64](#int64) | | | +| memo | [string](#string) | optional | Format: memos/{id} | - -### ListResourcesResponse + + + +### SearchResourcesRequest | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| resources | [Resource](#memos-api-v2-Resource) | repeated | | +| filter | [string](#string) | | | - + -### Resource +### SearchResourcesResponse | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| id | [int32](#int32) | | id is the system generated unique identifier. | -| name | [string](#string) | | name is the user provided name. | -| create_time | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | -| filename | [string](#string) | | | -| external_link | [string](#string) | | | -| type | [string](#string) | | | -| size | [int64](#int64) | | | -| memo_id | [int32](#int32) | optional | | +| resources | [Resource](#memos-api-v2-Resource) | repeated | | @@ -1498,10 +1807,10 @@ Used internally for obfuscating the page token. | ----------- | ------------ | ------------- | ------------| | CreateResource | [CreateResourceRequest](#memos-api-v2-CreateResourceRequest) | [CreateResourceResponse](#memos-api-v2-CreateResourceResponse) | CreateResource creates a new resource. | | ListResources | [ListResourcesRequest](#memos-api-v2-ListResourcesRequest) | [ListResourcesResponse](#memos-api-v2-ListResourcesResponse) | ListResources lists all resources. | -| GetResource | [GetResourceRequest](#memos-api-v2-GetResourceRequest) | [GetResourceResponse](#memos-api-v2-GetResourceResponse) | GetResource returns a resource by id. | -| GetResourceByName | [GetResourceByNameRequest](#memos-api-v2-GetResourceByNameRequest) | [GetResourceByNameResponse](#memos-api-v2-GetResourceByNameResponse) | GetResourceByName returns a resource by name. | +| SearchResources | [SearchResourcesRequest](#memos-api-v2-SearchResourcesRequest) | [SearchResourcesResponse](#memos-api-v2-SearchResourcesResponse) | SearchResources searches memos. | +| GetResource | [GetResourceRequest](#memos-api-v2-GetResourceRequest) | [GetResourceResponse](#memos-api-v2-GetResourceResponse) | GetResource returns a resource by name. | | UpdateResource | [UpdateResourceRequest](#memos-api-v2-UpdateResourceRequest) | [UpdateResourceResponse](#memos-api-v2-UpdateResourceResponse) | UpdateResource updates a resource. | -| DeleteResource | [DeleteResourceRequest](#memos-api-v2-DeleteResourceRequest) | [DeleteResourceResponse](#memos-api-v2-DeleteResourceResponse) | DeleteResource deletes a resource by id. | +| DeleteResource | [DeleteResourceRequest](#memos-api-v2-DeleteResourceRequest) | [DeleteResourceResponse](#memos-api-v2-DeleteResourceResponse) | DeleteResource deletes a resource by name. | @@ -1522,8 +1831,8 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| id | [int32](#int32) | | id is the memo id to create comment for. | -| create | [CreateMemoRequest](#memos-api-v2-CreateMemoRequest) | | | +| name | [string](#string) | | The name of the memo. Format: memos/{id} | +| comment | [CreateMemoRequest](#memos-api-v2-CreateMemoRequest) | | | @@ -1584,7 +1893,6 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| id | [int32](#int32) | | | | reaction_id | [int32](#int32) | | | @@ -1610,7 +1918,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| id | [int32](#int32) | | | +| name | [string](#string) | | The name of the memo. Format: memos/{id} | @@ -1657,36 +1965,6 @@ Used internally for obfuscating the page token. - - -### GetMemoByNameRequest - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| name | [string](#string) | | | - - - - - - - - -### GetMemoByNameResponse - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| memo | [Memo](#memos-api-v2-Memo) | | | - - - - - - ### GetMemoRequest @@ -1695,7 +1973,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| id | [int32](#int32) | | | +| name | [string](#string) | | The name of the memo. Format: memos/{id} | @@ -1725,7 +2003,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| name | [string](#string) | | name is the name of the user to get stats for. Format: users/{username} | +| name | [string](#string) | | name is the name of the user to get stats for. Format: users/{id} | | timezone | [string](#string) | | timezone location Format: uses tz identifier https://en.wikipedia.org/wiki/List_of_tz_database_time_zones | | filter | [string](#string) | | Same as ListMemosRequest.filter | @@ -1773,7 +2051,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| id | [int32](#int32) | | | +| name | [string](#string) | | The name of the memo. Format: memos/{id} | @@ -1803,7 +2081,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| id | [int32](#int32) | | | +| name | [string](#string) | | The name of the memo. Format: memos/{id} | @@ -1833,7 +2111,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| id | [int32](#int32) | | | +| name | [string](#string) | | The name of the memo. Format: memos/{id} | @@ -1863,7 +2141,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| id | [int32](#int32) | | | +| name | [string](#string) | | The name of the memo. Format: memos/{id} | @@ -1895,7 +2173,7 @@ Used internally for obfuscating the page token. | ----- | ---- | ----- | ----------- | | page_size | [int32](#int32) | | The maximum number of memos to return. | | page_token | [string](#string) | | A page token, received from a previous `ListMemos` call. Provide this to retrieve the subsequent page. | -| filter | [string](#string) | | Filter is used to filter memos returned in the list. Format: "creator == users/{username} && visibilities == ['PUBLIC', 'PROTECTED']" | +| filter | [string](#string) | | Filter is used to filter memos returned in the list. Format: "creator == users/{uid} && visibilities == ['PUBLIC', 'PROTECTED']" | @@ -1926,11 +2204,10 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| id | [int32](#int32) | | id is the system generated unique identifier. | -| name | [string](#string) | | name is the user provided name. | +| name | [string](#string) | | The name of the memo. Format: memos/{id} id is the system generated id. | +| uid | [string](#string) | | The user defined id of the memo. | | row_status | [RowStatus](#memos-api-v2-RowStatus) | | | -| creator | [string](#string) | | The name of the creator. Format: users/{username} | -| creator_id | [int32](#int32) | | | +| creator | [string](#string) | | The name of the creator. Format: users/{id} | | create_time | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | | update_time | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | | display_time | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | @@ -1947,6 +2224,36 @@ Used internally for obfuscating the page token. + + +### SearchMemosRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| filter | [string](#string) | | Filter is used to filter memos returned. Format: "creator == users/{uid} && visibilities == ['PUBLIC', 'PROTECTED']" | + + + + + + + + +### SearchMemosResponse + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| memos | [Memo](#memos-api-v2-Memo) | repeated | | + + + + + + ### SetMemoRelationsRequest @@ -1955,7 +2262,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| id | [int32](#int32) | | | +| name | [string](#string) | | The name of the memo. Format: memos/{id} | | relations | [MemoRelation](#memos-api-v2-MemoRelation) | repeated | | @@ -1981,7 +2288,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| id | [int32](#int32) | | | +| name | [string](#string) | | The name of the memo. Format: memos/{id} | | resources | [Resource](#memos-api-v2-Resource) | repeated | | @@ -2038,7 +2345,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| id | [int32](#int32) | | | +| name | [string](#string) | | The name of the memo. Format: memos/{id} | | reaction | [Reaction](#memos-api-v2-Reaction) | | | @@ -2090,10 +2397,10 @@ Used internally for obfuscating the page token. | ----------- | ------------ | ------------- | ------------| | CreateMemo | [CreateMemoRequest](#memos-api-v2-CreateMemoRequest) | [CreateMemoResponse](#memos-api-v2-CreateMemoResponse) | CreateMemo creates a memo. | | ListMemos | [ListMemosRequest](#memos-api-v2-ListMemosRequest) | [ListMemosResponse](#memos-api-v2-ListMemosResponse) | ListMemos lists memos with pagination and filter. | -| GetMemo | [GetMemoRequest](#memos-api-v2-GetMemoRequest) | [GetMemoResponse](#memos-api-v2-GetMemoResponse) | GetMemo gets a memo by id. | -| GetMemoByName | [GetMemoByNameRequest](#memos-api-v2-GetMemoByNameRequest) | [GetMemoByNameResponse](#memos-api-v2-GetMemoByNameResponse) | GetMemoByName gets a memo by name. | +| SearchMemos | [SearchMemosRequest](#memos-api-v2-SearchMemosRequest) | [SearchMemosResponse](#memos-api-v2-SearchMemosResponse) | SearchMemos searches memos. | +| GetMemo | [GetMemoRequest](#memos-api-v2-GetMemoRequest) | [GetMemoResponse](#memos-api-v2-GetMemoResponse) | GetMemo gets a memo. | | UpdateMemo | [UpdateMemoRequest](#memos-api-v2-UpdateMemoRequest) | [UpdateMemoResponse](#memos-api-v2-UpdateMemoResponse) | UpdateMemo updates a memo. | -| DeleteMemo | [DeleteMemoRequest](#memos-api-v2-DeleteMemoRequest) | [DeleteMemoResponse](#memos-api-v2-DeleteMemoResponse) | DeleteMemo deletes a memo by id. | +| DeleteMemo | [DeleteMemoRequest](#memos-api-v2-DeleteMemoRequest) | [DeleteMemoResponse](#memos-api-v2-DeleteMemoResponse) | DeleteMemo deletes a memo. | | ExportMemos | [ExportMemosRequest](#memos-api-v2-ExportMemosRequest) | [ExportMemosResponse](#memos-api-v2-ExportMemosResponse) | ExportMemos exports memos. | | SetMemoResources | [SetMemoResourcesRequest](#memos-api-v2-SetMemoResourcesRequest) | [SetMemoResourcesResponse](#memos-api-v2-SetMemoResourcesResponse) | SetMemoResources sets resources for a memo. | | ListMemoResources | [ListMemoResourcesRequest](#memos-api-v2-ListMemoResourcesRequest) | [ListMemoResourcesResponse](#memos-api-v2-ListMemoResourcesResponse) | ListMemoResources lists resources for a memo. | @@ -2175,7 +2482,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| user | [string](#string) | | The creator of tags. Format: users/{username} | +| user | [string](#string) | | The creator of tags. Format: users/{id} | @@ -2205,7 +2512,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| user | [string](#string) | | The creator of tags. Format: users/{username} | +| user | [string](#string) | | The creator of tags. Format: users/{id} | @@ -2235,7 +2542,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| user | [string](#string) | | The creator of tags. Format: users/{username} | +| user | [string](#string) | | The creator of tags. Format: users/{id} | | old_name | [string](#string) | | | | new_name | [string](#string) | | | @@ -2268,7 +2575,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | name | [string](#string) | | | -| creator | [string](#string) | | The creator of tags. Format: users/{username} | +| creator | [string](#string) | | The creator of tags. Format: users/{id} | @@ -2567,10 +2874,11 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | +| owner | [string](#string) | | The name of intance owner. Format: "users/{id}" | | version | [string](#string) | | version is the current version of instance | | mode | [string](#string) | | mode is the instance mode (e.g. "prod", "dev" or "demo"). | -| allow_registration | [bool](#bool) | | allow_registration is whether the registration is allowed. | -| disable_password_login | [bool](#bool) | | allow_password_login is whether the password login is allowed. | +| disallow_signup | [bool](#bool) | | disallow_signup is whether the signup is disallowed. | +| disable_password_login | [bool](#bool) | | disable_password_login is whether the password login is disabled. | | additional_script | [string](#string) | | additional_script is the additional script. | | additional_style | [string](#string) | | additional_style is the additional style. | diff --git a/proto/gen/api/v2/idp_service.pb.go b/proto/gen/api/v2/idp_service.pb.go new file mode 100644 index 0000000000000..f17a4c3f5f056 --- /dev/null +++ b/proto/gen/api/v2/idp_service.pb.go @@ -0,0 +1,1289 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: api/v2/idp_service.proto + +package apiv2 + +import ( + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb" + reflect "reflect" + sync "sync" +) + +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) +) + +type IdentityProvider_Type int32 + +const ( + IdentityProvider_TYPE_UNSPECIFIED IdentityProvider_Type = 0 + IdentityProvider_OAUTH2 IdentityProvider_Type = 1 +) + +// Enum value maps for IdentityProvider_Type. +var ( + IdentityProvider_Type_name = map[int32]string{ + 0: "TYPE_UNSPECIFIED", + 1: "OAUTH2", + } + IdentityProvider_Type_value = map[string]int32{ + "TYPE_UNSPECIFIED": 0, + "OAUTH2": 1, + } +) + +func (x IdentityProvider_Type) Enum() *IdentityProvider_Type { + p := new(IdentityProvider_Type) + *p = x + return p +} + +func (x IdentityProvider_Type) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (IdentityProvider_Type) Descriptor() protoreflect.EnumDescriptor { + return file_api_v2_idp_service_proto_enumTypes[0].Descriptor() +} + +func (IdentityProvider_Type) Type() protoreflect.EnumType { + return &file_api_v2_idp_service_proto_enumTypes[0] +} + +func (x IdentityProvider_Type) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use IdentityProvider_Type.Descriptor instead. +func (IdentityProvider_Type) EnumDescriptor() ([]byte, []int) { + return file_api_v2_idp_service_proto_rawDescGZIP(), []int{0, 0} +} + +type IdentityProvider struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The name of the identityProvider. + // Format: identityProviders/{id} + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Type IdentityProvider_Type `protobuf:"varint,2,opt,name=type,proto3,enum=memos.api.v2.IdentityProvider_Type" json:"type,omitempty"` + Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` + IdentifierFilter string `protobuf:"bytes,4,opt,name=identifier_filter,json=identifierFilter,proto3" json:"identifier_filter,omitempty"` + Config *IdentityProvider_Config `protobuf:"bytes,5,opt,name=config,proto3" json:"config,omitempty"` +} + +func (x *IdentityProvider) Reset() { + *x = IdentityProvider{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v2_idp_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *IdentityProvider) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IdentityProvider) ProtoMessage() {} + +func (x *IdentityProvider) ProtoReflect() protoreflect.Message { + mi := &file_api_v2_idp_service_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 IdentityProvider.ProtoReflect.Descriptor instead. +func (*IdentityProvider) Descriptor() ([]byte, []int) { + return file_api_v2_idp_service_proto_rawDescGZIP(), []int{0} +} + +func (x *IdentityProvider) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *IdentityProvider) GetType() IdentityProvider_Type { + if x != nil { + return x.Type + } + return IdentityProvider_TYPE_UNSPECIFIED +} + +func (x *IdentityProvider) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *IdentityProvider) GetIdentifierFilter() string { + if x != nil { + return x.IdentifierFilter + } + return "" +} + +func (x *IdentityProvider) GetConfig() *IdentityProvider_Config { + if x != nil { + return x.Config + } + return nil +} + +type ListIdentityProvidersRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ListIdentityProvidersRequest) Reset() { + *x = ListIdentityProvidersRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v2_idp_service_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListIdentityProvidersRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListIdentityProvidersRequest) ProtoMessage() {} + +func (x *ListIdentityProvidersRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_v2_idp_service_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 ListIdentityProvidersRequest.ProtoReflect.Descriptor instead. +func (*ListIdentityProvidersRequest) Descriptor() ([]byte, []int) { + return file_api_v2_idp_service_proto_rawDescGZIP(), []int{1} +} + +type ListIdentityProvidersResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IdentityProviders []*IdentityProvider `protobuf:"bytes,1,rep,name=identity_providers,json=identityProviders,proto3" json:"identity_providers,omitempty"` +} + +func (x *ListIdentityProvidersResponse) Reset() { + *x = ListIdentityProvidersResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v2_idp_service_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListIdentityProvidersResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListIdentityProvidersResponse) ProtoMessage() {} + +func (x *ListIdentityProvidersResponse) ProtoReflect() protoreflect.Message { + mi := &file_api_v2_idp_service_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 ListIdentityProvidersResponse.ProtoReflect.Descriptor instead. +func (*ListIdentityProvidersResponse) Descriptor() ([]byte, []int) { + return file_api_v2_idp_service_proto_rawDescGZIP(), []int{2} +} + +func (x *ListIdentityProvidersResponse) GetIdentityProviders() []*IdentityProvider { + if x != nil { + return x.IdentityProviders + } + return nil +} + +type GetIdentityProviderRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The name of the identityProvider to get. + // Format: identityProviders/{id} + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *GetIdentityProviderRequest) Reset() { + *x = GetIdentityProviderRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v2_idp_service_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetIdentityProviderRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetIdentityProviderRequest) ProtoMessage() {} + +func (x *GetIdentityProviderRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_v2_idp_service_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 GetIdentityProviderRequest.ProtoReflect.Descriptor instead. +func (*GetIdentityProviderRequest) Descriptor() ([]byte, []int) { + return file_api_v2_idp_service_proto_rawDescGZIP(), []int{3} +} + +func (x *GetIdentityProviderRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type GetIdentityProviderResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The identityProvider. + IdentityProvider *IdentityProvider `protobuf:"bytes,1,opt,name=identity_provider,json=identityProvider,proto3" json:"identity_provider,omitempty"` +} + +func (x *GetIdentityProviderResponse) Reset() { + *x = GetIdentityProviderResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v2_idp_service_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetIdentityProviderResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetIdentityProviderResponse) ProtoMessage() {} + +func (x *GetIdentityProviderResponse) ProtoReflect() protoreflect.Message { + mi := &file_api_v2_idp_service_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 GetIdentityProviderResponse.ProtoReflect.Descriptor instead. +func (*GetIdentityProviderResponse) Descriptor() ([]byte, []int) { + return file_api_v2_idp_service_proto_rawDescGZIP(), []int{4} +} + +func (x *GetIdentityProviderResponse) GetIdentityProvider() *IdentityProvider { + if x != nil { + return x.IdentityProvider + } + return nil +} + +type CreateIdentityProviderRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The identityProvider to create. + IdentityProvider *IdentityProvider `protobuf:"bytes,1,opt,name=identity_provider,json=identityProvider,proto3" json:"identity_provider,omitempty"` +} + +func (x *CreateIdentityProviderRequest) Reset() { + *x = CreateIdentityProviderRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v2_idp_service_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateIdentityProviderRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateIdentityProviderRequest) ProtoMessage() {} + +func (x *CreateIdentityProviderRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_v2_idp_service_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 CreateIdentityProviderRequest.ProtoReflect.Descriptor instead. +func (*CreateIdentityProviderRequest) Descriptor() ([]byte, []int) { + return file_api_v2_idp_service_proto_rawDescGZIP(), []int{5} +} + +func (x *CreateIdentityProviderRequest) GetIdentityProvider() *IdentityProvider { + if x != nil { + return x.IdentityProvider + } + return nil +} + +type CreateIdentityProviderResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The created identityProvider. + IdentityProvider *IdentityProvider `protobuf:"bytes,1,opt,name=identity_provider,json=identityProvider,proto3" json:"identity_provider,omitempty"` +} + +func (x *CreateIdentityProviderResponse) Reset() { + *x = CreateIdentityProviderResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v2_idp_service_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateIdentityProviderResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateIdentityProviderResponse) ProtoMessage() {} + +func (x *CreateIdentityProviderResponse) ProtoReflect() protoreflect.Message { + mi := &file_api_v2_idp_service_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 CreateIdentityProviderResponse.ProtoReflect.Descriptor instead. +func (*CreateIdentityProviderResponse) Descriptor() ([]byte, []int) { + return file_api_v2_idp_service_proto_rawDescGZIP(), []int{6} +} + +func (x *CreateIdentityProviderResponse) GetIdentityProvider() *IdentityProvider { + if x != nil { + return x.IdentityProvider + } + return nil +} + +type UpdateIdentityProviderRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The identityProvider to update. + IdentityProvider *IdentityProvider `protobuf:"bytes,1,opt,name=identity_provider,json=identityProvider,proto3" json:"identity_provider,omitempty"` + // The update mask applies to the resource. Only the top level fields of + // IdentityProvider are supported. + UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"` +} + +func (x *UpdateIdentityProviderRequest) Reset() { + *x = UpdateIdentityProviderRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v2_idp_service_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateIdentityProviderRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateIdentityProviderRequest) ProtoMessage() {} + +func (x *UpdateIdentityProviderRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_v2_idp_service_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 UpdateIdentityProviderRequest.ProtoReflect.Descriptor instead. +func (*UpdateIdentityProviderRequest) Descriptor() ([]byte, []int) { + return file_api_v2_idp_service_proto_rawDescGZIP(), []int{7} +} + +func (x *UpdateIdentityProviderRequest) GetIdentityProvider() *IdentityProvider { + if x != nil { + return x.IdentityProvider + } + return nil +} + +func (x *UpdateIdentityProviderRequest) GetUpdateMask() *fieldmaskpb.FieldMask { + if x != nil { + return x.UpdateMask + } + return nil +} + +type UpdateIdentityProviderResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The updated identityProvider. + IdentityProvider *IdentityProvider `protobuf:"bytes,1,opt,name=identity_provider,json=identityProvider,proto3" json:"identity_provider,omitempty"` +} + +func (x *UpdateIdentityProviderResponse) Reset() { + *x = UpdateIdentityProviderResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v2_idp_service_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateIdentityProviderResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateIdentityProviderResponse) ProtoMessage() {} + +func (x *UpdateIdentityProviderResponse) ProtoReflect() protoreflect.Message { + mi := &file_api_v2_idp_service_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 UpdateIdentityProviderResponse.ProtoReflect.Descriptor instead. +func (*UpdateIdentityProviderResponse) Descriptor() ([]byte, []int) { + return file_api_v2_idp_service_proto_rawDescGZIP(), []int{8} +} + +func (x *UpdateIdentityProviderResponse) GetIdentityProvider() *IdentityProvider { + if x != nil { + return x.IdentityProvider + } + return nil +} + +type DeleteIdentityProviderRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The name of the identityProvider to delete. + // Format: identityProviders/{id} + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *DeleteIdentityProviderRequest) Reset() { + *x = DeleteIdentityProviderRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v2_idp_service_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteIdentityProviderRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteIdentityProviderRequest) ProtoMessage() {} + +func (x *DeleteIdentityProviderRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_v2_idp_service_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 DeleteIdentityProviderRequest.ProtoReflect.Descriptor instead. +func (*DeleteIdentityProviderRequest) Descriptor() ([]byte, []int) { + return file_api_v2_idp_service_proto_rawDescGZIP(), []int{9} +} + +func (x *DeleteIdentityProviderRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type DeleteIdentityProviderResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *DeleteIdentityProviderResponse) Reset() { + *x = DeleteIdentityProviderResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v2_idp_service_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteIdentityProviderResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteIdentityProviderResponse) ProtoMessage() {} + +func (x *DeleteIdentityProviderResponse) ProtoReflect() protoreflect.Message { + mi := &file_api_v2_idp_service_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 DeleteIdentityProviderResponse.ProtoReflect.Descriptor instead. +func (*DeleteIdentityProviderResponse) Descriptor() ([]byte, []int) { + return file_api_v2_idp_service_proto_rawDescGZIP(), []int{10} +} + +type IdentityProvider_Config struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Config: + // + // *IdentityProvider_Config_Oauth2 + Config isIdentityProvider_Config_Config `protobuf_oneof:"config"` +} + +func (x *IdentityProvider_Config) Reset() { + *x = IdentityProvider_Config{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v2_idp_service_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *IdentityProvider_Config) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IdentityProvider_Config) ProtoMessage() {} + +func (x *IdentityProvider_Config) ProtoReflect() protoreflect.Message { + mi := &file_api_v2_idp_service_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 IdentityProvider_Config.ProtoReflect.Descriptor instead. +func (*IdentityProvider_Config) Descriptor() ([]byte, []int) { + return file_api_v2_idp_service_proto_rawDescGZIP(), []int{0, 0} +} + +func (m *IdentityProvider_Config) GetConfig() isIdentityProvider_Config_Config { + if m != nil { + return m.Config + } + return nil +} + +func (x *IdentityProvider_Config) GetOauth2() *IdentityProvider_Config_OAuth2 { + if x, ok := x.GetConfig().(*IdentityProvider_Config_Oauth2); ok { + return x.Oauth2 + } + return nil +} + +type isIdentityProvider_Config_Config interface { + isIdentityProvider_Config_Config() +} + +type IdentityProvider_Config_Oauth2 struct { + Oauth2 *IdentityProvider_Config_OAuth2 `protobuf:"bytes,1,opt,name=oauth2,proto3,oneof"` +} + +func (*IdentityProvider_Config_Oauth2) isIdentityProvider_Config_Config() {} + +type IdentityProvider_Config_FieldMapping struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Identifier string `protobuf:"bytes,1,opt,name=identifier,proto3" json:"identifier,omitempty"` + DisplayName string `protobuf:"bytes,2,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` + Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` +} + +func (x *IdentityProvider_Config_FieldMapping) Reset() { + *x = IdentityProvider_Config_FieldMapping{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v2_idp_service_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *IdentityProvider_Config_FieldMapping) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IdentityProvider_Config_FieldMapping) ProtoMessage() {} + +func (x *IdentityProvider_Config_FieldMapping) ProtoReflect() protoreflect.Message { + mi := &file_api_v2_idp_service_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 IdentityProvider_Config_FieldMapping.ProtoReflect.Descriptor instead. +func (*IdentityProvider_Config_FieldMapping) Descriptor() ([]byte, []int) { + return file_api_v2_idp_service_proto_rawDescGZIP(), []int{0, 0, 0} +} + +func (x *IdentityProvider_Config_FieldMapping) GetIdentifier() string { + if x != nil { + return x.Identifier + } + return "" +} + +func (x *IdentityProvider_Config_FieldMapping) GetDisplayName() string { + if x != nil { + return x.DisplayName + } + return "" +} + +func (x *IdentityProvider_Config_FieldMapping) GetEmail() string { + if x != nil { + return x.Email + } + return "" +} + +type IdentityProvider_Config_OAuth2 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` + ClientSecret string `protobuf:"bytes,2,opt,name=client_secret,json=clientSecret,proto3" json:"client_secret,omitempty"` + AuthUrl string `protobuf:"bytes,3,opt,name=auth_url,json=authUrl,proto3" json:"auth_url,omitempty"` + TokenUrl string `protobuf:"bytes,4,opt,name=token_url,json=tokenUrl,proto3" json:"token_url,omitempty"` + UserInfoUrl string `protobuf:"bytes,5,opt,name=user_info_url,json=userInfoUrl,proto3" json:"user_info_url,omitempty"` + Scopes []string `protobuf:"bytes,6,rep,name=scopes,proto3" json:"scopes,omitempty"` + FieldMapping *IdentityProvider_Config_FieldMapping `protobuf:"bytes,7,opt,name=field_mapping,json=fieldMapping,proto3" json:"field_mapping,omitempty"` +} + +func (x *IdentityProvider_Config_OAuth2) Reset() { + *x = IdentityProvider_Config_OAuth2{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v2_idp_service_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *IdentityProvider_Config_OAuth2) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IdentityProvider_Config_OAuth2) ProtoMessage() {} + +func (x *IdentityProvider_Config_OAuth2) ProtoReflect() protoreflect.Message { + mi := &file_api_v2_idp_service_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 IdentityProvider_Config_OAuth2.ProtoReflect.Descriptor instead. +func (*IdentityProvider_Config_OAuth2) Descriptor() ([]byte, []int) { + return file_api_v2_idp_service_proto_rawDescGZIP(), []int{0, 0, 1} +} + +func (x *IdentityProvider_Config_OAuth2) GetClientId() string { + if x != nil { + return x.ClientId + } + return "" +} + +func (x *IdentityProvider_Config_OAuth2) GetClientSecret() string { + if x != nil { + return x.ClientSecret + } + return "" +} + +func (x *IdentityProvider_Config_OAuth2) GetAuthUrl() string { + if x != nil { + return x.AuthUrl + } + return "" +} + +func (x *IdentityProvider_Config_OAuth2) GetTokenUrl() string { + if x != nil { + return x.TokenUrl + } + return "" +} + +func (x *IdentityProvider_Config_OAuth2) GetUserInfoUrl() string { + if x != nil { + return x.UserInfoUrl + } + return "" +} + +func (x *IdentityProvider_Config_OAuth2) GetScopes() []string { + if x != nil { + return x.Scopes + } + return nil +} + +func (x *IdentityProvider_Config_OAuth2) GetFieldMapping() *IdentityProvider_Config_FieldMapping { + if x != nil { + return x.FieldMapping + } + return nil +} + +var File_api_v2_idp_service_proto protoreflect.FileDescriptor + +var file_api_v2_idp_service_proto_rawDesc = []byte{ + 0x0a, 0x18, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x69, 0x64, 0x70, 0x5f, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x6d, 0x65, 0x6d, 0x6f, + 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 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, 0x17, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x22, 0xeb, 0x05, 0x0a, 0x10, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, + 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x37, 0x0a, 0x04, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x23, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, + 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x2b, 0x0a, 0x11, 0x69, 0x64, 0x65, + 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, + 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x3d, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, + 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x06, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x1a, 0xdd, 0x03, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x12, 0x46, 0x0a, 0x06, 0x6f, 0x61, 0x75, 0x74, 0x68, 0x32, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x2c, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, + 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, + 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x32, 0x48, 0x00, + 0x52, 0x06, 0x6f, 0x61, 0x75, 0x74, 0x68, 0x32, 0x1a, 0x67, 0x0a, 0x0c, 0x46, 0x69, 0x65, 0x6c, + 0x64, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x64, 0x65, 0x6e, + 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, 0x64, + 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x70, + 0x6c, 0x61, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, + 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, + 0x6c, 0x1a, 0x97, 0x02, 0x0a, 0x06, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x32, 0x12, 0x1b, 0x0a, 0x09, + 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0c, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, 0x19, + 0x0a, 0x08, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x61, 0x75, 0x74, 0x68, 0x55, 0x72, 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x6f, 0x6b, + 0x65, 0x6e, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 0x55, 0x72, 0x6c, 0x12, 0x22, 0x0a, 0x0d, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, + 0x6e, 0x66, 0x6f, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x75, + 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x55, 0x72, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, + 0x6f, 0x70, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x73, 0x63, 0x6f, 0x70, + 0x65, 0x73, 0x12, 0x57, 0x0a, 0x0d, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x70, 0x70, + 0x69, 0x6e, 0x67, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, + 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, + 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x0c, 0x66, + 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x42, 0x08, 0x0a, 0x06, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x28, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, + 0x10, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, + 0x44, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x4f, 0x41, 0x55, 0x54, 0x48, 0x32, 0x10, 0x01, 0x22, + 0x1e, 0x0a, 0x1c, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, + 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, + 0x6e, 0x0a, 0x1d, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, + 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x4d, 0x0a, 0x12, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x70, 0x72, 0x6f, + 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6d, + 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x49, 0x64, 0x65, 0x6e, + 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x11, 0x69, 0x64, + 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x22, + 0x30, 0x0a, 0x1a, 0x47, 0x65, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, + 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x22, 0x6a, 0x0a, 0x1b, 0x47, 0x65, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, + 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x4b, 0x0a, 0x11, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x70, 0x72, 0x6f, + 0x76, 0x69, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6d, 0x65, + 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, + 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x10, 0x69, 0x64, 0x65, + 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x22, 0x6c, 0x0a, + 0x1d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, + 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4b, + 0x0a, 0x11, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, + 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, + 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, + 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x10, 0x69, 0x64, 0x65, 0x6e, 0x74, + 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x22, 0x6d, 0x0a, 0x1e, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, + 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4b, 0x0a, + 0x11, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, + 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, + 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x10, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, + 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x22, 0xa9, 0x01, 0x0a, 0x1d, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, + 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4b, 0x0a, 0x11, + 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, + 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, + 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x10, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, + 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x6d, 0x0a, 0x1e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4b, 0x0a, 0x11, 0x69, 0x64, 0x65, 0x6e, + 0x74, 0x69, 0x74, 0x79, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x32, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, + 0x64, 0x65, 0x72, 0x52, 0x10, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, + 0x76, 0x69, 0x64, 0x65, 0x72, 0x22, 0x33, 0x0a, 0x1d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x49, + 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x20, 0x0a, 0x1e, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, + 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xf8, 0x06, 0x0a, + 0x17, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, + 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x93, 0x01, 0x0a, 0x15, 0x4c, 0x69, 0x73, + 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, + 0x72, 0x73, 0x12, 0x2a, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, + 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, + 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, + 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x21, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x1b, 0x12, 0x19, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x69, 0x64, 0x65, + 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x12, 0x9d, + 0x01, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, + 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x28, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, + 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x29, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, + 0x47, 0x65, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, + 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x31, 0xda, 0x41, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x24, 0x12, 0x22, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, + 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x96, + 0x01, 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, + 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x2b, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, + 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, + 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x64, 0x65, 0x6e, + 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x21, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1b, 0x22, 0x19, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, + 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x12, 0xe4, 0x01, 0x0a, 0x16, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, + 0x65, 0x72, 0x12, 0x2b, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, + 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x2c, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, + 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x6f, 0xda, + 0x41, 0x1d, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, + 0x64, 0x65, 0x72, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x49, 0x3a, 0x11, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, + 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x32, 0x34, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, + 0x32, 0x2f, 0x7b, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x70, 0x72, 0x6f, 0x76, + 0x69, 0x64, 0x65, 0x72, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, + 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0xa6, + 0x01, 0x0a, 0x16, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, + 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x2b, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, + 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x49, + 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x49, 0x64, 0x65, 0x6e, + 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x31, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x24, 0x2a, 0x22, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x6e, 0x61, + 0x6d, 0x65, 0x3d, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, + 0x64, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x42, 0xa7, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, + 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x42, 0x0f, 0x49, 0x64, + 0x70, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, + 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x75, 0x73, 0x65, 0x6d, + 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x3b, 0x61, 0x70, 0x69, 0x76, + 0x32, 0xa2, 0x02, 0x03, 0x4d, 0x41, 0x58, 0xaa, 0x02, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, + 0x41, 0x70, 0x69, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x41, + 0x70, 0x69, 0x5c, 0x56, 0x32, 0xe2, 0x02, 0x18, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, + 0x69, 0x5c, 0x56, 0x32, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0xea, 0x02, 0x0e, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, + 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_api_v2_idp_service_proto_rawDescOnce sync.Once + file_api_v2_idp_service_proto_rawDescData = file_api_v2_idp_service_proto_rawDesc +) + +func file_api_v2_idp_service_proto_rawDescGZIP() []byte { + file_api_v2_idp_service_proto_rawDescOnce.Do(func() { + file_api_v2_idp_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_v2_idp_service_proto_rawDescData) + }) + return file_api_v2_idp_service_proto_rawDescData +} + +var file_api_v2_idp_service_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_api_v2_idp_service_proto_msgTypes = make([]protoimpl.MessageInfo, 14) +var file_api_v2_idp_service_proto_goTypes = []interface{}{ + (IdentityProvider_Type)(0), // 0: memos.api.v2.IdentityProvider.Type + (*IdentityProvider)(nil), // 1: memos.api.v2.IdentityProvider + (*ListIdentityProvidersRequest)(nil), // 2: memos.api.v2.ListIdentityProvidersRequest + (*ListIdentityProvidersResponse)(nil), // 3: memos.api.v2.ListIdentityProvidersResponse + (*GetIdentityProviderRequest)(nil), // 4: memos.api.v2.GetIdentityProviderRequest + (*GetIdentityProviderResponse)(nil), // 5: memos.api.v2.GetIdentityProviderResponse + (*CreateIdentityProviderRequest)(nil), // 6: memos.api.v2.CreateIdentityProviderRequest + (*CreateIdentityProviderResponse)(nil), // 7: memos.api.v2.CreateIdentityProviderResponse + (*UpdateIdentityProviderRequest)(nil), // 8: memos.api.v2.UpdateIdentityProviderRequest + (*UpdateIdentityProviderResponse)(nil), // 9: memos.api.v2.UpdateIdentityProviderResponse + (*DeleteIdentityProviderRequest)(nil), // 10: memos.api.v2.DeleteIdentityProviderRequest + (*DeleteIdentityProviderResponse)(nil), // 11: memos.api.v2.DeleteIdentityProviderResponse + (*IdentityProvider_Config)(nil), // 12: memos.api.v2.IdentityProvider.Config + (*IdentityProvider_Config_FieldMapping)(nil), // 13: memos.api.v2.IdentityProvider.Config.FieldMapping + (*IdentityProvider_Config_OAuth2)(nil), // 14: memos.api.v2.IdentityProvider.Config.OAuth2 + (*fieldmaskpb.FieldMask)(nil), // 15: google.protobuf.FieldMask +} +var file_api_v2_idp_service_proto_depIdxs = []int32{ + 0, // 0: memos.api.v2.IdentityProvider.type:type_name -> memos.api.v2.IdentityProvider.Type + 12, // 1: memos.api.v2.IdentityProvider.config:type_name -> memos.api.v2.IdentityProvider.Config + 1, // 2: memos.api.v2.ListIdentityProvidersResponse.identity_providers:type_name -> memos.api.v2.IdentityProvider + 1, // 3: memos.api.v2.GetIdentityProviderResponse.identity_provider:type_name -> memos.api.v2.IdentityProvider + 1, // 4: memos.api.v2.CreateIdentityProviderRequest.identity_provider:type_name -> memos.api.v2.IdentityProvider + 1, // 5: memos.api.v2.CreateIdentityProviderResponse.identity_provider:type_name -> memos.api.v2.IdentityProvider + 1, // 6: memos.api.v2.UpdateIdentityProviderRequest.identity_provider:type_name -> memos.api.v2.IdentityProvider + 15, // 7: memos.api.v2.UpdateIdentityProviderRequest.update_mask:type_name -> google.protobuf.FieldMask + 1, // 8: memos.api.v2.UpdateIdentityProviderResponse.identity_provider:type_name -> memos.api.v2.IdentityProvider + 14, // 9: memos.api.v2.IdentityProvider.Config.oauth2:type_name -> memos.api.v2.IdentityProvider.Config.OAuth2 + 13, // 10: memos.api.v2.IdentityProvider.Config.OAuth2.field_mapping:type_name -> memos.api.v2.IdentityProvider.Config.FieldMapping + 2, // 11: memos.api.v2.IdentityProviderService.ListIdentityProviders:input_type -> memos.api.v2.ListIdentityProvidersRequest + 4, // 12: memos.api.v2.IdentityProviderService.GetIdentityProvider:input_type -> memos.api.v2.GetIdentityProviderRequest + 6, // 13: memos.api.v2.IdentityProviderService.CreateIdentityProvider:input_type -> memos.api.v2.CreateIdentityProviderRequest + 8, // 14: memos.api.v2.IdentityProviderService.UpdateIdentityProvider:input_type -> memos.api.v2.UpdateIdentityProviderRequest + 10, // 15: memos.api.v2.IdentityProviderService.DeleteIdentityProvider:input_type -> memos.api.v2.DeleteIdentityProviderRequest + 3, // 16: memos.api.v2.IdentityProviderService.ListIdentityProviders:output_type -> memos.api.v2.ListIdentityProvidersResponse + 5, // 17: memos.api.v2.IdentityProviderService.GetIdentityProvider:output_type -> memos.api.v2.GetIdentityProviderResponse + 7, // 18: memos.api.v2.IdentityProviderService.CreateIdentityProvider:output_type -> memos.api.v2.CreateIdentityProviderResponse + 9, // 19: memos.api.v2.IdentityProviderService.UpdateIdentityProvider:output_type -> memos.api.v2.UpdateIdentityProviderResponse + 11, // 20: memos.api.v2.IdentityProviderService.DeleteIdentityProvider:output_type -> memos.api.v2.DeleteIdentityProviderResponse + 16, // [16:21] is the sub-list for method output_type + 11, // [11:16] is the sub-list for method input_type + 11, // [11:11] is the sub-list for extension type_name + 11, // [11:11] is the sub-list for extension extendee + 0, // [0:11] is the sub-list for field type_name +} + +func init() { file_api_v2_idp_service_proto_init() } +func file_api_v2_idp_service_proto_init() { + if File_api_v2_idp_service_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_api_v2_idp_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*IdentityProvider); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_v2_idp_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListIdentityProvidersRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_v2_idp_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListIdentityProvidersResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_v2_idp_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetIdentityProviderRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_v2_idp_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetIdentityProviderResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_v2_idp_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateIdentityProviderRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_v2_idp_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateIdentityProviderResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_v2_idp_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateIdentityProviderRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_v2_idp_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateIdentityProviderResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_v2_idp_service_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteIdentityProviderRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_v2_idp_service_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteIdentityProviderResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_v2_idp_service_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*IdentityProvider_Config); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_v2_idp_service_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*IdentityProvider_Config_FieldMapping); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_v2_idp_service_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*IdentityProvider_Config_OAuth2); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_api_v2_idp_service_proto_msgTypes[11].OneofWrappers = []interface{}{ + (*IdentityProvider_Config_Oauth2)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_api_v2_idp_service_proto_rawDesc, + NumEnums: 1, + NumMessages: 14, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_api_v2_idp_service_proto_goTypes, + DependencyIndexes: file_api_v2_idp_service_proto_depIdxs, + EnumInfos: file_api_v2_idp_service_proto_enumTypes, + MessageInfos: file_api_v2_idp_service_proto_msgTypes, + }.Build() + File_api_v2_idp_service_proto = out.File + file_api_v2_idp_service_proto_rawDesc = nil + file_api_v2_idp_service_proto_goTypes = nil + file_api_v2_idp_service_proto_depIdxs = nil +} diff --git a/proto/gen/api/v2/idp_service.pb.gw.go b/proto/gen/api/v2/idp_service.pb.gw.go new file mode 100644 index 0000000000000..74bdcb5a369cc --- /dev/null +++ b/proto/gen/api/v2/idp_service.pb.gw.go @@ -0,0 +1,599 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: api/v2/idp_service.proto + +/* +Package apiv2 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package apiv2 + +import ( + "context" + "io" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = metadata.Join + +func request_IdentityProviderService_ListIdentityProviders_0(ctx context.Context, marshaler runtime.Marshaler, client IdentityProviderServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListIdentityProvidersRequest + var metadata runtime.ServerMetadata + + msg, err := client.ListIdentityProviders(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_IdentityProviderService_ListIdentityProviders_0(ctx context.Context, marshaler runtime.Marshaler, server IdentityProviderServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListIdentityProvidersRequest + var metadata runtime.ServerMetadata + + msg, err := server.ListIdentityProviders(ctx, &protoReq) + return msg, metadata, err + +} + +func request_IdentityProviderService_GetIdentityProvider_0(ctx context.Context, marshaler runtime.Marshaler, client IdentityProviderServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetIdentityProviderRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") + } + + protoReq.Name, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) + } + + msg, err := client.GetIdentityProvider(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_IdentityProviderService_GetIdentityProvider_0(ctx context.Context, marshaler runtime.Marshaler, server IdentityProviderServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetIdentityProviderRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") + } + + protoReq.Name, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) + } + + msg, err := server.GetIdentityProvider(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_IdentityProviderService_CreateIdentityProvider_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_IdentityProviderService_CreateIdentityProvider_0(ctx context.Context, marshaler runtime.Marshaler, client IdentityProviderServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq CreateIdentityProviderRequest + 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_IdentityProviderService_CreateIdentityProvider_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.CreateIdentityProvider(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_IdentityProviderService_CreateIdentityProvider_0(ctx context.Context, marshaler runtime.Marshaler, server IdentityProviderServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq CreateIdentityProviderRequest + 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_IdentityProviderService_CreateIdentityProvider_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.CreateIdentityProvider(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_IdentityProviderService_UpdateIdentityProvider_0 = &utilities.DoubleArray{Encoding: map[string]int{"identity_provider": 0, "identityProvider": 1, "name": 2}, Base: []int{1, 3, 4, 5, 2, 0, 0, 0, 0}, Check: []int{0, 1, 1, 1, 2, 5, 2, 3, 4}} +) + +func request_IdentityProviderService_UpdateIdentityProvider_0(ctx context.Context, marshaler runtime.Marshaler, client IdentityProviderServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UpdateIdentityProviderRequest + 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.IdentityProvider); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if protoReq.UpdateMask == nil || len(protoReq.UpdateMask.GetPaths()) == 0 { + if fieldMask, err := runtime.FieldMaskFromRequestBody(newReader(), protoReq.IdentityProvider); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } else { + protoReq.UpdateMask = fieldMask + } + } + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["identity_provider.name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "identity_provider.name") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "identity_provider.name", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "identity_provider.name", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_IdentityProviderService_UpdateIdentityProvider_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.UpdateIdentityProvider(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_IdentityProviderService_UpdateIdentityProvider_0(ctx context.Context, marshaler runtime.Marshaler, server IdentityProviderServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UpdateIdentityProviderRequest + 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.IdentityProvider); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if protoReq.UpdateMask == nil || len(protoReq.UpdateMask.GetPaths()) == 0 { + if fieldMask, err := runtime.FieldMaskFromRequestBody(newReader(), protoReq.IdentityProvider); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } else { + protoReq.UpdateMask = fieldMask + } + } + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["identity_provider.name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "identity_provider.name") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "identity_provider.name", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "identity_provider.name", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_IdentityProviderService_UpdateIdentityProvider_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.UpdateIdentityProvider(ctx, &protoReq) + return msg, metadata, err + +} + +func request_IdentityProviderService_DeleteIdentityProvider_0(ctx context.Context, marshaler runtime.Marshaler, client IdentityProviderServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeleteIdentityProviderRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") + } + + protoReq.Name, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) + } + + msg, err := client.DeleteIdentityProvider(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_IdentityProviderService_DeleteIdentityProvider_0(ctx context.Context, marshaler runtime.Marshaler, server IdentityProviderServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeleteIdentityProviderRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") + } + + protoReq.Name, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) + } + + msg, err := server.DeleteIdentityProvider(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterIdentityProviderServiceHandlerServer registers the http handlers for service IdentityProviderService to "mux". +// UnaryRPC :call IdentityProviderServiceServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterIdentityProviderServiceHandlerFromEndpoint instead. +func RegisterIdentityProviderServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server IdentityProviderServiceServer) error { + + mux.Handle("GET", pattern_IdentityProviderService_ListIdentityProviders_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.IdentityProviderService/ListIdentityProviders", runtime.WithHTTPPathPattern("/api/v2/identityProviders")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_IdentityProviderService_ListIdentityProviders_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_IdentityProviderService_ListIdentityProviders_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_IdentityProviderService_GetIdentityProvider_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.IdentityProviderService/GetIdentityProvider", runtime.WithHTTPPathPattern("/api/v2/{name=identityProviders/*}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_IdentityProviderService_GetIdentityProvider_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_IdentityProviderService_GetIdentityProvider_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_IdentityProviderService_CreateIdentityProvider_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.IdentityProviderService/CreateIdentityProvider", runtime.WithHTTPPathPattern("/api/v2/identityProviders")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_IdentityProviderService_CreateIdentityProvider_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_IdentityProviderService_CreateIdentityProvider_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PATCH", pattern_IdentityProviderService_UpdateIdentityProvider_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.IdentityProviderService/UpdateIdentityProvider", runtime.WithHTTPPathPattern("/api/v2/{identity_provider.name=identityProviders/*}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_IdentityProviderService_UpdateIdentityProvider_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_IdentityProviderService_UpdateIdentityProvider_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_IdentityProviderService_DeleteIdentityProvider_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.IdentityProviderService/DeleteIdentityProvider", runtime.WithHTTPPathPattern("/api/v2/{name=identityProviders/*}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_IdentityProviderService_DeleteIdentityProvider_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_IdentityProviderService_DeleteIdentityProvider_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterIdentityProviderServiceHandlerFromEndpoint is same as RegisterIdentityProviderServiceHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterIdentityProviderServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.DialContext(ctx, endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterIdentityProviderServiceHandler(ctx, mux, conn) +} + +// RegisterIdentityProviderServiceHandler registers the http handlers for service IdentityProviderService to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterIdentityProviderServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterIdentityProviderServiceHandlerClient(ctx, mux, NewIdentityProviderServiceClient(conn)) +} + +// RegisterIdentityProviderServiceHandlerClient registers the http handlers for service IdentityProviderService +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "IdentityProviderServiceClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "IdentityProviderServiceClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "IdentityProviderServiceClient" to call the correct interceptors. +func RegisterIdentityProviderServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client IdentityProviderServiceClient) error { + + mux.Handle("GET", pattern_IdentityProviderService_ListIdentityProviders_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) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.IdentityProviderService/ListIdentityProviders", runtime.WithHTTPPathPattern("/api/v2/identityProviders")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_IdentityProviderService_ListIdentityProviders_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_IdentityProviderService_ListIdentityProviders_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_IdentityProviderService_GetIdentityProvider_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) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.IdentityProviderService/GetIdentityProvider", runtime.WithHTTPPathPattern("/api/v2/{name=identityProviders/*}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_IdentityProviderService_GetIdentityProvider_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_IdentityProviderService_GetIdentityProvider_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_IdentityProviderService_CreateIdentityProvider_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) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.IdentityProviderService/CreateIdentityProvider", runtime.WithHTTPPathPattern("/api/v2/identityProviders")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_IdentityProviderService_CreateIdentityProvider_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_IdentityProviderService_CreateIdentityProvider_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PATCH", pattern_IdentityProviderService_UpdateIdentityProvider_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) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.IdentityProviderService/UpdateIdentityProvider", runtime.WithHTTPPathPattern("/api/v2/{identity_provider.name=identityProviders/*}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_IdentityProviderService_UpdateIdentityProvider_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_IdentityProviderService_UpdateIdentityProvider_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_IdentityProviderService_DeleteIdentityProvider_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) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.IdentityProviderService/DeleteIdentityProvider", runtime.WithHTTPPathPattern("/api/v2/{name=identityProviders/*}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_IdentityProviderService_DeleteIdentityProvider_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_IdentityProviderService_DeleteIdentityProvider_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_IdentityProviderService_ListIdentityProviders_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v2", "identityProviders"}, "")) + + pattern_IdentityProviderService_GetIdentityProvider_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3}, []string{"api", "v2", "identityProviders", "name"}, "")) + + pattern_IdentityProviderService_CreateIdentityProvider_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v2", "identityProviders"}, "")) + + pattern_IdentityProviderService_UpdateIdentityProvider_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3}, []string{"api", "v2", "identityProviders", "identity_provider.name"}, "")) + + pattern_IdentityProviderService_DeleteIdentityProvider_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3}, []string{"api", "v2", "identityProviders", "name"}, "")) +) + +var ( + forward_IdentityProviderService_ListIdentityProviders_0 = runtime.ForwardResponseMessage + + forward_IdentityProviderService_GetIdentityProvider_0 = runtime.ForwardResponseMessage + + forward_IdentityProviderService_CreateIdentityProvider_0 = runtime.ForwardResponseMessage + + forward_IdentityProviderService_UpdateIdentityProvider_0 = runtime.ForwardResponseMessage + + forward_IdentityProviderService_DeleteIdentityProvider_0 = runtime.ForwardResponseMessage +) diff --git a/proto/gen/api/v2/idp_service_grpc.pb.go b/proto/gen/api/v2/idp_service_grpc.pb.go new file mode 100644 index 0000000000000..ead15d0607fcf --- /dev/null +++ b/proto/gen/api/v2/idp_service_grpc.pb.go @@ -0,0 +1,262 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: api/v2/idp_service.proto + +package apiv2 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + IdentityProviderService_ListIdentityProviders_FullMethodName = "/memos.api.v2.IdentityProviderService/ListIdentityProviders" + IdentityProviderService_GetIdentityProvider_FullMethodName = "/memos.api.v2.IdentityProviderService/GetIdentityProvider" + IdentityProviderService_CreateIdentityProvider_FullMethodName = "/memos.api.v2.IdentityProviderService/CreateIdentityProvider" + IdentityProviderService_UpdateIdentityProvider_FullMethodName = "/memos.api.v2.IdentityProviderService/UpdateIdentityProvider" + IdentityProviderService_DeleteIdentityProvider_FullMethodName = "/memos.api.v2.IdentityProviderService/DeleteIdentityProvider" +) + +// IdentityProviderServiceClient is the client API for IdentityProviderService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type IdentityProviderServiceClient interface { + ListIdentityProviders(ctx context.Context, in *ListIdentityProvidersRequest, opts ...grpc.CallOption) (*ListIdentityProvidersResponse, error) + GetIdentityProvider(ctx context.Context, in *GetIdentityProviderRequest, opts ...grpc.CallOption) (*GetIdentityProviderResponse, error) + CreateIdentityProvider(ctx context.Context, in *CreateIdentityProviderRequest, opts ...grpc.CallOption) (*CreateIdentityProviderResponse, error) + // UpdateIdentityProvider updates an identity provider. + UpdateIdentityProvider(ctx context.Context, in *UpdateIdentityProviderRequest, opts ...grpc.CallOption) (*UpdateIdentityProviderResponse, error) + // DeleteIdentityProvider deletes an identity provider. + DeleteIdentityProvider(ctx context.Context, in *DeleteIdentityProviderRequest, opts ...grpc.CallOption) (*DeleteIdentityProviderResponse, error) +} + +type identityProviderServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewIdentityProviderServiceClient(cc grpc.ClientConnInterface) IdentityProviderServiceClient { + return &identityProviderServiceClient{cc} +} + +func (c *identityProviderServiceClient) ListIdentityProviders(ctx context.Context, in *ListIdentityProvidersRequest, opts ...grpc.CallOption) (*ListIdentityProvidersResponse, error) { + out := new(ListIdentityProvidersResponse) + err := c.cc.Invoke(ctx, IdentityProviderService_ListIdentityProviders_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *identityProviderServiceClient) GetIdentityProvider(ctx context.Context, in *GetIdentityProviderRequest, opts ...grpc.CallOption) (*GetIdentityProviderResponse, error) { + out := new(GetIdentityProviderResponse) + err := c.cc.Invoke(ctx, IdentityProviderService_GetIdentityProvider_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *identityProviderServiceClient) CreateIdentityProvider(ctx context.Context, in *CreateIdentityProviderRequest, opts ...grpc.CallOption) (*CreateIdentityProviderResponse, error) { + out := new(CreateIdentityProviderResponse) + err := c.cc.Invoke(ctx, IdentityProviderService_CreateIdentityProvider_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *identityProviderServiceClient) UpdateIdentityProvider(ctx context.Context, in *UpdateIdentityProviderRequest, opts ...grpc.CallOption) (*UpdateIdentityProviderResponse, error) { + out := new(UpdateIdentityProviderResponse) + err := c.cc.Invoke(ctx, IdentityProviderService_UpdateIdentityProvider_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *identityProviderServiceClient) DeleteIdentityProvider(ctx context.Context, in *DeleteIdentityProviderRequest, opts ...grpc.CallOption) (*DeleteIdentityProviderResponse, error) { + out := new(DeleteIdentityProviderResponse) + err := c.cc.Invoke(ctx, IdentityProviderService_DeleteIdentityProvider_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// IdentityProviderServiceServer is the server API for IdentityProviderService service. +// All implementations must embed UnimplementedIdentityProviderServiceServer +// for forward compatibility +type IdentityProviderServiceServer interface { + ListIdentityProviders(context.Context, *ListIdentityProvidersRequest) (*ListIdentityProvidersResponse, error) + GetIdentityProvider(context.Context, *GetIdentityProviderRequest) (*GetIdentityProviderResponse, error) + CreateIdentityProvider(context.Context, *CreateIdentityProviderRequest) (*CreateIdentityProviderResponse, error) + // UpdateIdentityProvider updates an identity provider. + UpdateIdentityProvider(context.Context, *UpdateIdentityProviderRequest) (*UpdateIdentityProviderResponse, error) + // DeleteIdentityProvider deletes an identity provider. + DeleteIdentityProvider(context.Context, *DeleteIdentityProviderRequest) (*DeleteIdentityProviderResponse, error) + mustEmbedUnimplementedIdentityProviderServiceServer() +} + +// UnimplementedIdentityProviderServiceServer must be embedded to have forward compatible implementations. +type UnimplementedIdentityProviderServiceServer struct { +} + +func (UnimplementedIdentityProviderServiceServer) ListIdentityProviders(context.Context, *ListIdentityProvidersRequest) (*ListIdentityProvidersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListIdentityProviders not implemented") +} +func (UnimplementedIdentityProviderServiceServer) GetIdentityProvider(context.Context, *GetIdentityProviderRequest) (*GetIdentityProviderResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetIdentityProvider not implemented") +} +func (UnimplementedIdentityProviderServiceServer) CreateIdentityProvider(context.Context, *CreateIdentityProviderRequest) (*CreateIdentityProviderResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateIdentityProvider not implemented") +} +func (UnimplementedIdentityProviderServiceServer) UpdateIdentityProvider(context.Context, *UpdateIdentityProviderRequest) (*UpdateIdentityProviderResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateIdentityProvider not implemented") +} +func (UnimplementedIdentityProviderServiceServer) DeleteIdentityProvider(context.Context, *DeleteIdentityProviderRequest) (*DeleteIdentityProviderResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteIdentityProvider not implemented") +} +func (UnimplementedIdentityProviderServiceServer) mustEmbedUnimplementedIdentityProviderServiceServer() { +} + +// UnsafeIdentityProviderServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to IdentityProviderServiceServer will +// result in compilation errors. +type UnsafeIdentityProviderServiceServer interface { + mustEmbedUnimplementedIdentityProviderServiceServer() +} + +func RegisterIdentityProviderServiceServer(s grpc.ServiceRegistrar, srv IdentityProviderServiceServer) { + s.RegisterService(&IdentityProviderService_ServiceDesc, srv) +} + +func _IdentityProviderService_ListIdentityProviders_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListIdentityProvidersRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(IdentityProviderServiceServer).ListIdentityProviders(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: IdentityProviderService_ListIdentityProviders_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(IdentityProviderServiceServer).ListIdentityProviders(ctx, req.(*ListIdentityProvidersRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _IdentityProviderService_GetIdentityProvider_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetIdentityProviderRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(IdentityProviderServiceServer).GetIdentityProvider(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: IdentityProviderService_GetIdentityProvider_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(IdentityProviderServiceServer).GetIdentityProvider(ctx, req.(*GetIdentityProviderRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _IdentityProviderService_CreateIdentityProvider_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateIdentityProviderRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(IdentityProviderServiceServer).CreateIdentityProvider(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: IdentityProviderService_CreateIdentityProvider_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(IdentityProviderServiceServer).CreateIdentityProvider(ctx, req.(*CreateIdentityProviderRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _IdentityProviderService_UpdateIdentityProvider_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateIdentityProviderRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(IdentityProviderServiceServer).UpdateIdentityProvider(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: IdentityProviderService_UpdateIdentityProvider_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(IdentityProviderServiceServer).UpdateIdentityProvider(ctx, req.(*UpdateIdentityProviderRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _IdentityProviderService_DeleteIdentityProvider_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteIdentityProviderRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(IdentityProviderServiceServer).DeleteIdentityProvider(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: IdentityProviderService_DeleteIdentityProvider_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(IdentityProviderServiceServer).DeleteIdentityProvider(ctx, req.(*DeleteIdentityProviderRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// IdentityProviderService_ServiceDesc is the grpc.ServiceDesc for IdentityProviderService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var IdentityProviderService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "memos.api.v2.IdentityProviderService", + HandlerType: (*IdentityProviderServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListIdentityProviders", + Handler: _IdentityProviderService_ListIdentityProviders_Handler, + }, + { + MethodName: "GetIdentityProvider", + Handler: _IdentityProviderService_GetIdentityProvider_Handler, + }, + { + MethodName: "CreateIdentityProvider", + Handler: _IdentityProviderService_CreateIdentityProvider_Handler, + }, + { + MethodName: "UpdateIdentityProvider", + Handler: _IdentityProviderService_UpdateIdentityProvider_Handler, + }, + { + MethodName: "DeleteIdentityProvider", + Handler: _IdentityProviderService_DeleteIdentityProvider_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "api/v2/idp_service.proto", +} diff --git a/proto/gen/api/v2/inbox_service.pb.go b/proto/gen/api/v2/inbox_service.pb.go index 6359d599caa29..3d4f05671118d 100644 --- a/proto/gen/api/v2/inbox_service.pb.go +++ b/proto/gen/api/v2/inbox_service.pb.go @@ -127,11 +127,11 @@ type Inbox struct { unknownFields protoimpl.UnknownFields // The name of the inbox. - // Format: inboxes/{uid} + // Format: inboxes/{id} Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Format: users/{username} + // Format: users/{id} Sender string `protobuf:"bytes,2,opt,name=sender,proto3" json:"sender,omitempty"` - // Format: users/{username} + // Format: users/{id} Receiver string `protobuf:"bytes,3,opt,name=receiver,proto3" json:"receiver,omitempty"` Status Inbox_Status `protobuf:"varint,4,opt,name=status,proto3,enum=memos.api.v2.Inbox_Status" json:"status,omitempty"` CreateTime *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` @@ -225,7 +225,7 @@ type ListInboxesRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Format: users/{username} + // Format: users/{id} User string `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` } @@ -423,7 +423,7 @@ type DeleteInboxRequest struct { unknownFields protoimpl.UnknownFields // The name of the inbox to delete. - // Format: inboxes/{uid} + // Format: inboxes/{id} Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` } diff --git a/proto/gen/api/v2/link_service.pb.go b/proto/gen/api/v2/link_service.pb.go index f339c82cdd264..4b2d83b4645e1 100644 --- a/proto/gen/api/v2/link_service.pb.go +++ b/proto/gen/api/v2/link_service.pb.go @@ -21,18 +21,16 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -type LinkMetadata struct { +type GetLinkMetadataRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - Image string `protobuf:"bytes,3,opt,name=image,proto3" json:"image,omitempty"` + Link string `protobuf:"bytes,1,opt,name=link,proto3" json:"link,omitempty"` } -func (x *LinkMetadata) Reset() { - *x = LinkMetadata{} +func (x *GetLinkMetadataRequest) Reset() { + *x = GetLinkMetadataRequest{} if protoimpl.UnsafeEnabled { mi := &file_api_v2_link_service_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -40,13 +38,13 @@ func (x *LinkMetadata) Reset() { } } -func (x *LinkMetadata) String() string { +func (x *GetLinkMetadataRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*LinkMetadata) ProtoMessage() {} +func (*GetLinkMetadataRequest) ProtoMessage() {} -func (x *LinkMetadata) ProtoReflect() protoreflect.Message { +func (x *GetLinkMetadataRequest) ProtoReflect() protoreflect.Message { mi := &file_api_v2_link_service_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -58,42 +56,28 @@ func (x *LinkMetadata) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use LinkMetadata.ProtoReflect.Descriptor instead. -func (*LinkMetadata) Descriptor() ([]byte, []int) { +// Deprecated: Use GetLinkMetadataRequest.ProtoReflect.Descriptor instead. +func (*GetLinkMetadataRequest) Descriptor() ([]byte, []int) { return file_api_v2_link_service_proto_rawDescGZIP(), []int{0} } -func (x *LinkMetadata) GetTitle() string { - if x != nil { - return x.Title - } - return "" -} - -func (x *LinkMetadata) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *LinkMetadata) GetImage() string { +func (x *GetLinkMetadataRequest) GetLink() string { if x != nil { - return x.Image + return x.Link } return "" } -type GetLinkMetadataRequest struct { +type GetLinkMetadataResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Link string `protobuf:"bytes,1,opt,name=link,proto3" json:"link,omitempty"` + LinkMetadata *LinkMetadata `protobuf:"bytes,1,opt,name=link_metadata,json=linkMetadata,proto3" json:"link_metadata,omitempty"` } -func (x *GetLinkMetadataRequest) Reset() { - *x = GetLinkMetadataRequest{} +func (x *GetLinkMetadataResponse) Reset() { + *x = GetLinkMetadataResponse{} if protoimpl.UnsafeEnabled { mi := &file_api_v2_link_service_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -101,13 +85,13 @@ func (x *GetLinkMetadataRequest) Reset() { } } -func (x *GetLinkMetadataRequest) String() string { +func (x *GetLinkMetadataResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetLinkMetadataRequest) ProtoMessage() {} +func (*GetLinkMetadataResponse) ProtoMessage() {} -func (x *GetLinkMetadataRequest) ProtoReflect() protoreflect.Message { +func (x *GetLinkMetadataResponse) ProtoReflect() protoreflect.Message { mi := &file_api_v2_link_service_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -119,28 +103,30 @@ func (x *GetLinkMetadataRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetLinkMetadataRequest.ProtoReflect.Descriptor instead. -func (*GetLinkMetadataRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use GetLinkMetadataResponse.ProtoReflect.Descriptor instead. +func (*GetLinkMetadataResponse) Descriptor() ([]byte, []int) { return file_api_v2_link_service_proto_rawDescGZIP(), []int{1} } -func (x *GetLinkMetadataRequest) GetLink() string { +func (x *GetLinkMetadataResponse) GetLinkMetadata() *LinkMetadata { if x != nil { - return x.Link + return x.LinkMetadata } - return "" + return nil } -type GetLinkMetadataResponse struct { +type LinkMetadata struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Metadata *LinkMetadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + Image string `protobuf:"bytes,3,opt,name=image,proto3" json:"image,omitempty"` } -func (x *GetLinkMetadataResponse) Reset() { - *x = GetLinkMetadataResponse{} +func (x *LinkMetadata) Reset() { + *x = LinkMetadata{} if protoimpl.UnsafeEnabled { mi := &file_api_v2_link_service_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -148,13 +134,13 @@ func (x *GetLinkMetadataResponse) Reset() { } } -func (x *GetLinkMetadataResponse) String() string { +func (x *LinkMetadata) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetLinkMetadataResponse) ProtoMessage() {} +func (*LinkMetadata) ProtoMessage() {} -func (x *GetLinkMetadataResponse) ProtoReflect() protoreflect.Message { +func (x *LinkMetadata) ProtoReflect() protoreflect.Message { mi := &file_api_v2_link_service_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -166,16 +152,30 @@ func (x *GetLinkMetadataResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetLinkMetadataResponse.ProtoReflect.Descriptor instead. -func (*GetLinkMetadataResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use LinkMetadata.ProtoReflect.Descriptor instead. +func (*LinkMetadata) Descriptor() ([]byte, []int) { return file_api_v2_link_service_proto_rawDescGZIP(), []int{2} } -func (x *GetLinkMetadataResponse) GetMetadata() *LinkMetadata { +func (x *LinkMetadata) GetTitle() string { if x != nil { - return x.Metadata + return x.Title } - return nil + return "" +} + +func (x *LinkMetadata) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *LinkMetadata) GetImage() string { + if x != nil { + return x.Image + } + return "" } var File_api_v2_link_service_proto protoreflect.FileDescriptor @@ -185,41 +185,42 @@ var file_api_v2_link_service_proto_rawDesc = []byte{ 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 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, 0x22, 0x5c, 0x0a, 0x0c, 0x4c, 0x69, 0x6e, 0x6b, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 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, - 0x14, 0x0a, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x69, 0x6d, 0x61, 0x67, 0x65, 0x22, 0x2c, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x6e, 0x6b, - 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x12, 0x0a, 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6c, - 0x69, 0x6e, 0x6b, 0x22, 0x51, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x4d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, - 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1a, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, - 0x4c, 0x69, 0x6e, 0x6b, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x32, 0x87, 0x01, 0x0a, 0x0b, 0x4c, 0x69, 0x6e, 0x6b, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x78, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x6e, - 0x6b, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x24, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, - 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x6e, 0x6b, - 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x25, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, - 0x65, 0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x12, 0x12, 0x10, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0x42, 0xa8, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x32, 0x42, 0x10, 0x4c, 0x69, 0x6e, 0x6b, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x75, 0x73, 0x65, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, - 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, - 0x70, 0x69, 0x2f, 0x76, 0x32, 0x3b, 0x61, 0x70, 0x69, 0x76, 0x32, 0xa2, 0x02, 0x03, 0x4d, 0x41, - 0x58, 0xaa, 0x02, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x70, 0x69, 0x2e, 0x56, 0x32, - 0xca, 0x02, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, 0xe2, - 0x02, 0x18, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, 0x5c, 0x47, - 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x4d, 0x65, 0x6d, - 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x2c, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x4c, 0x69, + 0x6e, 0x6b, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x22, 0x5a, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x6e, 0x6b, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x3f, 0x0a, 0x0d, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x6e, 0x6b, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x52, 0x0c, 0x6c, 0x69, 0x6e, 0x6b, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x22, 0x5c, 0x0a, 0x0c, 0x4c, 0x69, 0x6e, 0x6b, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 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, 0x14, 0x0a, 0x05, 0x69, 0x6d, 0x61, + 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x32, + 0x8c, 0x01, 0x0a, 0x0b, 0x4c, 0x69, 0x6e, 0x6b, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, + 0x7d, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x12, 0x24, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x32, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x1d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x12, 0x15, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, + 0x2f, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x42, 0xa8, + 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x32, 0x42, 0x10, 0x4c, 0x69, 0x6e, 0x6b, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x75, 0x73, 0x65, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x65, 0x6d, + 0x6f, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x76, 0x32, 0x3b, 0x61, 0x70, 0x69, 0x76, 0x32, 0xa2, 0x02, 0x03, 0x4d, 0x41, 0x58, 0xaa, + 0x02, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x70, 0x69, 0x2e, 0x56, 0x32, 0xca, 0x02, + 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, 0xe2, 0x02, 0x18, + 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, 0x5c, 0x47, 0x50, 0x42, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x4d, 0x65, 0x6d, 0x6f, 0x73, + 0x3a, 0x3a, 0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( @@ -236,14 +237,14 @@ func file_api_v2_link_service_proto_rawDescGZIP() []byte { var file_api_v2_link_service_proto_msgTypes = make([]protoimpl.MessageInfo, 3) var file_api_v2_link_service_proto_goTypes = []interface{}{ - (*LinkMetadata)(nil), // 0: memos.api.v2.LinkMetadata - (*GetLinkMetadataRequest)(nil), // 1: memos.api.v2.GetLinkMetadataRequest - (*GetLinkMetadataResponse)(nil), // 2: memos.api.v2.GetLinkMetadataResponse + (*GetLinkMetadataRequest)(nil), // 0: memos.api.v2.GetLinkMetadataRequest + (*GetLinkMetadataResponse)(nil), // 1: memos.api.v2.GetLinkMetadataResponse + (*LinkMetadata)(nil), // 2: memos.api.v2.LinkMetadata } var file_api_v2_link_service_proto_depIdxs = []int32{ - 0, // 0: memos.api.v2.GetLinkMetadataResponse.metadata:type_name -> memos.api.v2.LinkMetadata - 1, // 1: memos.api.v2.LinkService.GetLinkMetadata:input_type -> memos.api.v2.GetLinkMetadataRequest - 2, // 2: memos.api.v2.LinkService.GetLinkMetadata:output_type -> memos.api.v2.GetLinkMetadataResponse + 2, // 0: memos.api.v2.GetLinkMetadataResponse.link_metadata:type_name -> memos.api.v2.LinkMetadata + 0, // 1: memos.api.v2.LinkService.GetLinkMetadata:input_type -> memos.api.v2.GetLinkMetadataRequest + 1, // 2: memos.api.v2.LinkService.GetLinkMetadata:output_type -> memos.api.v2.GetLinkMetadataResponse 2, // [2:3] is the sub-list for method output_type 1, // [1:2] is the sub-list for method input_type 1, // [1:1] is the sub-list for extension type_name @@ -258,7 +259,7 @@ func file_api_v2_link_service_proto_init() { } if !protoimpl.UnsafeEnabled { file_api_v2_link_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LinkMetadata); i { + switch v := v.(*GetLinkMetadataRequest); i { case 0: return &v.state case 1: @@ -270,7 +271,7 @@ func file_api_v2_link_service_proto_init() { } } file_api_v2_link_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetLinkMetadataRequest); i { + switch v := v.(*GetLinkMetadataResponse); i { case 0: return &v.state case 1: @@ -282,7 +283,7 @@ func file_api_v2_link_service_proto_init() { } } file_api_v2_link_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetLinkMetadataResponse); i { + switch v := v.(*LinkMetadata); i { case 0: return &v.state case 1: diff --git a/proto/gen/api/v2/link_service.pb.gw.go b/proto/gen/api/v2/link_service.pb.gw.go index e9bed49136992..fdd0e0e373f8a 100644 --- a/proto/gen/api/v2/link_service.pb.gw.go +++ b/proto/gen/api/v2/link_service.pb.gw.go @@ -81,7 +81,7 @@ func RegisterLinkServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.LinkService/GetLinkMetadata", runtime.WithHTTPPathPattern("/api/v2/metadata")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.LinkService/GetLinkMetadata", runtime.WithHTTPPathPattern("/api/v2/link_metadata")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -145,7 +145,7 @@ func RegisterLinkServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.LinkService/GetLinkMetadata", runtime.WithHTTPPathPattern("/api/v2/metadata")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.LinkService/GetLinkMetadata", runtime.WithHTTPPathPattern("/api/v2/link_metadata")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -165,7 +165,7 @@ func RegisterLinkServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux } var ( - pattern_LinkService_GetLinkMetadata_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v2", "metadata"}, "")) + pattern_LinkService_GetLinkMetadata_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v2", "link_metadata"}, "")) ) var ( diff --git a/proto/gen/api/v2/memo_relation_service.pb.go b/proto/gen/api/v2/memo_relation_service.pb.go index 28d0644dddcb1..62345e78bc0dc 100644 --- a/proto/gen/api/v2/memo_relation_service.pb.go +++ b/proto/gen/api/v2/memo_relation_service.pb.go @@ -74,9 +74,13 @@ type MemoRelation struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - MemoId int32 `protobuf:"varint,1,opt,name=memo_id,json=memoId,proto3" json:"memo_id,omitempty"` - RelatedMemoId int32 `protobuf:"varint,2,opt,name=related_memo_id,json=relatedMemoId,proto3" json:"related_memo_id,omitempty"` - Type MemoRelation_Type `protobuf:"varint,3,opt,name=type,proto3,enum=memos.api.v2.MemoRelation_Type" json:"type,omitempty"` + // The name of memo. + // Format: "memos/{uid}" + Memo string `protobuf:"bytes,1,opt,name=memo,proto3" json:"memo,omitempty"` + // The name of related memo. + // Format: "memos/{uid}" + RelatedMemo string `protobuf:"bytes,2,opt,name=related_memo,json=relatedMemo,proto3" json:"related_memo,omitempty"` + Type MemoRelation_Type `protobuf:"varint,3,opt,name=type,proto3,enum=memos.api.v2.MemoRelation_Type" json:"type,omitempty"` } func (x *MemoRelation) Reset() { @@ -111,18 +115,18 @@ func (*MemoRelation) Descriptor() ([]byte, []int) { return file_api_v2_memo_relation_service_proto_rawDescGZIP(), []int{0} } -func (x *MemoRelation) GetMemoId() int32 { +func (x *MemoRelation) GetMemo() string { if x != nil { - return x.MemoId + return x.Memo } - return 0 + return "" } -func (x *MemoRelation) GetRelatedMemoId() int32 { +func (x *MemoRelation) GetRelatedMemo() string { if x != nil { - return x.RelatedMemoId + return x.RelatedMemo } - return 0 + return "" } func (x *MemoRelation) GetType() MemoRelation_Type { @@ -138,30 +142,30 @@ var file_api_v2_memo_relation_service_proto_rawDesc = []byte{ 0x0a, 0x22, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x32, 0x22, 0xbe, 0x01, 0x0a, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x17, 0x0a, 0x07, 0x6d, 0x65, 0x6d, 0x6f, 0x5f, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6d, 0x65, 0x6d, 0x6f, 0x49, 0x64, 0x12, 0x26, 0x0a, 0x0f, - 0x72, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x6d, 0x65, 0x6d, 0x6f, 0x5f, 0x69, 0x64, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x4d, 0x65, - 0x6d, 0x6f, 0x49, 0x64, 0x12, 0x33, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x32, 0x2e, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x54, - 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x38, 0x0a, 0x04, 0x54, 0x79, 0x70, - 0x65, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, - 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x52, 0x45, 0x46, 0x45, 0x52, - 0x45, 0x4e, 0x43, 0x45, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x4f, 0x4d, 0x4d, 0x45, 0x4e, - 0x54, 0x10, 0x02, 0x42, 0xb0, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, - 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x42, 0x18, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, - 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, - 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x75, 0x73, 0x65, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, - 0x3b, 0x61, 0x70, 0x69, 0x76, 0x32, 0xa2, 0x02, 0x03, 0x4d, 0x41, 0x58, 0xaa, 0x02, 0x0c, 0x4d, - 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x70, 0x69, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x0c, 0x4d, 0x65, - 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, 0xe2, 0x02, 0x18, 0x4d, 0x65, 0x6d, - 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, - 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x76, 0x32, 0x22, 0xb4, 0x01, 0x0a, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x6c, 0x61, 0x74, + 0x65, 0x64, 0x5f, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, + 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x4d, 0x65, 0x6d, 0x6f, 0x12, 0x33, 0x0a, 0x04, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, + 0x38, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x59, 0x50, 0x45, 0x5f, + 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0d, 0x0a, + 0x09, 0x52, 0x45, 0x46, 0x45, 0x52, 0x45, 0x4e, 0x43, 0x45, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, + 0x43, 0x4f, 0x4d, 0x4d, 0x45, 0x4e, 0x54, 0x10, 0x02, 0x42, 0xb0, 0x01, 0x0a, 0x10, 0x63, 0x6f, + 0x6d, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x42, 0x18, + 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x75, 0x73, 0x65, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, + 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x3b, 0x61, 0x70, 0x69, 0x76, 0x32, 0xa2, 0x02, 0x03, 0x4d, + 0x41, 0x58, 0xaa, 0x02, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x70, 0x69, 0x2e, 0x56, + 0x32, 0xca, 0x02, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, + 0xe2, 0x02, 0x18, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, 0x5c, + 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x4d, 0x65, + 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/proto/gen/api/v2/memo_service.pb.go b/proto/gen/api/v2/memo_service.pb.go index ec662e8e03ce1..690b8e4584bdd 100644 --- a/proto/gen/api/v2/memo_service.pb.go +++ b/proto/gen/api/v2/memo_service.pb.go @@ -80,25 +80,26 @@ type Memo struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // id is the system generated unique identifier. - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - // name is the user provided name. - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + // The name of the memo. + // Format: memos/{id} + // id is the system generated id. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // The user defined id of the memo. + Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid,omitempty"` RowStatus RowStatus `protobuf:"varint,3,opt,name=row_status,json=rowStatus,proto3,enum=memos.api.v2.RowStatus" json:"row_status,omitempty"` // The name of the creator. - // Format: users/{username} + // Format: users/{id} Creator string `protobuf:"bytes,4,opt,name=creator,proto3" json:"creator,omitempty"` - CreatorId int32 `protobuf:"varint,5,opt,name=creator_id,json=creatorId,proto3" json:"creator_id,omitempty"` - CreateTime *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` - UpdateTime *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"` - DisplayTime *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=display_time,json=displayTime,proto3" json:"display_time,omitempty"` - Content string `protobuf:"bytes,9,opt,name=content,proto3" json:"content,omitempty"` - Visibility Visibility `protobuf:"varint,10,opt,name=visibility,proto3,enum=memos.api.v2.Visibility" json:"visibility,omitempty"` - Pinned bool `protobuf:"varint,11,opt,name=pinned,proto3" json:"pinned,omitempty"` - ParentId *int32 `protobuf:"varint,12,opt,name=parent_id,json=parentId,proto3,oneof" json:"parent_id,omitempty"` - Resources []*Resource `protobuf:"bytes,13,rep,name=resources,proto3" json:"resources,omitempty"` - Relations []*MemoRelation `protobuf:"bytes,14,rep,name=relations,proto3" json:"relations,omitempty"` - Reactions []*Reaction `protobuf:"bytes,15,rep,name=reactions,proto3" json:"reactions,omitempty"` + CreateTime *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` + UpdateTime *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"` + DisplayTime *timestamppb.Timestamp `protobuf:"bytes,78,opt,name=display_time,json=displayTime,proto3" json:"display_time,omitempty"` + Content string `protobuf:"bytes,8,opt,name=content,proto3" json:"content,omitempty"` + Visibility Visibility `protobuf:"varint,9,opt,name=visibility,proto3,enum=memos.api.v2.Visibility" json:"visibility,omitempty"` + Pinned bool `protobuf:"varint,10,opt,name=pinned,proto3" json:"pinned,omitempty"` + ParentId *int32 `protobuf:"varint,11,opt,name=parent_id,json=parentId,proto3,oneof" json:"parent_id,omitempty"` + Resources []*Resource `protobuf:"bytes,12,rep,name=resources,proto3" json:"resources,omitempty"` + Relations []*MemoRelation `protobuf:"bytes,13,rep,name=relations,proto3" json:"relations,omitempty"` + Reactions []*Reaction `protobuf:"bytes,14,rep,name=reactions,proto3" json:"reactions,omitempty"` } func (x *Memo) Reset() { @@ -133,16 +134,16 @@ func (*Memo) Descriptor() ([]byte, []int) { return file_api_v2_memo_service_proto_rawDescGZIP(), []int{0} } -func (x *Memo) GetId() int32 { +func (x *Memo) GetName() string { if x != nil { - return x.Id + return x.Name } - return 0 + return "" } -func (x *Memo) GetName() string { +func (x *Memo) GetUid() string { if x != nil { - return x.Name + return x.Uid } return "" } @@ -161,13 +162,6 @@ func (x *Memo) GetCreator() string { return "" } -func (x *Memo) GetCreatorId() int32 { - if x != nil { - return x.CreatorId - } - return 0 -} - func (x *Memo) GetCreateTime() *timestamppb.Timestamp { if x != nil { return x.CreateTime @@ -351,7 +345,7 @@ type ListMemosRequest struct { // Provide this to retrieve the subsequent page. PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` // Filter is used to filter memos returned in the list. - // Format: "creator == users/{username} && visibilities == ['PUBLIC', 'PROTECTED']" + // Format: "creator == users/{uid} && visibilities == ['PUBLIC', 'PROTECTED']" Filter string `protobuf:"bytes,3,opt,name=filter,proto3" json:"filter,omitempty"` } @@ -465,16 +459,18 @@ func (x *ListMemosResponse) GetNextPageToken() string { return "" } -type GetMemoRequest struct { +type SearchMemosRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // Filter is used to filter memos returned. + // Format: "creator == users/{uid} && visibilities == ['PUBLIC', 'PROTECTED']" + Filter string `protobuf:"bytes,1,opt,name=filter,proto3" json:"filter,omitempty"` } -func (x *GetMemoRequest) Reset() { - *x = GetMemoRequest{} +func (x *SearchMemosRequest) Reset() { + *x = SearchMemosRequest{} if protoimpl.UnsafeEnabled { mi := &file_api_v2_memo_service_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -482,13 +478,13 @@ func (x *GetMemoRequest) Reset() { } } -func (x *GetMemoRequest) String() string { +func (x *SearchMemosRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetMemoRequest) ProtoMessage() {} +func (*SearchMemosRequest) ProtoMessage() {} -func (x *GetMemoRequest) ProtoReflect() protoreflect.Message { +func (x *SearchMemosRequest) ProtoReflect() protoreflect.Message { mi := &file_api_v2_memo_service_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -500,28 +496,28 @@ func (x *GetMemoRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetMemoRequest.ProtoReflect.Descriptor instead. -func (*GetMemoRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use SearchMemosRequest.ProtoReflect.Descriptor instead. +func (*SearchMemosRequest) Descriptor() ([]byte, []int) { return file_api_v2_memo_service_proto_rawDescGZIP(), []int{5} } -func (x *GetMemoRequest) GetId() int32 { +func (x *SearchMemosRequest) GetFilter() string { if x != nil { - return x.Id + return x.Filter } - return 0 + return "" } -type GetMemoResponse struct { +type SearchMemosResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Memo *Memo `protobuf:"bytes,1,opt,name=memo,proto3" json:"memo,omitempty"` + Memos []*Memo `protobuf:"bytes,1,rep,name=memos,proto3" json:"memos,omitempty"` } -func (x *GetMemoResponse) Reset() { - *x = GetMemoResponse{} +func (x *SearchMemosResponse) Reset() { + *x = SearchMemosResponse{} if protoimpl.UnsafeEnabled { mi := &file_api_v2_memo_service_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -529,13 +525,13 @@ func (x *GetMemoResponse) Reset() { } } -func (x *GetMemoResponse) String() string { +func (x *SearchMemosResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetMemoResponse) ProtoMessage() {} +func (*SearchMemosResponse) ProtoMessage() {} -func (x *GetMemoResponse) ProtoReflect() protoreflect.Message { +func (x *SearchMemosResponse) ProtoReflect() protoreflect.Message { mi := &file_api_v2_memo_service_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -547,28 +543,30 @@ func (x *GetMemoResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetMemoResponse.ProtoReflect.Descriptor instead. -func (*GetMemoResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use SearchMemosResponse.ProtoReflect.Descriptor instead. +func (*SearchMemosResponse) Descriptor() ([]byte, []int) { return file_api_v2_memo_service_proto_rawDescGZIP(), []int{6} } -func (x *GetMemoResponse) GetMemo() *Memo { +func (x *SearchMemosResponse) GetMemos() []*Memo { if x != nil { - return x.Memo + return x.Memos } return nil } -type GetMemoByNameRequest struct { +type GetMemoRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + // The name of the memo. + // Format: memos/{id} Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` } -func (x *GetMemoByNameRequest) Reset() { - *x = GetMemoByNameRequest{} +func (x *GetMemoRequest) Reset() { + *x = GetMemoRequest{} if protoimpl.UnsafeEnabled { mi := &file_api_v2_memo_service_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -576,13 +574,13 @@ func (x *GetMemoByNameRequest) Reset() { } } -func (x *GetMemoByNameRequest) String() string { +func (x *GetMemoRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetMemoByNameRequest) ProtoMessage() {} +func (*GetMemoRequest) ProtoMessage() {} -func (x *GetMemoByNameRequest) ProtoReflect() protoreflect.Message { +func (x *GetMemoRequest) ProtoReflect() protoreflect.Message { mi := &file_api_v2_memo_service_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -594,19 +592,19 @@ func (x *GetMemoByNameRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetMemoByNameRequest.ProtoReflect.Descriptor instead. -func (*GetMemoByNameRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use GetMemoRequest.ProtoReflect.Descriptor instead. +func (*GetMemoRequest) Descriptor() ([]byte, []int) { return file_api_v2_memo_service_proto_rawDescGZIP(), []int{7} } -func (x *GetMemoByNameRequest) GetName() string { +func (x *GetMemoRequest) GetName() string { if x != nil { return x.Name } return "" } -type GetMemoByNameResponse struct { +type GetMemoResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -614,8 +612,8 @@ type GetMemoByNameResponse struct { Memo *Memo `protobuf:"bytes,1,opt,name=memo,proto3" json:"memo,omitempty"` } -func (x *GetMemoByNameResponse) Reset() { - *x = GetMemoByNameResponse{} +func (x *GetMemoResponse) Reset() { + *x = GetMemoResponse{} if protoimpl.UnsafeEnabled { mi := &file_api_v2_memo_service_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -623,13 +621,13 @@ func (x *GetMemoByNameResponse) Reset() { } } -func (x *GetMemoByNameResponse) String() string { +func (x *GetMemoResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetMemoByNameResponse) ProtoMessage() {} +func (*GetMemoResponse) ProtoMessage() {} -func (x *GetMemoByNameResponse) ProtoReflect() protoreflect.Message { +func (x *GetMemoResponse) ProtoReflect() protoreflect.Message { mi := &file_api_v2_memo_service_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -641,12 +639,12 @@ func (x *GetMemoByNameResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetMemoByNameResponse.ProtoReflect.Descriptor instead. -func (*GetMemoByNameResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use GetMemoResponse.ProtoReflect.Descriptor instead. +func (*GetMemoResponse) Descriptor() ([]byte, []int) { return file_api_v2_memo_service_proto_rawDescGZIP(), []int{8} } -func (x *GetMemoByNameResponse) GetMemo() *Memo { +func (x *GetMemoResponse) GetMemo() *Memo { if x != nil { return x.Memo } @@ -760,7 +758,9 @@ type DeleteMemoRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // The name of the memo. + // Format: memos/{id} + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` } func (x *DeleteMemoRequest) Reset() { @@ -795,11 +795,11 @@ func (*DeleteMemoRequest) Descriptor() ([]byte, []int) { return file_api_v2_memo_service_proto_rawDescGZIP(), []int{11} } -func (x *DeleteMemoRequest) GetId() int32 { +func (x *DeleteMemoRequest) GetName() string { if x != nil { - return x.Id + return x.Name } - return 0 + return "" } type DeleteMemoResponse struct { @@ -940,7 +940,9 @@ type SetMemoResourcesRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // The name of the memo. + // Format: memos/{id} + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Resources []*Resource `protobuf:"bytes,2,rep,name=resources,proto3" json:"resources,omitempty"` } @@ -976,11 +978,11 @@ func (*SetMemoResourcesRequest) Descriptor() ([]byte, []int) { return file_api_v2_memo_service_proto_rawDescGZIP(), []int{15} } -func (x *SetMemoResourcesRequest) GetId() int32 { +func (x *SetMemoResourcesRequest) GetName() string { if x != nil { - return x.Id + return x.Name } - return 0 + return "" } func (x *SetMemoResourcesRequest) GetResources() []*Resource { @@ -1033,7 +1035,9 @@ type ListMemoResourcesRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // The name of the memo. + // Format: memos/{id} + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` } func (x *ListMemoResourcesRequest) Reset() { @@ -1068,11 +1072,11 @@ func (*ListMemoResourcesRequest) Descriptor() ([]byte, []int) { return file_api_v2_memo_service_proto_rawDescGZIP(), []int{17} } -func (x *ListMemoResourcesRequest) GetId() int32 { +func (x *ListMemoResourcesRequest) GetName() string { if x != nil { - return x.Id + return x.Name } - return 0 + return "" } type ListMemoResourcesResponse struct { @@ -1127,7 +1131,9 @@ type SetMemoRelationsRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // The name of the memo. + // Format: memos/{id} + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Relations []*MemoRelation `protobuf:"bytes,2,rep,name=relations,proto3" json:"relations,omitempty"` } @@ -1163,11 +1169,11 @@ func (*SetMemoRelationsRequest) Descriptor() ([]byte, []int) { return file_api_v2_memo_service_proto_rawDescGZIP(), []int{19} } -func (x *SetMemoRelationsRequest) GetId() int32 { +func (x *SetMemoRelationsRequest) GetName() string { if x != nil { - return x.Id + return x.Name } - return 0 + return "" } func (x *SetMemoRelationsRequest) GetRelations() []*MemoRelation { @@ -1220,7 +1226,9 @@ type ListMemoRelationsRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // The name of the memo. + // Format: memos/{id} + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` } func (x *ListMemoRelationsRequest) Reset() { @@ -1255,11 +1263,11 @@ func (*ListMemoRelationsRequest) Descriptor() ([]byte, []int) { return file_api_v2_memo_service_proto_rawDescGZIP(), []int{21} } -func (x *ListMemoRelationsRequest) GetId() int32 { +func (x *ListMemoRelationsRequest) GetName() string { if x != nil { - return x.Id + return x.Name } - return 0 + return "" } type ListMemoRelationsResponse struct { @@ -1314,9 +1322,10 @@ type CreateMemoCommentRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // id is the memo id to create comment for. - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Create *CreateMemoRequest `protobuf:"bytes,2,opt,name=create,proto3" json:"create,omitempty"` + // The name of the memo. + // Format: memos/{id} + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Comment *CreateMemoRequest `protobuf:"bytes,2,opt,name=comment,proto3" json:"comment,omitempty"` } func (x *CreateMemoCommentRequest) Reset() { @@ -1351,16 +1360,16 @@ func (*CreateMemoCommentRequest) Descriptor() ([]byte, []int) { return file_api_v2_memo_service_proto_rawDescGZIP(), []int{23} } -func (x *CreateMemoCommentRequest) GetId() int32 { +func (x *CreateMemoCommentRequest) GetName() string { if x != nil { - return x.Id + return x.Name } - return 0 + return "" } -func (x *CreateMemoCommentRequest) GetCreate() *CreateMemoRequest { +func (x *CreateMemoCommentRequest) GetComment() *CreateMemoRequest { if x != nil { - return x.Create + return x.Comment } return nil } @@ -1417,7 +1426,9 @@ type ListMemoCommentsRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // The name of the memo. + // Format: memos/{id} + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` } func (x *ListMemoCommentsRequest) Reset() { @@ -1452,11 +1463,11 @@ func (*ListMemoCommentsRequest) Descriptor() ([]byte, []int) { return file_api_v2_memo_service_proto_rawDescGZIP(), []int{25} } -func (x *ListMemoCommentsRequest) GetId() int32 { +func (x *ListMemoCommentsRequest) GetName() string { if x != nil { - return x.Id + return x.Name } - return 0 + return "" } type ListMemoCommentsResponse struct { @@ -1512,7 +1523,7 @@ type GetUserMemosStatsRequest struct { unknownFields protoimpl.UnknownFields // name is the name of the user to get stats for. - // Format: users/{username} + // Format: users/{id} Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // timezone location // Format: uses tz identifier @@ -1629,7 +1640,9 @@ type ListMemoReactionsRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // The name of the memo. + // Format: memos/{id} + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` } func (x *ListMemoReactionsRequest) Reset() { @@ -1664,11 +1677,11 @@ func (*ListMemoReactionsRequest) Descriptor() ([]byte, []int) { return file_api_v2_memo_service_proto_rawDescGZIP(), []int{29} } -func (x *ListMemoReactionsRequest) GetId() int32 { +func (x *ListMemoReactionsRequest) GetName() string { if x != nil { - return x.Id + return x.Name } - return 0 + return "" } type ListMemoReactionsResponse struct { @@ -1723,7 +1736,9 @@ type UpsertMemoReactionRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // The name of the memo. + // Format: memos/{id} + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Reaction *Reaction `protobuf:"bytes,2,opt,name=reaction,proto3" json:"reaction,omitempty"` } @@ -1759,11 +1774,11 @@ func (*UpsertMemoReactionRequest) Descriptor() ([]byte, []int) { return file_api_v2_memo_service_proto_rawDescGZIP(), []int{31} } -func (x *UpsertMemoReactionRequest) GetId() int32 { +func (x *UpsertMemoReactionRequest) GetName() string { if x != nil { - return x.Id + return x.Name } - return 0 + return "" } func (x *UpsertMemoReactionRequest) GetReaction() *Reaction { @@ -1825,8 +1840,7 @@ type DeleteMemoReactionRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - ReactionId int32 `protobuf:"varint,2,opt,name=reaction_id,json=reactionId,proto3" json:"reaction_id,omitempty"` + ReactionId int32 `protobuf:"varint,1,opt,name=reaction_id,json=reactionId,proto3" json:"reaction_id,omitempty"` } func (x *DeleteMemoReactionRequest) Reset() { @@ -1861,13 +1875,6 @@ func (*DeleteMemoReactionRequest) Descriptor() ([]byte, []int) { return file_api_v2_memo_service_proto_rawDescGZIP(), []int{33} } -func (x *DeleteMemoReactionRequest) GetId() int32 { - if x != nil { - return x.Id - } - return 0 -} - func (x *DeleteMemoReactionRequest) GetReactionId() int32 { if x != nil { return x.ReactionId @@ -1935,310 +1942,312 @@ var file_api_v2_memo_service_proto_rawDesc = []byte{ 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 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, 0x22, 0xaa, 0x05, 0x0a, 0x04, - 0x4d, 0x65, 0x6d, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x36, 0x0a, 0x0a, 0x72, 0x6f, 0x77, 0x5f, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x6d, - 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x6f, 0x77, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x09, 0x72, 0x6f, 0x77, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x12, 0x18, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, - 0x65, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, - 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x12, 0x3b, 0x0a, 0x0b, 0x63, 0x72, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8d, 0x05, 0x0a, 0x04, + 0x4d, 0x65, 0x6d, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x36, 0x0a, 0x0a, 0x72, 0x6f, + 0x77, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, + 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x6f, + 0x77, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x09, 0x72, 0x6f, 0x77, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x3b, 0x0a, 0x0b, + 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 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, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 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, 0x0a, 0x63, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x5f, 0x74, 0x69, 0x6d, 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, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, - 0x69, 0x6d, 0x65, 0x12, 0x3d, 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x74, - 0x69, 0x6d, 0x65, 0x18, 0x08, 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, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x54, 0x69, - 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x09, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x38, 0x0a, 0x0a, - 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x18, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, - 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x0a, 0x76, 0x69, 0x73, 0x69, - 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x69, 0x6e, 0x6e, 0x65, 0x64, - 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x70, 0x69, 0x6e, 0x6e, 0x65, 0x64, 0x12, 0x25, - 0x0a, 0x09, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x0c, 0x20, 0x01, 0x28, - 0x05, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x48, 0x00, 0x52, 0x08, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, - 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x39, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, - 0x12, 0x3d, 0x0a, 0x09, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x0e, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x32, 0x2e, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, - 0x03, 0xe0, 0x41, 0x03, 0x52, 0x09, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, - 0x39, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x0f, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x32, 0x2e, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, - 0x09, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x70, - 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x22, 0x67, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, - 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, - 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x38, 0x0a, 0x0a, 0x76, 0x69, 0x73, 0x69, 0x62, - 0x69, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x6d, 0x65, - 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x56, 0x69, 0x73, 0x69, 0x62, - 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x0a, 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, - 0x79, 0x22, 0x3c, 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x22, - 0x66, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, - 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, - 0x16, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0x65, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x4d, - 0x65, 0x6d, 0x6f, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x28, 0x0a, 0x05, - 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, - 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x65, 0x6d, 0x6f, 0x52, - 0x05, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, - 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x20, - 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, - 0x22, 0x39, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, - 0x2e, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x22, 0x2a, 0x0a, 0x14, 0x47, - 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x3f, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x4d, 0x65, - 0x6d, 0x6f, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x26, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, - 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x65, - 0x6d, 0x6f, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x22, 0x78, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x26, 0x0a, - 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, - 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x65, 0x6d, 0x6f, 0x52, - 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, - 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, - 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, - 0x73, 0x6b, 0x22, 0x3c, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, - 0x22, 0x23, 0x0a, 0x11, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, 0x14, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, - 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, 0x0a, 0x12, 0x45, - 0x78, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0x2f, 0x0a, 0x13, 0x45, 0x78, 0x70, - 0x6f, 0x72, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3d, 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, + 0x79, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x4e, 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, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, + 0x79, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, + 0x38, 0x0a, 0x0a, 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x09, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x32, 0x2e, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x0a, 0x76, + 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x69, 0x6e, + 0x6e, 0x65, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x70, 0x69, 0x6e, 0x6e, 0x65, + 0x64, 0x12, 0x25, 0x0a, 0x09, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x0b, + 0x20, 0x01, 0x28, 0x05, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x48, 0x00, 0x52, 0x08, 0x70, 0x61, 0x72, + 0x65, 0x6e, 0x74, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x39, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, + 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x73, 0x12, 0x3d, 0x0a, 0x09, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x09, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x12, 0x39, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, + 0x0e, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x03, 0xe0, + 0x41, 0x03, 0x52, 0x09, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x0c, 0x0a, + 0x0a, 0x5f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x22, 0x67, 0x0a, 0x11, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x5f, 0x0a, 0x17, 0x53, 0x65, - 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x34, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, + 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x38, 0x0a, 0x0a, 0x76, 0x69, + 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, + 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x56, 0x69, + 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x0a, 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, + 0x6c, 0x69, 0x74, 0x79, 0x22, 0x3c, 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, + 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x04, 0x6d, 0x65, + 0x6d, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x04, 0x6d, 0x65, + 0x6d, 0x6f, 0x22, 0x66, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, + 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, + 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, + 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, + 0x65, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0x65, 0x0a, 0x11, 0x4c, 0x69, + 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x28, 0x0a, 0x05, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, + 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x65, + 0x6d, 0x6f, 0x52, 0x05, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, + 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, + 0x6e, 0x22, 0x2c, 0x0a, 0x12, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4d, 0x65, 0x6d, 0x6f, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, + 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, + 0x3f, 0x0a, 0x13, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x28, 0x0a, 0x05, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x05, 0x6d, 0x65, 0x6d, 0x6f, 0x73, + 0x22, 0x24, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x39, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x6d, + 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x04, 0x6d, 0x65, 0x6d, + 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x04, 0x6d, 0x65, 0x6d, + 0x6f, 0x22, 0x78, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x12, 0x3b, + 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, + 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x3c, 0x0a, 0x12, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x26, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x12, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4d, + 0x65, 0x6d, 0x6f, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x22, 0x27, 0x0a, 0x11, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x22, 0x14, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, 0x0a, 0x12, 0x45, 0x78, 0x70, 0x6f, + 0x72, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, + 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0x2f, 0x0a, 0x13, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, + 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, + 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, + 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x63, 0x0a, 0x17, 0x53, 0x65, 0x74, 0x4d, 0x65, + 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x34, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, + 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x52, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x22, 0x1a, 0x0a, 0x18, + 0x53, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2e, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, + 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x51, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, + 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x52, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x22, 0x1a, 0x0a, 0x18, 0x53, - 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2a, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x4d, - 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x02, 0x69, 0x64, 0x22, 0x51, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x34, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x09, 0x72, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x22, 0x63, 0x0a, 0x17, 0x53, 0x65, 0x74, 0x4d, 0x65, 0x6d, - 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, - 0x64, 0x12, 0x38, 0x0a, 0x09, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x09, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x1a, 0x0a, 0x18, 0x53, + 0x52, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x22, 0x67, 0x0a, 0x17, 0x53, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2a, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x4d, - 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x02, 0x69, 0x64, 0x22, 0x55, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x38, 0x0a, 0x09, 0x72, 0x65, + 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x65, 0x6d, + 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x72, 0x65, 0x6c, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x1a, 0x0a, 0x18, 0x53, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x38, 0x0a, 0x09, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x32, 0x2e, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x09, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x63, 0x0a, 0x18, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x37, 0x0a, 0x06, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x06, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x22, - 0x43, 0x0a, 0x19, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x43, 0x6f, 0x6d, - 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x04, - 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x6d, - 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x04, - 0x6d, 0x65, 0x6d, 0x6f, 0x22, 0x29, 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, - 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, - 0x44, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x43, 0x6f, 0x6d, 0x6d, 0x65, - 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x28, 0x0a, 0x05, 0x6d, - 0x65, 0x6d, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x6d, - 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x05, - 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x22, 0x62, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, - 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x69, 0x6d, 0x65, 0x7a, 0x6f, 0x6e, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x69, 0x6d, 0x65, 0x7a, 0x6f, 0x6e, - 0x65, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0x9f, 0x01, 0x0a, 0x19, 0x47, 0x65, - 0x74, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x48, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x73, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x65, 0x6d, - 0x6f, 0x73, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, - 0x53, 0x74, 0x61, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, - 0x73, 0x1a, 0x38, 0x0a, 0x0a, 0x53, 0x74, 0x61, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, - 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, - 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x2a, 0x0a, 0x18, 0x4c, - 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, 0x51, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, 0x4d, - 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x09, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x5f, 0x0a, 0x19, 0x55, 0x70, + 0x22, 0x2e, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x22, 0x55, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, + 0x09, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, + 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x72, 0x65, + 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x69, 0x0a, 0x18, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x39, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, + 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, + 0x6d, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, + 0x6e, 0x74, 0x22, 0x43, 0x0a, 0x19, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, + 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x26, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, + 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x65, 0x6d, + 0x6f, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x22, 0x2d, 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x4d, + 0x65, 0x6d, 0x6f, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x44, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, + 0x6d, 0x6f, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x28, 0x0a, 0x05, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, + 0x2e, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x05, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x22, 0x62, 0x0a, 0x18, + 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x53, 0x74, 0x61, 0x74, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, + 0x74, 0x69, 0x6d, 0x65, 0x7a, 0x6f, 0x6e, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x74, 0x69, 0x6d, 0x65, 0x7a, 0x6f, 0x6e, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, + 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, + 0x22, 0x9f, 0x01, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x65, 0x6d, 0x6f, + 0x73, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x48, + 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, + 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, + 0x55, 0x73, 0x65, 0x72, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x73, 0x1a, 0x38, 0x0a, 0x0a, 0x53, 0x74, 0x61, 0x74, + 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, + 0x38, 0x01, 0x22, 0x2e, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, + 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x22, 0x51, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, + 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x34, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x32, 0x2e, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x72, 0x65, 0x61, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x63, 0x0a, 0x19, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x4d, + 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x32, 0x0a, 0x08, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x08, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x50, 0x0a, 0x1a, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x32, 0x0a, 0x08, 0x72, 0x65, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, - 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x08, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x50, 0x0a, 0x1a, 0x55, - 0x70, 0x73, 0x65, 0x72, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x08, 0x72, 0x65, 0x61, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, - 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x4c, 0x0a, - 0x19, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, - 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x0a, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x1c, 0x0a, 0x1a, 0x44, - 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2a, 0x50, 0x0a, 0x0a, 0x56, 0x69, 0x73, - 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x1a, 0x0a, 0x16, 0x56, 0x49, 0x53, 0x49, 0x42, - 0x49, 0x4c, 0x49, 0x54, 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, - 0x44, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x50, 0x52, 0x49, 0x56, 0x41, 0x54, 0x45, 0x10, 0x01, - 0x12, 0x0d, 0x0a, 0x09, 0x50, 0x52, 0x4f, 0x54, 0x45, 0x43, 0x54, 0x45, 0x44, 0x10, 0x02, 0x12, - 0x0a, 0x0a, 0x06, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x10, 0x03, 0x32, 0x87, 0x12, 0x0a, 0x0b, - 0x4d, 0x65, 0x6d, 0x6f, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x69, 0x0a, 0x0a, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x12, 0x1f, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x08, 0x72, 0x65, 0x61, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x6d, + 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x08, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x3c, 0x0a, 0x19, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x61, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, + 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x1c, 0x0a, 0x1a, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2a, 0x50, 0x0a, 0x0a, 0x56, 0x69, 0x73, 0x69, + 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x1a, 0x0a, 0x16, 0x56, 0x49, 0x53, 0x49, 0x42, 0x49, + 0x4c, 0x49, 0x54, 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, + 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x50, 0x52, 0x49, 0x56, 0x41, 0x54, 0x45, 0x10, 0x01, 0x12, + 0x0d, 0x0a, 0x09, 0x50, 0x52, 0x4f, 0x54, 0x45, 0x43, 0x54, 0x45, 0x44, 0x10, 0x02, 0x12, 0x0a, + 0x0a, 0x06, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x10, 0x03, 0x32, 0xa6, 0x12, 0x0a, 0x0b, 0x4d, + 0x65, 0x6d, 0x6f, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x69, 0x0a, 0x0a, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x12, 0x1f, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, + 0x6d, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, + 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x18, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x12, 0x3a, 0x01, 0x2a, 0x22, 0x0d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, + 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x12, 0x63, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, + 0x6f, 0x73, 0x12, 0x1e, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x15, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0f, 0x12, 0x0d, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x12, 0x70, 0x0a, 0x0b, 0x53, 0x65, + 0x61, 0x72, 0x63, 0x68, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x12, 0x20, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, + 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4d, + 0x65, 0x6d, 0x6f, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6d, 0x65, + 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, + 0x68, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1c, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x12, 0x14, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, + 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x3a, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x12, 0x6d, 0x0a, 0x07, + 0x47, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x12, 0x1c, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x25, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x18, 0x12, 0x16, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x6e, 0x61, + 0x6d, 0x65, 0x3d, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x8d, 0x01, 0x0a, 0x0a, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x12, 0x1f, 0x2e, 0x6d, 0x65, 0x6d, + 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6d, 0x65, + 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3c, 0xda, + 0x41, 0x10, 0x6d, 0x65, 0x6d, 0x6f, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, + 0x73, 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x23, 0x3a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x32, 0x1b, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x6d, 0x65, 0x6d, 0x6f, 0x2e, 0x6e, 0x61, + 0x6d, 0x65, 0x3d, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x76, 0x0a, 0x0a, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x12, 0x1f, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, + 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6d, 0x65, 0x6d, - 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x18, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x12, 0x3a, 0x01, 0x2a, 0x22, 0x0d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, - 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x12, 0x63, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, - 0x6d, 0x6f, 0x73, 0x12, 0x1e, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x15, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0f, 0x12, 0x0d, 0x2f, 0x61, - 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x12, 0x67, 0x0a, 0x07, 0x47, - 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x12, 0x1c, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x1f, 0xda, 0x41, 0x02, 0x69, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x14, - 0x12, 0x12, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, - 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x82, 0x01, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, - 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x22, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x42, 0x79, 0x4e, - 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x6d, 0x65, 0x6d, - 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x6d, - 0x6f, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x28, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1b, 0x12, 0x19, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x6e, 0x61, - 0x6d, 0x65, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x12, 0x89, 0x01, 0x0a, 0x0a, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x12, 0x1f, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x65, - 0x6d, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, - 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, - 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x38, 0xda, 0x41, 0x10, - 0x6d, 0x65, 0x6d, 0x6f, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x3a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x32, 0x17, 0x2f, 0x61, - 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x7b, 0x6d, 0x65, 0x6d, - 0x6f, 0x2e, 0x69, 0x64, 0x7d, 0x12, 0x70, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, - 0x65, 0x6d, 0x6f, 0x12, 0x1f, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1f, 0xda, 0x41, 0x02, 0x69, 0x64, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x14, 0x2a, 0x12, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x65, 0x6d, - 0x6f, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x70, 0x0a, 0x0b, 0x45, 0x78, 0x70, 0x6f, 0x72, - 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x12, 0x20, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x65, 0x6d, 0x6f, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x65, - 0x6d, 0x6f, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1c, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x16, 0x22, 0x14, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x65, 0x6d, - 0x6f, 0x73, 0x3a, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x8f, 0x01, 0x0a, 0x10, 0x53, 0x65, - 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x25, - 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x65, - 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, 0xda, - 0x41, 0x02, 0x69, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x3a, 0x01, 0x2a, 0x22, 0x1c, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x7b, 0x69, 0x64, - 0x7d, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x8f, 0x01, 0x0a, 0x11, - 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x73, 0x12, 0x26, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, - 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, - 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x29, 0xda, 0x41, 0x02, 0x69, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1e, 0x12, - 0x1c, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x7b, - 0x69, 0x64, 0x7d, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x8f, 0x01, - 0x0a, 0x10, 0x53, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x12, 0x25, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x32, 0x2e, 0x53, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, - 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, - 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x2c, 0xda, 0x41, 0x02, 0x69, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x3a, 0x01, - 0x2a, 0x22, 0x1c, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, - 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, - 0x8f, 0x01, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x26, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, - 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x29, 0xda, 0x41, 0x02, 0x69, 0x64, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x1e, 0x12, 0x1c, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x65, 0x6d, - 0x6f, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x12, 0x8e, 0x01, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, - 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x26, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, - 0x6f, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x27, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, 0xda, 0x41, 0x02, 0x69, 0x64, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x22, 0x1b, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x6d, - 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, - 0x74, 0x73, 0x12, 0x8b, 0x01, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x43, - 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x25, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x43, - 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, - 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, 0xda, 0x41, 0x02, 0x69, 0x64, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x65, 0x6d, - 0x6f, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, + 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x25, 0xda, 0x41, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x2a, 0x16, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x6d, 0x65, 0x6d, 0x6f, 0x73, + 0x2f, 0x2a, 0x7d, 0x12, 0x70, 0x0a, 0x0b, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x65, 0x6d, + 0x6f, 0x73, 0x12, 0x20, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x32, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x32, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x22, + 0x14, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x3a, 0x65, + 0x78, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x95, 0x01, 0x0a, 0x10, 0x53, 0x65, 0x74, 0x4d, 0x65, 0x6d, + 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x25, 0x2e, 0x6d, 0x65, 0x6d, + 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x65, 0x74, 0x4d, 0x65, 0x6d, + 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x26, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, + 0x2e, 0x53, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x32, 0xda, 0x41, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x3a, 0x01, 0x2a, 0x22, 0x20, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x6d, 0x65, 0x6d, 0x6f, 0x73, + 0x2f, 0x2a, 0x7d, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x95, 0x01, + 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x73, 0x12, 0x26, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x6d, 0x65, + 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, + 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2f, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x6e, 0x61, + 0x6d, 0x65, 0x3d, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x72, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x95, 0x01, 0x0a, 0x10, 0x53, 0x65, 0x74, 0x4d, 0x65, 0x6d, + 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x25, 0x2e, 0x6d, 0x65, 0x6d, + 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x65, 0x74, 0x4d, 0x65, 0x6d, + 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x26, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, + 0x2e, 0x53, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x32, 0xda, 0x41, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x3a, 0x01, 0x2a, 0x22, 0x20, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x6d, 0x65, 0x6d, 0x6f, 0x73, + 0x2f, 0x2a, 0x7d, 0x2f, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x95, 0x01, + 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x12, 0x26, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x6d, 0x65, + 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, + 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2f, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x6e, 0x61, + 0x6d, 0x65, 0x3d, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x72, 0x65, 0x6c, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x94, 0x01, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x4d, 0x65, 0x6d, 0x6f, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x26, 0x2e, 0x6d, 0x65, + 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x43, 0x6f, 0x6d, + 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2e, 0xda, 0x41, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x22, 0x1f, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x6d, 0x65, 0x6d, 0x6f, 0x73, + 0x2f, 0x2a, 0x7d, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x91, 0x01, 0x0a, + 0x10, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, + 0x73, 0x12, 0x25, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, + 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x2e, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x12, + 0x1f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x6d, + 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x8c, 0x01, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x26, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x65, 0x6d, @@ -2248,47 +2257,47 @@ var file_api_v2_memo_service_proto_rawDesc = []byte{ 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x26, 0xda, 0x41, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x12, 0x13, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x73, 0x12, - 0x8f, 0x01, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x61, 0x63, + 0x95, 0x01, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x26, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x29, 0xda, 0x41, 0x02, 0x69, 0x64, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x1e, 0x12, 0x1c, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x65, 0x6d, - 0x6f, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x12, 0x92, 0x01, 0x0a, 0x12, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x4d, 0x65, 0x6d, 0x6f, - 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x27, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x4d, 0x65, - 0x6d, 0x6f, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x28, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, - 0x2e, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x29, 0xda, 0x41, 0x02, - 0x69, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1e, 0x22, 0x1c, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, - 0x32, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x72, 0x65, 0x61, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0xac, 0x01, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x27, 0x2e, - 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, - 0x65, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, - 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x43, 0xda, 0x41, 0x0e, 0x69, 0x64, 0x2c, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x69, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2c, 0x2a, 0x2a, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x76, 0x32, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x72, 0x65, - 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x69, 0x64, 0x7d, 0x42, 0xa8, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x65, - 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x42, 0x10, 0x4d, 0x65, 0x6d, 0x6f, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x75, 0x73, 0x65, 0x6d, 0x65, - 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, - 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x3b, 0x61, 0x70, 0x69, 0x76, 0x32, - 0xa2, 0x02, 0x03, 0x4d, 0x41, 0x58, 0xaa, 0x02, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x41, - 0x70, 0x69, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, - 0x69, 0x5c, 0x56, 0x32, 0xe2, 0x02, 0x18, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, - 0x5c, 0x56, 0x32, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, - 0x02, 0x0e, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x32, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2f, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x7b, + 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x72, 0x65, + 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x98, 0x01, 0x0a, 0x12, 0x55, 0x70, 0x73, 0x65, + 0x72, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x27, + 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, + 0x73, 0x65, 0x72, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x4d, 0x65, 0x6d, + 0x6f, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x2f, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, + 0x22, 0x20, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, + 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x12, 0x9e, 0x01, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x65, 0x6d, + 0x6f, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x27, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, + 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, + 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x61, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x35, 0xda, 0x41, + 0x0b, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x21, 0x2a, 0x1f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x72, 0x65, 0x61, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x69, 0x64, 0x7d, 0x42, 0xa8, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, + 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x42, 0x10, 0x4d, 0x65, 0x6d, 0x6f, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x75, 0x73, 0x65, 0x6d, 0x65, 0x6d, 0x6f, + 0x73, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, + 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x3b, 0x61, 0x70, 0x69, 0x76, 0x32, 0xa2, 0x02, + 0x03, 0x4d, 0x41, 0x58, 0xaa, 0x02, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x70, 0x69, + 0x2e, 0x56, 0x32, 0xca, 0x02, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, + 0x56, 0x32, 0xe2, 0x02, 0x18, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, + 0x32, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, + 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2312,10 +2321,10 @@ var file_api_v2_memo_service_proto_goTypes = []interface{}{ (*CreateMemoResponse)(nil), // 3: memos.api.v2.CreateMemoResponse (*ListMemosRequest)(nil), // 4: memos.api.v2.ListMemosRequest (*ListMemosResponse)(nil), // 5: memos.api.v2.ListMemosResponse - (*GetMemoRequest)(nil), // 6: memos.api.v2.GetMemoRequest - (*GetMemoResponse)(nil), // 7: memos.api.v2.GetMemoResponse - (*GetMemoByNameRequest)(nil), // 8: memos.api.v2.GetMemoByNameRequest - (*GetMemoByNameResponse)(nil), // 9: memos.api.v2.GetMemoByNameResponse + (*SearchMemosRequest)(nil), // 6: memos.api.v2.SearchMemosRequest + (*SearchMemosResponse)(nil), // 7: memos.api.v2.SearchMemosResponse + (*GetMemoRequest)(nil), // 8: memos.api.v2.GetMemoRequest + (*GetMemoResponse)(nil), // 9: memos.api.v2.GetMemoResponse (*UpdateMemoRequest)(nil), // 10: memos.api.v2.UpdateMemoRequest (*UpdateMemoResponse)(nil), // 11: memos.api.v2.UpdateMemoResponse (*DeleteMemoRequest)(nil), // 12: memos.api.v2.DeleteMemoRequest @@ -2362,8 +2371,8 @@ var file_api_v2_memo_service_proto_depIdxs = []int32{ 0, // 8: memos.api.v2.CreateMemoRequest.visibility:type_name -> memos.api.v2.Visibility 1, // 9: memos.api.v2.CreateMemoResponse.memo:type_name -> memos.api.v2.Memo 1, // 10: memos.api.v2.ListMemosResponse.memos:type_name -> memos.api.v2.Memo - 1, // 11: memos.api.v2.GetMemoResponse.memo:type_name -> memos.api.v2.Memo - 1, // 12: memos.api.v2.GetMemoByNameResponse.memo:type_name -> memos.api.v2.Memo + 1, // 11: memos.api.v2.SearchMemosResponse.memos:type_name -> memos.api.v2.Memo + 1, // 12: memos.api.v2.GetMemoResponse.memo:type_name -> memos.api.v2.Memo 1, // 13: memos.api.v2.UpdateMemoRequest.memo:type_name -> memos.api.v2.Memo 42, // 14: memos.api.v2.UpdateMemoRequest.update_mask:type_name -> google.protobuf.FieldMask 1, // 15: memos.api.v2.UpdateMemoResponse.memo:type_name -> memos.api.v2.Memo @@ -2371,7 +2380,7 @@ var file_api_v2_memo_service_proto_depIdxs = []int32{ 39, // 17: memos.api.v2.ListMemoResourcesResponse.resources:type_name -> memos.api.v2.Resource 40, // 18: memos.api.v2.SetMemoRelationsRequest.relations:type_name -> memos.api.v2.MemoRelation 40, // 19: memos.api.v2.ListMemoRelationsResponse.relations:type_name -> memos.api.v2.MemoRelation - 2, // 20: memos.api.v2.CreateMemoCommentRequest.create:type_name -> memos.api.v2.CreateMemoRequest + 2, // 20: memos.api.v2.CreateMemoCommentRequest.comment:type_name -> memos.api.v2.CreateMemoRequest 1, // 21: memos.api.v2.CreateMemoCommentResponse.memo:type_name -> memos.api.v2.Memo 1, // 22: memos.api.v2.ListMemoCommentsResponse.memos:type_name -> memos.api.v2.Memo 36, // 23: memos.api.v2.GetUserMemosStatsResponse.stats:type_name -> memos.api.v2.GetUserMemosStatsResponse.StatsEntry @@ -2380,8 +2389,8 @@ var file_api_v2_memo_service_proto_depIdxs = []int32{ 41, // 26: memos.api.v2.UpsertMemoReactionResponse.reaction:type_name -> memos.api.v2.Reaction 2, // 27: memos.api.v2.MemoService.CreateMemo:input_type -> memos.api.v2.CreateMemoRequest 4, // 28: memos.api.v2.MemoService.ListMemos:input_type -> memos.api.v2.ListMemosRequest - 6, // 29: memos.api.v2.MemoService.GetMemo:input_type -> memos.api.v2.GetMemoRequest - 8, // 30: memos.api.v2.MemoService.GetMemoByName:input_type -> memos.api.v2.GetMemoByNameRequest + 6, // 29: memos.api.v2.MemoService.SearchMemos:input_type -> memos.api.v2.SearchMemosRequest + 8, // 30: memos.api.v2.MemoService.GetMemo:input_type -> memos.api.v2.GetMemoRequest 10, // 31: memos.api.v2.MemoService.UpdateMemo:input_type -> memos.api.v2.UpdateMemoRequest 12, // 32: memos.api.v2.MemoService.DeleteMemo:input_type -> memos.api.v2.DeleteMemoRequest 14, // 33: memos.api.v2.MemoService.ExportMemos:input_type -> memos.api.v2.ExportMemosRequest @@ -2397,8 +2406,8 @@ var file_api_v2_memo_service_proto_depIdxs = []int32{ 34, // 43: memos.api.v2.MemoService.DeleteMemoReaction:input_type -> memos.api.v2.DeleteMemoReactionRequest 3, // 44: memos.api.v2.MemoService.CreateMemo:output_type -> memos.api.v2.CreateMemoResponse 5, // 45: memos.api.v2.MemoService.ListMemos:output_type -> memos.api.v2.ListMemosResponse - 7, // 46: memos.api.v2.MemoService.GetMemo:output_type -> memos.api.v2.GetMemoResponse - 9, // 47: memos.api.v2.MemoService.GetMemoByName:output_type -> memos.api.v2.GetMemoByNameResponse + 7, // 46: memos.api.v2.MemoService.SearchMemos:output_type -> memos.api.v2.SearchMemosResponse + 9, // 47: memos.api.v2.MemoService.GetMemo:output_type -> memos.api.v2.GetMemoResponse 11, // 48: memos.api.v2.MemoService.UpdateMemo:output_type -> memos.api.v2.UpdateMemoResponse 13, // 49: memos.api.v2.MemoService.DeleteMemo:output_type -> memos.api.v2.DeleteMemoResponse 15, // 50: memos.api.v2.MemoService.ExportMemos:output_type -> memos.api.v2.ExportMemosResponse @@ -2490,7 +2499,7 @@ func file_api_v2_memo_service_proto_init() { } } file_api_v2_memo_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetMemoRequest); i { + switch v := v.(*SearchMemosRequest); i { case 0: return &v.state case 1: @@ -2502,7 +2511,7 @@ func file_api_v2_memo_service_proto_init() { } } file_api_v2_memo_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetMemoResponse); i { + switch v := v.(*SearchMemosResponse); i { case 0: return &v.state case 1: @@ -2514,7 +2523,7 @@ func file_api_v2_memo_service_proto_init() { } } file_api_v2_memo_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetMemoByNameRequest); i { + switch v := v.(*GetMemoRequest); i { case 0: return &v.state case 1: @@ -2526,7 +2535,7 @@ func file_api_v2_memo_service_proto_init() { } } file_api_v2_memo_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetMemoByNameResponse); i { + switch v := v.(*GetMemoResponse); i { case 0: return &v.state case 1: diff --git a/proto/gen/api/v2/memo_service.pb.gw.go b/proto/gen/api/v2/memo_service.pb.gw.go index c6e498f72013a..e7c43ae7e93f3 100644 --- a/proto/gen/api/v2/memo_service.pb.gw.go +++ b/proto/gen/api/v2/memo_service.pb.gw.go @@ -101,60 +101,44 @@ func local_request_MemoService_ListMemos_0(ctx context.Context, marshaler runtim } -func request_MemoService_GetMemo_0(ctx context.Context, marshaler runtime.Marshaler, client MemoServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetMemoRequest - var metadata runtime.ServerMetadata +var ( + filter_MemoService_SearchMemos_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) - var ( - val string - ok bool - err error - _ = err - ) +func request_MemoService_SearchMemos_0(ctx context.Context, marshaler runtime.Marshaler, client MemoServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq SearchMemosRequest + var metadata runtime.ServerMetadata - val, ok = pathParams["id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - protoReq.Id, err = runtime.Int32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_MemoService_SearchMemos_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.GetMemo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.SearchMemos(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_MemoService_GetMemo_0(ctx context.Context, marshaler runtime.Marshaler, server MemoServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetMemoRequest +func local_request_MemoService_SearchMemos_0(ctx context.Context, marshaler runtime.Marshaler, server MemoServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq SearchMemosRequest 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") + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - protoReq.Id, err = runtime.Int32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_MemoService_SearchMemos_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.GetMemo(ctx, &protoReq) + msg, err := server.SearchMemos(ctx, &protoReq) return msg, metadata, err } -func request_MemoService_GetMemoByName_0(ctx context.Context, marshaler runtime.Marshaler, client MemoServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetMemoByNameRequest +func request_MemoService_GetMemo_0(ctx context.Context, marshaler runtime.Marshaler, client MemoServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetMemoRequest var metadata runtime.ServerMetadata var ( @@ -174,13 +158,13 @@ func request_MemoService_GetMemoByName_0(ctx context.Context, marshaler runtime. return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } - msg, err := client.GetMemoByName(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.GetMemo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_MemoService_GetMemoByName_0(ctx context.Context, marshaler runtime.Marshaler, server MemoServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetMemoByNameRequest +func local_request_MemoService_GetMemo_0(ctx context.Context, marshaler runtime.Marshaler, server MemoServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetMemoRequest var metadata runtime.ServerMetadata var ( @@ -200,13 +184,13 @@ func local_request_MemoService_GetMemoByName_0(ctx context.Context, marshaler ru return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } - msg, err := server.GetMemoByName(ctx, &protoReq) + msg, err := server.GetMemo(ctx, &protoReq) return msg, metadata, err } var ( - filter_MemoService_UpdateMemo_0 = &utilities.DoubleArray{Encoding: map[string]int{"memo": 0, "id": 1}, Base: []int{1, 4, 5, 2, 0, 0, 0, 0}, Check: []int{0, 1, 1, 2, 4, 2, 2, 3}} + filter_MemoService_UpdateMemo_0 = &utilities.DoubleArray{Encoding: map[string]int{"memo": 0, "name": 1}, Base: []int{1, 4, 5, 2, 0, 0, 0, 0}, Check: []int{0, 1, 1, 2, 4, 2, 2, 3}} ) func request_MemoService_UpdateMemo_0(ctx context.Context, marshaler runtime.Marshaler, client MemoServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -235,14 +219,14 @@ func request_MemoService_UpdateMemo_0(ctx context.Context, marshaler runtime.Mar _ = err ) - val, ok = pathParams["memo.id"] + val, ok = pathParams["memo.name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "memo.id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "memo.name") } - err = runtime.PopulateFieldFromPath(&protoReq, "memo.id", val) + err = runtime.PopulateFieldFromPath(&protoReq, "memo.name", val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "memo.id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "memo.name", err) } if err := req.ParseForm(); err != nil { @@ -283,14 +267,14 @@ func local_request_MemoService_UpdateMemo_0(ctx context.Context, marshaler runti _ = err ) - val, ok = pathParams["memo.id"] + val, ok = pathParams["memo.name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "memo.id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "memo.name") } - err = runtime.PopulateFieldFromPath(&protoReq, "memo.id", val) + err = runtime.PopulateFieldFromPath(&protoReq, "memo.name", val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "memo.id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "memo.name", err) } if err := req.ParseForm(); err != nil { @@ -316,14 +300,14 @@ func request_MemoService_DeleteMemo_0(ctx context.Context, marshaler runtime.Mar _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Id, err = runtime.Int32(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } msg, err := client.DeleteMemo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -342,14 +326,14 @@ func local_request_MemoService_DeleteMemo_0(ctx context.Context, marshaler runti _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Id, err = runtime.Int32(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } msg, err := server.DeleteMemo(ctx, &protoReq) @@ -412,14 +396,14 @@ func request_MemoService_SetMemoResources_0(ctx context.Context, marshaler runti _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Id, err = runtime.Int32(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } msg, err := client.SetMemoResources(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -446,14 +430,14 @@ func local_request_MemoService_SetMemoResources_0(ctx context.Context, marshaler _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Id, err = runtime.Int32(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } msg, err := server.SetMemoResources(ctx, &protoReq) @@ -472,14 +456,14 @@ func request_MemoService_ListMemoResources_0(ctx context.Context, marshaler runt _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Id, err = runtime.Int32(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } msg, err := client.ListMemoResources(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -498,14 +482,14 @@ func local_request_MemoService_ListMemoResources_0(ctx context.Context, marshale _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Id, err = runtime.Int32(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } msg, err := server.ListMemoResources(ctx, &protoReq) @@ -532,14 +516,14 @@ func request_MemoService_SetMemoRelations_0(ctx context.Context, marshaler runti _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Id, err = runtime.Int32(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } msg, err := client.SetMemoRelations(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -566,14 +550,14 @@ func local_request_MemoService_SetMemoRelations_0(ctx context.Context, marshaler _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Id, err = runtime.Int32(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } msg, err := server.SetMemoRelations(ctx, &protoReq) @@ -592,14 +576,14 @@ func request_MemoService_ListMemoRelations_0(ctx context.Context, marshaler runt _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Id, err = runtime.Int32(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } msg, err := client.ListMemoRelations(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -618,14 +602,14 @@ func local_request_MemoService_ListMemoRelations_0(ctx context.Context, marshale _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Id, err = runtime.Int32(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } msg, err := server.ListMemoRelations(ctx, &protoReq) @@ -634,7 +618,7 @@ func local_request_MemoService_ListMemoRelations_0(ctx context.Context, marshale } var ( - filter_MemoService_CreateMemoComment_0 = &utilities.DoubleArray{Encoding: map[string]int{"id": 0}, Base: []int{1, 2, 0, 0}, Check: []int{0, 1, 2, 2}} + filter_MemoService_CreateMemoComment_0 = &utilities.DoubleArray{Encoding: map[string]int{"name": 0}, Base: []int{1, 2, 0, 0}, Check: []int{0, 1, 2, 2}} ) func request_MemoService_CreateMemoComment_0(ctx context.Context, marshaler runtime.Marshaler, client MemoServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -648,14 +632,14 @@ func request_MemoService_CreateMemoComment_0(ctx context.Context, marshaler runt _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Id, err = runtime.Int32(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } if err := req.ParseForm(); err != nil { @@ -681,14 +665,14 @@ func local_request_MemoService_CreateMemoComment_0(ctx context.Context, marshale _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Id, err = runtime.Int32(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } if err := req.ParseForm(); err != nil { @@ -714,14 +698,14 @@ func request_MemoService_ListMemoComments_0(ctx context.Context, marshaler runti _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Id, err = runtime.Int32(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } msg, err := client.ListMemoComments(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -740,14 +724,14 @@ func local_request_MemoService_ListMemoComments_0(ctx context.Context, marshaler _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Id, err = runtime.Int32(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } msg, err := server.ListMemoComments(ctx, &protoReq) @@ -802,14 +786,14 @@ func request_MemoService_ListMemoReactions_0(ctx context.Context, marshaler runt _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Id, err = runtime.Int32(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } msg, err := client.ListMemoReactions(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -828,14 +812,14 @@ func local_request_MemoService_ListMemoReactions_0(ctx context.Context, marshale _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Id, err = runtime.Int32(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } msg, err := server.ListMemoReactions(ctx, &protoReq) @@ -844,7 +828,7 @@ func local_request_MemoService_ListMemoReactions_0(ctx context.Context, marshale } var ( - filter_MemoService_UpsertMemoReaction_0 = &utilities.DoubleArray{Encoding: map[string]int{"id": 0}, Base: []int{1, 2, 0, 0}, Check: []int{0, 1, 2, 2}} + filter_MemoService_UpsertMemoReaction_0 = &utilities.DoubleArray{Encoding: map[string]int{"name": 0}, Base: []int{1, 2, 0, 0}, Check: []int{0, 1, 2, 2}} ) func request_MemoService_UpsertMemoReaction_0(ctx context.Context, marshaler runtime.Marshaler, client MemoServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -858,14 +842,14 @@ func request_MemoService_UpsertMemoReaction_0(ctx context.Context, marshaler run _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Id, err = runtime.Int32(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } if err := req.ParseForm(); err != nil { @@ -891,14 +875,14 @@ func local_request_MemoService_UpsertMemoReaction_0(ctx context.Context, marshal _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Id, err = runtime.Int32(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } if err := req.ParseForm(); err != nil { @@ -924,16 +908,6 @@ func request_MemoService_DeleteMemoReaction_0(ctx context.Context, marshaler run _ = err ) - val, ok = pathParams["id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") - } - - protoReq.Id, err = runtime.Int32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) - } - val, ok = pathParams["reaction_id"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "reaction_id") @@ -960,16 +934,6 @@ func local_request_MemoService_DeleteMemoReaction_0(ctx context.Context, marshal _ = err ) - val, ok = pathParams["id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") - } - - protoReq.Id, err = runtime.Int32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) - } - val, ok = pathParams["reaction_id"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "reaction_id") @@ -1041,7 +1005,7 @@ func RegisterMemoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux }) - mux.Handle("GET", pattern_MemoService_GetMemo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_MemoService_SearchMemos_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -1049,12 +1013,12 @@ func RegisterMemoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/GetMemo", runtime.WithHTTPPathPattern("/api/v2/memos/{id}")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/SearchMemos", runtime.WithHTTPPathPattern("/api/v2/memos:search")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_MemoService_GetMemo_0(annotatedContext, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_MemoService_SearchMemos_0(annotatedContext, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { @@ -1062,11 +1026,11 @@ func RegisterMemoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux return } - forward_MemoService_GetMemo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_MemoService_SearchMemos_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_MemoService_GetMemoByName_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_MemoService_GetMemo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -1074,12 +1038,12 @@ func RegisterMemoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/GetMemoByName", runtime.WithHTTPPathPattern("/api/v2/memos/name/{name}")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/GetMemo", runtime.WithHTTPPathPattern("/api/v2/{name=memos/*}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_MemoService_GetMemoByName_0(annotatedContext, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_MemoService_GetMemo_0(annotatedContext, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { @@ -1087,7 +1051,7 @@ func RegisterMemoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux return } - forward_MemoService_GetMemoByName_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_MemoService_GetMemo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -1099,7 +1063,7 @@ func RegisterMemoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/UpdateMemo", runtime.WithHTTPPathPattern("/api/v2/memos/{memo.id}")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/UpdateMemo", runtime.WithHTTPPathPattern("/api/v2/{memo.name=memos/*}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1124,7 +1088,7 @@ func RegisterMemoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/DeleteMemo", runtime.WithHTTPPathPattern("/api/v2/memos/{id}")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/DeleteMemo", runtime.WithHTTPPathPattern("/api/v2/{name=memos/*}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1174,7 +1138,7 @@ func RegisterMemoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/SetMemoResources", runtime.WithHTTPPathPattern("/api/v2/memos/{id}/resources")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/SetMemoResources", runtime.WithHTTPPathPattern("/api/v2/{name=memos/*}/resources")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1199,7 +1163,7 @@ func RegisterMemoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/ListMemoResources", runtime.WithHTTPPathPattern("/api/v2/memos/{id}/resources")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/ListMemoResources", runtime.WithHTTPPathPattern("/api/v2/{name=memos/*}/resources")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1224,7 +1188,7 @@ func RegisterMemoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/SetMemoRelations", runtime.WithHTTPPathPattern("/api/v2/memos/{id}/relations")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/SetMemoRelations", runtime.WithHTTPPathPattern("/api/v2/{name=memos/*}/relations")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1249,7 +1213,7 @@ func RegisterMemoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/ListMemoRelations", runtime.WithHTTPPathPattern("/api/v2/memos/{id}/relations")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/ListMemoRelations", runtime.WithHTTPPathPattern("/api/v2/{name=memos/*}/relations")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1274,7 +1238,7 @@ func RegisterMemoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/CreateMemoComment", runtime.WithHTTPPathPattern("/api/v2/memos/{id}/comments")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/CreateMemoComment", runtime.WithHTTPPathPattern("/api/v2/{name=memos/*}/comments")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1299,7 +1263,7 @@ func RegisterMemoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/ListMemoComments", runtime.WithHTTPPathPattern("/api/v2/memos/{id}/comments")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/ListMemoComments", runtime.WithHTTPPathPattern("/api/v2/{name=memos/*}/comments")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1349,7 +1313,7 @@ func RegisterMemoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/ListMemoReactions", runtime.WithHTTPPathPattern("/api/v2/memos/{id}/reactions")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/ListMemoReactions", runtime.WithHTTPPathPattern("/api/v2/{name=memos/*}/reactions")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1374,7 +1338,7 @@ func RegisterMemoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/UpsertMemoReaction", runtime.WithHTTPPathPattern("/api/v2/memos/{id}/reactions")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/UpsertMemoReaction", runtime.WithHTTPPathPattern("/api/v2/{name=memos/*}/reactions")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1399,7 +1363,7 @@ func RegisterMemoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/DeleteMemoReaction", runtime.WithHTTPPathPattern("/api/v2/memos/{id}/reactions/{reaction_id}")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/DeleteMemoReaction", runtime.WithHTTPPathPattern("/api/v2/reactions/{reaction_id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1501,47 +1465,47 @@ func RegisterMemoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux }) - mux.Handle("GET", pattern_MemoService_GetMemo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_MemoService_SearchMemos_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) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/GetMemo", runtime.WithHTTPPathPattern("/api/v2/memos/{id}")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/SearchMemos", runtime.WithHTTPPathPattern("/api/v2/memos:search")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_MemoService_GetMemo_0(annotatedContext, inboundMarshaler, client, req, pathParams) + resp, md, err := request_MemoService_SearchMemos_0(annotatedContext, inboundMarshaler, client, req, pathParams) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MemoService_GetMemo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_MemoService_SearchMemos_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_MemoService_GetMemoByName_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_MemoService_GetMemo_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) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/GetMemoByName", runtime.WithHTTPPathPattern("/api/v2/memos/name/{name}")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/GetMemo", runtime.WithHTTPPathPattern("/api/v2/{name=memos/*}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_MemoService_GetMemoByName_0(annotatedContext, inboundMarshaler, client, req, pathParams) + resp, md, err := request_MemoService_GetMemo_0(annotatedContext, inboundMarshaler, client, req, pathParams) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MemoService_GetMemoByName_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_MemoService_GetMemo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -1551,7 +1515,7 @@ func RegisterMemoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/UpdateMemo", runtime.WithHTTPPathPattern("/api/v2/memos/{memo.id}")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/UpdateMemo", runtime.WithHTTPPathPattern("/api/v2/{memo.name=memos/*}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1573,7 +1537,7 @@ func RegisterMemoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/DeleteMemo", runtime.WithHTTPPathPattern("/api/v2/memos/{id}")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/DeleteMemo", runtime.WithHTTPPathPattern("/api/v2/{name=memos/*}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1617,7 +1581,7 @@ func RegisterMemoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/SetMemoResources", runtime.WithHTTPPathPattern("/api/v2/memos/{id}/resources")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/SetMemoResources", runtime.WithHTTPPathPattern("/api/v2/{name=memos/*}/resources")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1639,7 +1603,7 @@ func RegisterMemoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/ListMemoResources", runtime.WithHTTPPathPattern("/api/v2/memos/{id}/resources")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/ListMemoResources", runtime.WithHTTPPathPattern("/api/v2/{name=memos/*}/resources")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1661,7 +1625,7 @@ func RegisterMemoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/SetMemoRelations", runtime.WithHTTPPathPattern("/api/v2/memos/{id}/relations")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/SetMemoRelations", runtime.WithHTTPPathPattern("/api/v2/{name=memos/*}/relations")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1683,7 +1647,7 @@ func RegisterMemoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/ListMemoRelations", runtime.WithHTTPPathPattern("/api/v2/memos/{id}/relations")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/ListMemoRelations", runtime.WithHTTPPathPattern("/api/v2/{name=memos/*}/relations")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1705,7 +1669,7 @@ func RegisterMemoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/CreateMemoComment", runtime.WithHTTPPathPattern("/api/v2/memos/{id}/comments")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/CreateMemoComment", runtime.WithHTTPPathPattern("/api/v2/{name=memos/*}/comments")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1727,7 +1691,7 @@ func RegisterMemoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/ListMemoComments", runtime.WithHTTPPathPattern("/api/v2/memos/{id}/comments")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/ListMemoComments", runtime.WithHTTPPathPattern("/api/v2/{name=memos/*}/comments")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1771,7 +1735,7 @@ func RegisterMemoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/ListMemoReactions", runtime.WithHTTPPathPattern("/api/v2/memos/{id}/reactions")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/ListMemoReactions", runtime.WithHTTPPathPattern("/api/v2/{name=memos/*}/reactions")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1793,7 +1757,7 @@ func RegisterMemoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/UpsertMemoReaction", runtime.WithHTTPPathPattern("/api/v2/memos/{id}/reactions")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/UpsertMemoReaction", runtime.WithHTTPPathPattern("/api/v2/{name=memos/*}/reactions")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1815,7 +1779,7 @@ func RegisterMemoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/DeleteMemoReaction", runtime.WithHTTPPathPattern("/api/v2/memos/{id}/reactions/{reaction_id}")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/DeleteMemoReaction", runtime.WithHTTPPathPattern("/api/v2/reactions/{reaction_id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1839,35 +1803,35 @@ var ( pattern_MemoService_ListMemos_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v2", "memos"}, "")) - pattern_MemoService_GetMemo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "v2", "memos", "id"}, "")) + pattern_MemoService_SearchMemos_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v2", "memos"}, "search")) - pattern_MemoService_GetMemoByName_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 3}, []string{"api", "v2", "memos", "name"}, "")) + pattern_MemoService_GetMemo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3}, []string{"api", "v2", "memos", "name"}, "")) - pattern_MemoService_UpdateMemo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "v2", "memos", "memo.id"}, "")) + pattern_MemoService_UpdateMemo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3}, []string{"api", "v2", "memos", "memo.name"}, "")) - pattern_MemoService_DeleteMemo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "v2", "memos", "id"}, "")) + pattern_MemoService_DeleteMemo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3}, []string{"api", "v2", "memos", "name"}, "")) pattern_MemoService_ExportMemos_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v2", "memos"}, "export")) - pattern_MemoService_SetMemoResources_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"api", "v2", "memos", "id", "resources"}, "")) + pattern_MemoService_SetMemoResources_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3, 2, 4}, []string{"api", "v2", "memos", "name", "resources"}, "")) - pattern_MemoService_ListMemoResources_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"api", "v2", "memos", "id", "resources"}, "")) + pattern_MemoService_ListMemoResources_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3, 2, 4}, []string{"api", "v2", "memos", "name", "resources"}, "")) - pattern_MemoService_SetMemoRelations_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"api", "v2", "memos", "id", "relations"}, "")) + pattern_MemoService_SetMemoRelations_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3, 2, 4}, []string{"api", "v2", "memos", "name", "relations"}, "")) - pattern_MemoService_ListMemoRelations_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"api", "v2", "memos", "id", "relations"}, "")) + pattern_MemoService_ListMemoRelations_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3, 2, 4}, []string{"api", "v2", "memos", "name", "relations"}, "")) - pattern_MemoService_CreateMemoComment_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"api", "v2", "memos", "id", "comments"}, "")) + pattern_MemoService_CreateMemoComment_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3, 2, 4}, []string{"api", "v2", "memos", "name", "comments"}, "")) - pattern_MemoService_ListMemoComments_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"api", "v2", "memos", "id", "comments"}, "")) + pattern_MemoService_ListMemoComments_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3, 2, 4}, []string{"api", "v2", "memos", "name", "comments"}, "")) pattern_MemoService_GetUserMemosStats_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v2", "memos", "stats"}, "")) - pattern_MemoService_ListMemoReactions_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"api", "v2", "memos", "id", "reactions"}, "")) + pattern_MemoService_ListMemoReactions_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3, 2, 4}, []string{"api", "v2", "memos", "name", "reactions"}, "")) - pattern_MemoService_UpsertMemoReaction_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"api", "v2", "memos", "id", "reactions"}, "")) + pattern_MemoService_UpsertMemoReaction_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3, 2, 4}, []string{"api", "v2", "memos", "name", "reactions"}, "")) - pattern_MemoService_DeleteMemoReaction_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"api", "v2", "memos", "id", "reactions", "reaction_id"}, "")) + pattern_MemoService_DeleteMemoReaction_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "v2", "reactions", "reaction_id"}, "")) ) var ( @@ -1875,9 +1839,9 @@ var ( forward_MemoService_ListMemos_0 = runtime.ForwardResponseMessage - forward_MemoService_GetMemo_0 = runtime.ForwardResponseMessage + forward_MemoService_SearchMemos_0 = runtime.ForwardResponseMessage - forward_MemoService_GetMemoByName_0 = runtime.ForwardResponseMessage + forward_MemoService_GetMemo_0 = runtime.ForwardResponseMessage forward_MemoService_UpdateMemo_0 = runtime.ForwardResponseMessage diff --git a/proto/gen/api/v2/memo_service_grpc.pb.go b/proto/gen/api/v2/memo_service_grpc.pb.go index 1ea896a1a95b0..4b3412ebc1eab 100644 --- a/proto/gen/api/v2/memo_service_grpc.pb.go +++ b/proto/gen/api/v2/memo_service_grpc.pb.go @@ -21,8 +21,8 @@ const _ = grpc.SupportPackageIsVersion7 const ( MemoService_CreateMemo_FullMethodName = "/memos.api.v2.MemoService/CreateMemo" MemoService_ListMemos_FullMethodName = "/memos.api.v2.MemoService/ListMemos" + MemoService_SearchMemos_FullMethodName = "/memos.api.v2.MemoService/SearchMemos" MemoService_GetMemo_FullMethodName = "/memos.api.v2.MemoService/GetMemo" - MemoService_GetMemoByName_FullMethodName = "/memos.api.v2.MemoService/GetMemoByName" MemoService_UpdateMemo_FullMethodName = "/memos.api.v2.MemoService/UpdateMemo" MemoService_DeleteMemo_FullMethodName = "/memos.api.v2.MemoService/DeleteMemo" MemoService_ExportMemos_FullMethodName = "/memos.api.v2.MemoService/ExportMemos" @@ -46,13 +46,13 @@ type MemoServiceClient interface { CreateMemo(ctx context.Context, in *CreateMemoRequest, opts ...grpc.CallOption) (*CreateMemoResponse, error) // ListMemos lists memos with pagination and filter. ListMemos(ctx context.Context, in *ListMemosRequest, opts ...grpc.CallOption) (*ListMemosResponse, error) - // GetMemo gets a memo by id. + // SearchMemos searches memos. + SearchMemos(ctx context.Context, in *SearchMemosRequest, opts ...grpc.CallOption) (*SearchMemosResponse, error) + // GetMemo gets a memo. GetMemo(ctx context.Context, in *GetMemoRequest, opts ...grpc.CallOption) (*GetMemoResponse, error) - // GetMemoByName gets a memo by name. - GetMemoByName(ctx context.Context, in *GetMemoByNameRequest, opts ...grpc.CallOption) (*GetMemoByNameResponse, error) // UpdateMemo updates a memo. UpdateMemo(ctx context.Context, in *UpdateMemoRequest, opts ...grpc.CallOption) (*UpdateMemoResponse, error) - // DeleteMemo deletes a memo by id. + // DeleteMemo deletes a memo. DeleteMemo(ctx context.Context, in *DeleteMemoRequest, opts ...grpc.CallOption) (*DeleteMemoResponse, error) // ExportMemos exports memos. ExportMemos(ctx context.Context, in *ExportMemosRequest, opts ...grpc.CallOption) (*ExportMemosResponse, error) @@ -104,18 +104,18 @@ func (c *memoServiceClient) ListMemos(ctx context.Context, in *ListMemosRequest, return out, nil } -func (c *memoServiceClient) GetMemo(ctx context.Context, in *GetMemoRequest, opts ...grpc.CallOption) (*GetMemoResponse, error) { - out := new(GetMemoResponse) - err := c.cc.Invoke(ctx, MemoService_GetMemo_FullMethodName, in, out, opts...) +func (c *memoServiceClient) SearchMemos(ctx context.Context, in *SearchMemosRequest, opts ...grpc.CallOption) (*SearchMemosResponse, error) { + out := new(SearchMemosResponse) + err := c.cc.Invoke(ctx, MemoService_SearchMemos_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *memoServiceClient) GetMemoByName(ctx context.Context, in *GetMemoByNameRequest, opts ...grpc.CallOption) (*GetMemoByNameResponse, error) { - out := new(GetMemoByNameResponse) - err := c.cc.Invoke(ctx, MemoService_GetMemoByName_FullMethodName, in, out, opts...) +func (c *memoServiceClient) GetMemo(ctx context.Context, in *GetMemoRequest, opts ...grpc.CallOption) (*GetMemoResponse, error) { + out := new(GetMemoResponse) + err := c.cc.Invoke(ctx, MemoService_GetMemo_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -247,13 +247,13 @@ type MemoServiceServer interface { CreateMemo(context.Context, *CreateMemoRequest) (*CreateMemoResponse, error) // ListMemos lists memos with pagination and filter. ListMemos(context.Context, *ListMemosRequest) (*ListMemosResponse, error) - // GetMemo gets a memo by id. + // SearchMemos searches memos. + SearchMemos(context.Context, *SearchMemosRequest) (*SearchMemosResponse, error) + // GetMemo gets a memo. GetMemo(context.Context, *GetMemoRequest) (*GetMemoResponse, error) - // GetMemoByName gets a memo by name. - GetMemoByName(context.Context, *GetMemoByNameRequest) (*GetMemoByNameResponse, error) // UpdateMemo updates a memo. UpdateMemo(context.Context, *UpdateMemoRequest) (*UpdateMemoResponse, error) - // DeleteMemo deletes a memo by id. + // DeleteMemo deletes a memo. DeleteMemo(context.Context, *DeleteMemoRequest) (*DeleteMemoResponse, error) // ExportMemos exports memos. ExportMemos(context.Context, *ExportMemosRequest) (*ExportMemosResponse, error) @@ -290,12 +290,12 @@ func (UnimplementedMemoServiceServer) CreateMemo(context.Context, *CreateMemoReq func (UnimplementedMemoServiceServer) ListMemos(context.Context, *ListMemosRequest) (*ListMemosResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ListMemos not implemented") } +func (UnimplementedMemoServiceServer) SearchMemos(context.Context, *SearchMemosRequest) (*SearchMemosResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SearchMemos not implemented") +} func (UnimplementedMemoServiceServer) GetMemo(context.Context, *GetMemoRequest) (*GetMemoResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetMemo not implemented") } -func (UnimplementedMemoServiceServer) GetMemoByName(context.Context, *GetMemoByNameRequest) (*GetMemoByNameResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetMemoByName not implemented") -} func (UnimplementedMemoServiceServer) UpdateMemo(context.Context, *UpdateMemoRequest) (*UpdateMemoResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateMemo not implemented") } @@ -384,38 +384,38 @@ func _MemoService_ListMemos_Handler(srv interface{}, ctx context.Context, dec fu return interceptor(ctx, in, info, handler) } -func _MemoService_GetMemo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetMemoRequest) +func _MemoService_SearchMemos_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SearchMemosRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(MemoServiceServer).GetMemo(ctx, in) + return srv.(MemoServiceServer).SearchMemos(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: MemoService_GetMemo_FullMethodName, + FullMethod: MemoService_SearchMemos_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MemoServiceServer).GetMemo(ctx, req.(*GetMemoRequest)) + return srv.(MemoServiceServer).SearchMemos(ctx, req.(*SearchMemosRequest)) } return interceptor(ctx, in, info, handler) } -func _MemoService_GetMemoByName_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetMemoByNameRequest) +func _MemoService_GetMemo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetMemoRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(MemoServiceServer).GetMemoByName(ctx, in) + return srv.(MemoServiceServer).GetMemo(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: MemoService_GetMemoByName_FullMethodName, + FullMethod: MemoService_GetMemo_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MemoServiceServer).GetMemoByName(ctx, req.(*GetMemoByNameRequest)) + return srv.(MemoServiceServer).GetMemo(ctx, req.(*GetMemoRequest)) } return interceptor(ctx, in, info, handler) } @@ -670,12 +670,12 @@ var MemoService_ServiceDesc = grpc.ServiceDesc{ Handler: _MemoService_ListMemos_Handler, }, { - MethodName: "GetMemo", - Handler: _MemoService_GetMemo_Handler, + MethodName: "SearchMemos", + Handler: _MemoService_SearchMemos_Handler, }, { - MethodName: "GetMemoByName", - Handler: _MemoService_GetMemoByName_Handler, + MethodName: "GetMemo", + Handler: _MemoService_GetMemo_Handler, }, { MethodName: "UpdateMemo", diff --git a/proto/gen/api/v2/reaction_service.pb.go b/proto/gen/api/v2/reaction_service.pb.go index 62260efd00983..1e3b56bc0cc26 100644 --- a/proto/gen/api/v2/reaction_service.pb.go +++ b/proto/gen/api/v2/reaction_service.pb.go @@ -104,7 +104,9 @@ type Reaction struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // The name of the creator. + // Format: users/{id} Creator string `protobuf:"bytes,2,opt,name=creator,proto3" json:"creator,omitempty"` ContentId string `protobuf:"bytes,3,opt,name=content_id,json=contentId,proto3" json:"content_id,omitempty"` ReactionType Reaction_Type `protobuf:"varint,4,opt,name=reaction_type,json=reactionType,proto3,enum=memos.api.v2.Reaction_Type" json:"reaction_type,omitempty"` diff --git a/proto/gen/api/v2/resource_service.pb.go b/proto/gen/api/v2/resource_service.pb.go index 24c5e356652ec..c58a03b35948a 100644 --- a/proto/gen/api/v2/resource_service.pb.go +++ b/proto/gen/api/v2/resource_service.pb.go @@ -28,16 +28,19 @@ type Resource struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + // The name of the resource. + // Format: resources/{id} // id is the system generated unique identifier. - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - // name is the user provided name. - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // The user defined id of the resource. + Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid,omitempty"` CreateTime *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` Filename string `protobuf:"bytes,4,opt,name=filename,proto3" json:"filename,omitempty"` ExternalLink string `protobuf:"bytes,5,opt,name=external_link,json=externalLink,proto3" json:"external_link,omitempty"` Type string `protobuf:"bytes,6,opt,name=type,proto3" json:"type,omitempty"` Size int64 `protobuf:"varint,7,opt,name=size,proto3" json:"size,omitempty"` - MemoId *int32 `protobuf:"varint,8,opt,name=memo_id,json=memoId,proto3,oneof" json:"memo_id,omitempty"` + // Format: memos/{id} + Memo *string `protobuf:"bytes,8,opt,name=memo,proto3,oneof" json:"memo,omitempty"` } func (x *Resource) Reset() { @@ -72,16 +75,16 @@ func (*Resource) Descriptor() ([]byte, []int) { return file_api_v2_resource_service_proto_rawDescGZIP(), []int{0} } -func (x *Resource) GetId() int32 { +func (x *Resource) GetName() string { if x != nil { - return x.Id + return x.Name } - return 0 + return "" } -func (x *Resource) GetName() string { +func (x *Resource) GetUid() string { if x != nil { - return x.Name + return x.Uid } return "" } @@ -121,11 +124,11 @@ func (x *Resource) GetSize() int64 { return 0 } -func (x *Resource) GetMemoId() int32 { - if x != nil && x.MemoId != nil { - return *x.MemoId +func (x *Resource) GetMemo() string { + if x != nil && x.Memo != nil { + return *x.Memo } - return 0 + return "" } type CreateResourceRequest struct { @@ -136,7 +139,8 @@ type CreateResourceRequest struct { Filename string `protobuf:"bytes,1,opt,name=filename,proto3" json:"filename,omitempty"` ExternalLink string `protobuf:"bytes,2,opt,name=external_link,json=externalLink,proto3" json:"external_link,omitempty"` Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` - MemoId *int32 `protobuf:"varint,4,opt,name=memo_id,json=memoId,proto3,oneof" json:"memo_id,omitempty"` + // Format: memos/{id} + Memo *string `protobuf:"bytes,4,opt,name=memo,proto3,oneof" json:"memo,omitempty"` } func (x *CreateResourceRequest) Reset() { @@ -192,11 +196,11 @@ func (x *CreateResourceRequest) GetType() string { return "" } -func (x *CreateResourceRequest) GetMemoId() int32 { - if x != nil && x.MemoId != nil { - return *x.MemoId +func (x *CreateResourceRequest) GetMemo() string { + if x != nil && x.Memo != nil { + return *x.Memo } - return 0 + return "" } type CreateResourceResponse struct { @@ -331,16 +335,16 @@ func (x *ListResourcesResponse) GetResources() []*Resource { return nil } -type GetResourceRequest struct { +type SearchResourcesRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Filter string `protobuf:"bytes,1,opt,name=filter,proto3" json:"filter,omitempty"` } -func (x *GetResourceRequest) Reset() { - *x = GetResourceRequest{} +func (x *SearchResourcesRequest) Reset() { + *x = SearchResourcesRequest{} if protoimpl.UnsafeEnabled { mi := &file_api_v2_resource_service_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -348,13 +352,13 @@ func (x *GetResourceRequest) Reset() { } } -func (x *GetResourceRequest) String() string { +func (x *SearchResourcesRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetResourceRequest) ProtoMessage() {} +func (*SearchResourcesRequest) ProtoMessage() {} -func (x *GetResourceRequest) ProtoReflect() protoreflect.Message { +func (x *SearchResourcesRequest) ProtoReflect() protoreflect.Message { mi := &file_api_v2_resource_service_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -366,28 +370,28 @@ func (x *GetResourceRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetResourceRequest.ProtoReflect.Descriptor instead. -func (*GetResourceRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use SearchResourcesRequest.ProtoReflect.Descriptor instead. +func (*SearchResourcesRequest) Descriptor() ([]byte, []int) { return file_api_v2_resource_service_proto_rawDescGZIP(), []int{5} } -func (x *GetResourceRequest) GetId() int32 { +func (x *SearchResourcesRequest) GetFilter() string { if x != nil { - return x.Id + return x.Filter } - return 0 + return "" } -type GetResourceResponse struct { +type SearchResourcesResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Resource *Resource `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"` + Resources []*Resource `protobuf:"bytes,1,rep,name=resources,proto3" json:"resources,omitempty"` } -func (x *GetResourceResponse) Reset() { - *x = GetResourceResponse{} +func (x *SearchResourcesResponse) Reset() { + *x = SearchResourcesResponse{} if protoimpl.UnsafeEnabled { mi := &file_api_v2_resource_service_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -395,13 +399,13 @@ func (x *GetResourceResponse) Reset() { } } -func (x *GetResourceResponse) String() string { +func (x *SearchResourcesResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetResourceResponse) ProtoMessage() {} +func (*SearchResourcesResponse) ProtoMessage() {} -func (x *GetResourceResponse) ProtoReflect() protoreflect.Message { +func (x *SearchResourcesResponse) ProtoReflect() protoreflect.Message { mi := &file_api_v2_resource_service_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -413,19 +417,19 @@ func (x *GetResourceResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetResourceResponse.ProtoReflect.Descriptor instead. -func (*GetResourceResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use SearchResourcesResponse.ProtoReflect.Descriptor instead. +func (*SearchResourcesResponse) Descriptor() ([]byte, []int) { return file_api_v2_resource_service_proto_rawDescGZIP(), []int{6} } -func (x *GetResourceResponse) GetResource() *Resource { +func (x *SearchResourcesResponse) GetResources() []*Resource { if x != nil { - return x.Resource + return x.Resources } return nil } -type GetResourceByNameRequest struct { +type GetResourceRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -433,8 +437,8 @@ type GetResourceByNameRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` } -func (x *GetResourceByNameRequest) Reset() { - *x = GetResourceByNameRequest{} +func (x *GetResourceRequest) Reset() { + *x = GetResourceRequest{} if protoimpl.UnsafeEnabled { mi := &file_api_v2_resource_service_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -442,13 +446,13 @@ func (x *GetResourceByNameRequest) Reset() { } } -func (x *GetResourceByNameRequest) String() string { +func (x *GetResourceRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetResourceByNameRequest) ProtoMessage() {} +func (*GetResourceRequest) ProtoMessage() {} -func (x *GetResourceByNameRequest) ProtoReflect() protoreflect.Message { +func (x *GetResourceRequest) ProtoReflect() protoreflect.Message { mi := &file_api_v2_resource_service_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -460,19 +464,19 @@ func (x *GetResourceByNameRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetResourceByNameRequest.ProtoReflect.Descriptor instead. -func (*GetResourceByNameRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use GetResourceRequest.ProtoReflect.Descriptor instead. +func (*GetResourceRequest) Descriptor() ([]byte, []int) { return file_api_v2_resource_service_proto_rawDescGZIP(), []int{7} } -func (x *GetResourceByNameRequest) GetName() string { +func (x *GetResourceRequest) GetName() string { if x != nil { return x.Name } return "" } -type GetResourceByNameResponse struct { +type GetResourceResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -480,8 +484,8 @@ type GetResourceByNameResponse struct { Resource *Resource `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"` } -func (x *GetResourceByNameResponse) Reset() { - *x = GetResourceByNameResponse{} +func (x *GetResourceResponse) Reset() { + *x = GetResourceResponse{} if protoimpl.UnsafeEnabled { mi := &file_api_v2_resource_service_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -489,13 +493,13 @@ func (x *GetResourceByNameResponse) Reset() { } } -func (x *GetResourceByNameResponse) String() string { +func (x *GetResourceResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetResourceByNameResponse) ProtoMessage() {} +func (*GetResourceResponse) ProtoMessage() {} -func (x *GetResourceByNameResponse) ProtoReflect() protoreflect.Message { +func (x *GetResourceResponse) ProtoReflect() protoreflect.Message { mi := &file_api_v2_resource_service_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -507,12 +511,12 @@ func (x *GetResourceByNameResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetResourceByNameResponse.ProtoReflect.Descriptor instead. -func (*GetResourceByNameResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use GetResourceResponse.ProtoReflect.Descriptor instead. +func (*GetResourceResponse) Descriptor() ([]byte, []int) { return file_api_v2_resource_service_proto_rawDescGZIP(), []int{8} } -func (x *GetResourceByNameResponse) GetResource() *Resource { +func (x *GetResourceResponse) GetResource() *Resource { if x != nil { return x.Resource } @@ -626,7 +630,7 @@ type DeleteResourceRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` } func (x *DeleteResourceRequest) Reset() { @@ -661,11 +665,11 @@ func (*DeleteResourceRequest) Descriptor() ([]byte, []int) { return file_api_v2_resource_service_proto_rawDescGZIP(), []int{11} } -func (x *DeleteResourceRequest) GetId() int32 { +func (x *DeleteResourceRequest) GetName() string { if x != nil { - return x.Id + return x.Name } - return 0 + return "" } type DeleteResourceResponse struct { @@ -719,140 +723,139 @@ var file_api_v2_resource_service_proto_rawDesc = []byte{ 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 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, 0x22, 0xfe, 0x01, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x3b, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 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, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, - 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x6c, 0x69, - 0x6e, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, - 0x61, 0x6c, 0x4c, 0x69, 0x6e, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, - 0x7a, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x1c, - 0x0a, 0x07, 0x6d, 0x65, 0x6d, 0x6f, 0x5f, 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x48, - 0x00, 0x52, 0x06, 0x6d, 0x65, 0x6d, 0x6f, 0x49, 0x64, 0x88, 0x01, 0x01, 0x42, 0x0a, 0x0a, 0x08, - 0x5f, 0x6d, 0x65, 0x6d, 0x6f, 0x5f, 0x69, 0x64, 0x22, 0x96, 0x01, 0x0a, 0x15, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x23, - 0x0a, 0x0d, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x6c, 0x69, 0x6e, 0x6b, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x4c, - 0x69, 0x6e, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1c, 0x0a, 0x07, 0x6d, 0x65, 0x6d, 0x6f, 0x5f, - 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x48, 0x00, 0x52, 0x06, 0x6d, 0x65, 0x6d, 0x6f, - 0x49, 0x64, 0x88, 0x01, 0x01, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x6d, 0x65, 0x6d, 0x6f, 0x5f, 0x69, - 0x64, 0x22, 0x4c, 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x08, 0x72, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, - 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22, - 0x16, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x4d, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x52, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x34, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x09, 0x72, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x22, 0x24, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, 0x49, 0x0a, 0x13, - 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x08, 0x72, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22, 0x2e, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x52, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x4f, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x52, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x08, - 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22, 0x88, 0x01, 0x0a, 0x15, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x32, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x08, 0x72, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, - 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, - 0x61, 0x73, 0x6b, 0x22, 0x4c, 0x0a, 0x16, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf8, 0x01, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x3b, 0x0a, 0x0b, 0x63, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 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, 0x0a, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, + 0x6c, 0x69, 0x6e, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x65, 0x78, 0x74, 0x65, + 0x72, 0x6e, 0x61, 0x6c, 0x4c, 0x69, 0x6e, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, + 0x73, 0x69, 0x7a, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, + 0x12, 0x17, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, + 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x88, 0x01, 0x01, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x6d, 0x65, + 0x6d, 0x6f, 0x22, 0x8e, 0x01, 0x0a, 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, + 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x65, 0x78, 0x74, 0x65, + 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x6c, 0x69, 0x6e, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0c, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x4c, 0x69, 0x6e, 0x6b, 0x12, 0x12, 0x0a, + 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, + 0x65, 0x12, 0x17, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, + 0x00, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x88, 0x01, 0x01, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x6d, + 0x65, 0x6d, 0x6f, 0x22, 0x4c, 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x22, 0x27, 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, 0x18, 0x0a, 0x16, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xb7, 0x06, 0x0a, 0x0f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x76, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x23, 0x2e, 0x6d, 0x65, 0x6d, - 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x24, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x22, 0x11, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, - 0x12, 0x73, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x73, 0x12, 0x22, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, + 0x65, 0x22, 0x16, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x4d, 0x0a, 0x15, 0x4c, 0x69, 0x73, + 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x34, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x09, 0x72, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x22, 0x30, 0x0a, 0x16, 0x53, 0x65, 0x61, 0x72, + 0x63, 0x68, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0x4f, 0x0a, 0x17, 0x53, 0x65, + 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x52, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x22, 0x28, 0x0a, 0x12, 0x47, + 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x49, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x08, + 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, + 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x22, 0x88, 0x01, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x32, 0x0a, 0x08, 0x72, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, + 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x3b, + 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, + 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x4c, 0x0a, 0x16, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, + 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22, 0x2b, 0x0a, 0x15, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x18, 0x0a, 0x16, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x32, 0xb5, 0x06, 0x0a, 0x0f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x12, 0x76, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x23, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x6d, 0x65, + 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x22, 0x11, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x76, 0x32, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x73, 0x0a, 0x0d, + 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x22, 0x2e, + 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, + 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x23, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x13, 0x12, 0x11, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x72, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x77, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x12, 0x20, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0xda, 0x41, 0x02, 0x69, 0x64, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x12, 0x16, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, - 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x92, - 0x01, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x79, - 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x26, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, - 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x6d, - 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x52, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x1f, 0x12, 0x1d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x72, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x2f, 0x7b, 0x6e, 0x61, - 0x6d, 0x65, 0x7d, 0x12, 0xa5, 0x01, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x12, 0x11, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x73, 0x12, 0x80, 0x01, 0x0a, 0x0f, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x24, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x6d, 0x65, + 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, + 0x68, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x20, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x12, 0x18, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x76, 0x32, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x3a, 0x73, 0x65, + 0x61, 0x72, 0x63, 0x68, 0x12, 0x7d, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x12, 0x20, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x29, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x12, 0x1a, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, + 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, + 0x2f, 0x2a, 0x7d, 0x12, 0xa9, 0x01, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x23, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x48, 0xda, 0x41, 0x14, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2c, 0x75, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2b, - 0x3a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x32, 0x1f, 0x2f, 0x61, 0x70, 0x69, - 0x2f, 0x76, 0x32, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2f, 0x7b, 0x72, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x69, 0x64, 0x7d, 0x12, 0x80, 0x01, 0x0a, 0x0e, - 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x23, - 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0xda, 0x41, 0x02, 0x69, 0x64, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x2a, 0x16, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, - 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x42, 0xac, - 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x32, 0x42, 0x14, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x75, 0x73, 0x65, 0x6d, 0x65, 0x6d, 0x6f, 0x73, - 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x3b, 0x61, 0x70, 0x69, 0x76, 0x32, 0xa2, 0x02, 0x03, - 0x4d, 0x41, 0x58, 0xaa, 0x02, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x70, 0x69, 0x2e, - 0x56, 0x32, 0xca, 0x02, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, - 0x32, 0xe2, 0x02, 0x18, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, - 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x4d, - 0x65, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x22, 0x4c, 0xda, 0x41, 0x14, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2c, 0x75, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2f, + 0x3a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x32, 0x23, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x6e, 0x61, + 0x6d, 0x65, 0x3d, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x12, + 0x86, 0x01, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x12, 0x23, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x29, 0xda, + 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x2a, 0x1a, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x72, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x42, 0xac, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, + 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x42, 0x14, 0x52, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x75, 0x73, 0x65, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, + 0x32, 0x3b, 0x61, 0x70, 0x69, 0x76, 0x32, 0xa2, 0x02, 0x03, 0x4d, 0x41, 0x58, 0xaa, 0x02, 0x0c, + 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x70, 0x69, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x0c, 0x4d, + 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, 0xe2, 0x02, 0x18, 0x4d, 0x65, + 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, + 0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -869,41 +872,41 @@ func file_api_v2_resource_service_proto_rawDescGZIP() []byte { var file_api_v2_resource_service_proto_msgTypes = make([]protoimpl.MessageInfo, 13) var file_api_v2_resource_service_proto_goTypes = []interface{}{ - (*Resource)(nil), // 0: memos.api.v2.Resource - (*CreateResourceRequest)(nil), // 1: memos.api.v2.CreateResourceRequest - (*CreateResourceResponse)(nil), // 2: memos.api.v2.CreateResourceResponse - (*ListResourcesRequest)(nil), // 3: memos.api.v2.ListResourcesRequest - (*ListResourcesResponse)(nil), // 4: memos.api.v2.ListResourcesResponse - (*GetResourceRequest)(nil), // 5: memos.api.v2.GetResourceRequest - (*GetResourceResponse)(nil), // 6: memos.api.v2.GetResourceResponse - (*GetResourceByNameRequest)(nil), // 7: memos.api.v2.GetResourceByNameRequest - (*GetResourceByNameResponse)(nil), // 8: memos.api.v2.GetResourceByNameResponse - (*UpdateResourceRequest)(nil), // 9: memos.api.v2.UpdateResourceRequest - (*UpdateResourceResponse)(nil), // 10: memos.api.v2.UpdateResourceResponse - (*DeleteResourceRequest)(nil), // 11: memos.api.v2.DeleteResourceRequest - (*DeleteResourceResponse)(nil), // 12: memos.api.v2.DeleteResourceResponse - (*timestamppb.Timestamp)(nil), // 13: google.protobuf.Timestamp - (*fieldmaskpb.FieldMask)(nil), // 14: google.protobuf.FieldMask + (*Resource)(nil), // 0: memos.api.v2.Resource + (*CreateResourceRequest)(nil), // 1: memos.api.v2.CreateResourceRequest + (*CreateResourceResponse)(nil), // 2: memos.api.v2.CreateResourceResponse + (*ListResourcesRequest)(nil), // 3: memos.api.v2.ListResourcesRequest + (*ListResourcesResponse)(nil), // 4: memos.api.v2.ListResourcesResponse + (*SearchResourcesRequest)(nil), // 5: memos.api.v2.SearchResourcesRequest + (*SearchResourcesResponse)(nil), // 6: memos.api.v2.SearchResourcesResponse + (*GetResourceRequest)(nil), // 7: memos.api.v2.GetResourceRequest + (*GetResourceResponse)(nil), // 8: memos.api.v2.GetResourceResponse + (*UpdateResourceRequest)(nil), // 9: memos.api.v2.UpdateResourceRequest + (*UpdateResourceResponse)(nil), // 10: memos.api.v2.UpdateResourceResponse + (*DeleteResourceRequest)(nil), // 11: memos.api.v2.DeleteResourceRequest + (*DeleteResourceResponse)(nil), // 12: memos.api.v2.DeleteResourceResponse + (*timestamppb.Timestamp)(nil), // 13: google.protobuf.Timestamp + (*fieldmaskpb.FieldMask)(nil), // 14: google.protobuf.FieldMask } var file_api_v2_resource_service_proto_depIdxs = []int32{ 13, // 0: memos.api.v2.Resource.create_time:type_name -> google.protobuf.Timestamp 0, // 1: memos.api.v2.CreateResourceResponse.resource:type_name -> memos.api.v2.Resource 0, // 2: memos.api.v2.ListResourcesResponse.resources:type_name -> memos.api.v2.Resource - 0, // 3: memos.api.v2.GetResourceResponse.resource:type_name -> memos.api.v2.Resource - 0, // 4: memos.api.v2.GetResourceByNameResponse.resource:type_name -> memos.api.v2.Resource + 0, // 3: memos.api.v2.SearchResourcesResponse.resources:type_name -> memos.api.v2.Resource + 0, // 4: memos.api.v2.GetResourceResponse.resource:type_name -> memos.api.v2.Resource 0, // 5: memos.api.v2.UpdateResourceRequest.resource:type_name -> memos.api.v2.Resource 14, // 6: memos.api.v2.UpdateResourceRequest.update_mask:type_name -> google.protobuf.FieldMask 0, // 7: memos.api.v2.UpdateResourceResponse.resource:type_name -> memos.api.v2.Resource 1, // 8: memos.api.v2.ResourceService.CreateResource:input_type -> memos.api.v2.CreateResourceRequest 3, // 9: memos.api.v2.ResourceService.ListResources:input_type -> memos.api.v2.ListResourcesRequest - 5, // 10: memos.api.v2.ResourceService.GetResource:input_type -> memos.api.v2.GetResourceRequest - 7, // 11: memos.api.v2.ResourceService.GetResourceByName:input_type -> memos.api.v2.GetResourceByNameRequest + 5, // 10: memos.api.v2.ResourceService.SearchResources:input_type -> memos.api.v2.SearchResourcesRequest + 7, // 11: memos.api.v2.ResourceService.GetResource:input_type -> memos.api.v2.GetResourceRequest 9, // 12: memos.api.v2.ResourceService.UpdateResource:input_type -> memos.api.v2.UpdateResourceRequest 11, // 13: memos.api.v2.ResourceService.DeleteResource:input_type -> memos.api.v2.DeleteResourceRequest 2, // 14: memos.api.v2.ResourceService.CreateResource:output_type -> memos.api.v2.CreateResourceResponse 4, // 15: memos.api.v2.ResourceService.ListResources:output_type -> memos.api.v2.ListResourcesResponse - 6, // 16: memos.api.v2.ResourceService.GetResource:output_type -> memos.api.v2.GetResourceResponse - 8, // 17: memos.api.v2.ResourceService.GetResourceByName:output_type -> memos.api.v2.GetResourceByNameResponse + 6, // 16: memos.api.v2.ResourceService.SearchResources:output_type -> memos.api.v2.SearchResourcesResponse + 8, // 17: memos.api.v2.ResourceService.GetResource:output_type -> memos.api.v2.GetResourceResponse 10, // 18: memos.api.v2.ResourceService.UpdateResource:output_type -> memos.api.v2.UpdateResourceResponse 12, // 19: memos.api.v2.ResourceService.DeleteResource:output_type -> memos.api.v2.DeleteResourceResponse 14, // [14:20] is the sub-list for method output_type @@ -980,7 +983,7 @@ func file_api_v2_resource_service_proto_init() { } } file_api_v2_resource_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetResourceRequest); i { + switch v := v.(*SearchResourcesRequest); i { case 0: return &v.state case 1: @@ -992,7 +995,7 @@ func file_api_v2_resource_service_proto_init() { } } file_api_v2_resource_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetResourceResponse); i { + switch v := v.(*SearchResourcesResponse); i { case 0: return &v.state case 1: @@ -1004,7 +1007,7 @@ func file_api_v2_resource_service_proto_init() { } } file_api_v2_resource_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetResourceByNameRequest); i { + switch v := v.(*GetResourceRequest); i { case 0: return &v.state case 1: @@ -1016,7 +1019,7 @@ func file_api_v2_resource_service_proto_init() { } } file_api_v2_resource_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetResourceByNameResponse); i { + switch v := v.(*GetResourceResponse); i { case 0: return &v.state case 1: diff --git a/proto/gen/api/v2/resource_service.pb.gw.go b/proto/gen/api/v2/resource_service.pb.gw.go index 0e980a9efa0aa..9836d31a404d8 100644 --- a/proto/gen/api/v2/resource_service.pb.gw.go +++ b/proto/gen/api/v2/resource_service.pb.gw.go @@ -85,60 +85,44 @@ func local_request_ResourceService_ListResources_0(ctx context.Context, marshale } -func request_ResourceService_GetResource_0(ctx context.Context, marshaler runtime.Marshaler, client ResourceServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetResourceRequest - var metadata runtime.ServerMetadata +var ( + filter_ResourceService_SearchResources_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) - var ( - val string - ok bool - err error - _ = err - ) +func request_ResourceService_SearchResources_0(ctx context.Context, marshaler runtime.Marshaler, client ResourceServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq SearchResourcesRequest + var metadata runtime.ServerMetadata - val, ok = pathParams["id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - protoReq.Id, err = runtime.Int32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ResourceService_SearchResources_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.GetResource(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.SearchResources(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_ResourceService_GetResource_0(ctx context.Context, marshaler runtime.Marshaler, server ResourceServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetResourceRequest +func local_request_ResourceService_SearchResources_0(ctx context.Context, marshaler runtime.Marshaler, server ResourceServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq SearchResourcesRequest 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") + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - protoReq.Id, err = runtime.Int32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ResourceService_SearchResources_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.GetResource(ctx, &protoReq) + msg, err := server.SearchResources(ctx, &protoReq) return msg, metadata, err } -func request_ResourceService_GetResourceByName_0(ctx context.Context, marshaler runtime.Marshaler, client ResourceServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetResourceByNameRequest +func request_ResourceService_GetResource_0(ctx context.Context, marshaler runtime.Marshaler, client ResourceServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetResourceRequest var metadata runtime.ServerMetadata var ( @@ -158,13 +142,13 @@ func request_ResourceService_GetResourceByName_0(ctx context.Context, marshaler return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } - msg, err := client.GetResourceByName(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.GetResource(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_ResourceService_GetResourceByName_0(ctx context.Context, marshaler runtime.Marshaler, server ResourceServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetResourceByNameRequest +func local_request_ResourceService_GetResource_0(ctx context.Context, marshaler runtime.Marshaler, server ResourceServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetResourceRequest var metadata runtime.ServerMetadata var ( @@ -184,13 +168,13 @@ func local_request_ResourceService_GetResourceByName_0(ctx context.Context, mars return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } - msg, err := server.GetResourceByName(ctx, &protoReq) + msg, err := server.GetResource(ctx, &protoReq) return msg, metadata, err } var ( - filter_ResourceService_UpdateResource_0 = &utilities.DoubleArray{Encoding: map[string]int{"resource": 0, "id": 1}, Base: []int{1, 4, 5, 2, 0, 0, 0, 0}, Check: []int{0, 1, 1, 2, 4, 2, 2, 3}} + filter_ResourceService_UpdateResource_0 = &utilities.DoubleArray{Encoding: map[string]int{"resource": 0, "name": 1}, Base: []int{1, 4, 5, 2, 0, 0, 0, 0}, Check: []int{0, 1, 1, 2, 4, 2, 2, 3}} ) func request_ResourceService_UpdateResource_0(ctx context.Context, marshaler runtime.Marshaler, client ResourceServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -219,14 +203,14 @@ func request_ResourceService_UpdateResource_0(ctx context.Context, marshaler run _ = err ) - val, ok = pathParams["resource.id"] + val, ok = pathParams["resource.name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "resource.id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "resource.name") } - err = runtime.PopulateFieldFromPath(&protoReq, "resource.id", val) + err = runtime.PopulateFieldFromPath(&protoReq, "resource.name", val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "resource.id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "resource.name", err) } if err := req.ParseForm(); err != nil { @@ -267,14 +251,14 @@ func local_request_ResourceService_UpdateResource_0(ctx context.Context, marshal _ = err ) - val, ok = pathParams["resource.id"] + val, ok = pathParams["resource.name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "resource.id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "resource.name") } - err = runtime.PopulateFieldFromPath(&protoReq, "resource.id", val) + err = runtime.PopulateFieldFromPath(&protoReq, "resource.name", val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "resource.id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "resource.name", err) } if err := req.ParseForm(); err != nil { @@ -300,14 +284,14 @@ func request_ResourceService_DeleteResource_0(ctx context.Context, marshaler run _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Id, err = runtime.Int32(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } msg, err := client.DeleteResource(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -326,14 +310,14 @@ func local_request_ResourceService_DeleteResource_0(ctx context.Context, marshal _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Id, err = runtime.Int32(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } msg, err := server.DeleteResource(ctx, &protoReq) @@ -397,7 +381,7 @@ func RegisterResourceServiceHandlerServer(ctx context.Context, mux *runtime.Serv }) - mux.Handle("GET", pattern_ResourceService_GetResource_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_ResourceService_SearchResources_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -405,12 +389,12 @@ func RegisterResourceServiceHandlerServer(ctx context.Context, mux *runtime.Serv inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.ResourceService/GetResource", runtime.WithHTTPPathPattern("/api/v2/resources/{id}")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.ResourceService/SearchResources", runtime.WithHTTPPathPattern("/api/v2/resources:search")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_ResourceService_GetResource_0(annotatedContext, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_ResourceService_SearchResources_0(annotatedContext, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { @@ -418,11 +402,11 @@ func RegisterResourceServiceHandlerServer(ctx context.Context, mux *runtime.Serv return } - forward_ResourceService_GetResource_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_ResourceService_SearchResources_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_ResourceService_GetResourceByName_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_ResourceService_GetResource_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -430,12 +414,12 @@ func RegisterResourceServiceHandlerServer(ctx context.Context, mux *runtime.Serv inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.ResourceService/GetResourceByName", runtime.WithHTTPPathPattern("/api/v2/resources/name/{name}")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.ResourceService/GetResource", runtime.WithHTTPPathPattern("/api/v2/{name=resources/*}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_ResourceService_GetResourceByName_0(annotatedContext, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_ResourceService_GetResource_0(annotatedContext, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { @@ -443,7 +427,7 @@ func RegisterResourceServiceHandlerServer(ctx context.Context, mux *runtime.Serv return } - forward_ResourceService_GetResourceByName_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_ResourceService_GetResource_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -455,7 +439,7 @@ func RegisterResourceServiceHandlerServer(ctx context.Context, mux *runtime.Serv inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.ResourceService/UpdateResource", runtime.WithHTTPPathPattern("/api/v2/resources/{resource.id}")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.ResourceService/UpdateResource", runtime.WithHTTPPathPattern("/api/v2/{resource.name=resources/*}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -480,7 +464,7 @@ func RegisterResourceServiceHandlerServer(ctx context.Context, mux *runtime.Serv inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.ResourceService/DeleteResource", runtime.WithHTTPPathPattern("/api/v2/resources/{id}")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.ResourceService/DeleteResource", runtime.WithHTTPPathPattern("/api/v2/{name=resources/*}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -582,47 +566,47 @@ func RegisterResourceServiceHandlerClient(ctx context.Context, mux *runtime.Serv }) - mux.Handle("GET", pattern_ResourceService_GetResource_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_ResourceService_SearchResources_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) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.ResourceService/GetResource", runtime.WithHTTPPathPattern("/api/v2/resources/{id}")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.ResourceService/SearchResources", runtime.WithHTTPPathPattern("/api/v2/resources:search")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_ResourceService_GetResource_0(annotatedContext, inboundMarshaler, client, req, pathParams) + resp, md, err := request_ResourceService_SearchResources_0(annotatedContext, inboundMarshaler, client, req, pathParams) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ResourceService_GetResource_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_ResourceService_SearchResources_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_ResourceService_GetResourceByName_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_ResourceService_GetResource_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) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.ResourceService/GetResourceByName", runtime.WithHTTPPathPattern("/api/v2/resources/name/{name}")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.ResourceService/GetResource", runtime.WithHTTPPathPattern("/api/v2/{name=resources/*}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_ResourceService_GetResourceByName_0(annotatedContext, inboundMarshaler, client, req, pathParams) + resp, md, err := request_ResourceService_GetResource_0(annotatedContext, inboundMarshaler, client, req, pathParams) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ResourceService_GetResourceByName_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_ResourceService_GetResource_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -632,7 +616,7 @@ func RegisterResourceServiceHandlerClient(ctx context.Context, mux *runtime.Serv inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.ResourceService/UpdateResource", runtime.WithHTTPPathPattern("/api/v2/resources/{resource.id}")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.ResourceService/UpdateResource", runtime.WithHTTPPathPattern("/api/v2/{resource.name=resources/*}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -654,7 +638,7 @@ func RegisterResourceServiceHandlerClient(ctx context.Context, mux *runtime.Serv inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.ResourceService/DeleteResource", runtime.WithHTTPPathPattern("/api/v2/resources/{id}")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.ResourceService/DeleteResource", runtime.WithHTTPPathPattern("/api/v2/{name=resources/*}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -678,13 +662,13 @@ var ( pattern_ResourceService_ListResources_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v2", "resources"}, "")) - pattern_ResourceService_GetResource_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "v2", "resources", "id"}, "")) + pattern_ResourceService_SearchResources_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v2", "resources"}, "search")) - pattern_ResourceService_GetResourceByName_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 3}, []string{"api", "v2", "resources", "name"}, "")) + pattern_ResourceService_GetResource_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3}, []string{"api", "v2", "resources", "name"}, "")) - pattern_ResourceService_UpdateResource_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "v2", "resources", "resource.id"}, "")) + pattern_ResourceService_UpdateResource_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3}, []string{"api", "v2", "resources", "resource.name"}, "")) - pattern_ResourceService_DeleteResource_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "v2", "resources", "id"}, "")) + pattern_ResourceService_DeleteResource_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3}, []string{"api", "v2", "resources", "name"}, "")) ) var ( @@ -692,9 +676,9 @@ var ( forward_ResourceService_ListResources_0 = runtime.ForwardResponseMessage - forward_ResourceService_GetResource_0 = runtime.ForwardResponseMessage + forward_ResourceService_SearchResources_0 = runtime.ForwardResponseMessage - forward_ResourceService_GetResourceByName_0 = runtime.ForwardResponseMessage + forward_ResourceService_GetResource_0 = runtime.ForwardResponseMessage forward_ResourceService_UpdateResource_0 = runtime.ForwardResponseMessage diff --git a/proto/gen/api/v2/resource_service_grpc.pb.go b/proto/gen/api/v2/resource_service_grpc.pb.go index 3cb293fffbb51..77626b50fd792 100644 --- a/proto/gen/api/v2/resource_service_grpc.pb.go +++ b/proto/gen/api/v2/resource_service_grpc.pb.go @@ -19,12 +19,12 @@ import ( const _ = grpc.SupportPackageIsVersion7 const ( - ResourceService_CreateResource_FullMethodName = "/memos.api.v2.ResourceService/CreateResource" - ResourceService_ListResources_FullMethodName = "/memos.api.v2.ResourceService/ListResources" - ResourceService_GetResource_FullMethodName = "/memos.api.v2.ResourceService/GetResource" - ResourceService_GetResourceByName_FullMethodName = "/memos.api.v2.ResourceService/GetResourceByName" - ResourceService_UpdateResource_FullMethodName = "/memos.api.v2.ResourceService/UpdateResource" - ResourceService_DeleteResource_FullMethodName = "/memos.api.v2.ResourceService/DeleteResource" + ResourceService_CreateResource_FullMethodName = "/memos.api.v2.ResourceService/CreateResource" + ResourceService_ListResources_FullMethodName = "/memos.api.v2.ResourceService/ListResources" + ResourceService_SearchResources_FullMethodName = "/memos.api.v2.ResourceService/SearchResources" + ResourceService_GetResource_FullMethodName = "/memos.api.v2.ResourceService/GetResource" + ResourceService_UpdateResource_FullMethodName = "/memos.api.v2.ResourceService/UpdateResource" + ResourceService_DeleteResource_FullMethodName = "/memos.api.v2.ResourceService/DeleteResource" ) // ResourceServiceClient is the client API for ResourceService service. @@ -35,13 +35,13 @@ type ResourceServiceClient interface { CreateResource(ctx context.Context, in *CreateResourceRequest, opts ...grpc.CallOption) (*CreateResourceResponse, error) // ListResources lists all resources. ListResources(ctx context.Context, in *ListResourcesRequest, opts ...grpc.CallOption) (*ListResourcesResponse, error) - // GetResource returns a resource by id. + // SearchResources searches memos. + SearchResources(ctx context.Context, in *SearchResourcesRequest, opts ...grpc.CallOption) (*SearchResourcesResponse, error) + // GetResource returns a resource by name. GetResource(ctx context.Context, in *GetResourceRequest, opts ...grpc.CallOption) (*GetResourceResponse, error) - // GetResourceByName returns a resource by name. - GetResourceByName(ctx context.Context, in *GetResourceByNameRequest, opts ...grpc.CallOption) (*GetResourceByNameResponse, error) // UpdateResource updates a resource. UpdateResource(ctx context.Context, in *UpdateResourceRequest, opts ...grpc.CallOption) (*UpdateResourceResponse, error) - // DeleteResource deletes a resource by id. + // DeleteResource deletes a resource by name. DeleteResource(ctx context.Context, in *DeleteResourceRequest, opts ...grpc.CallOption) (*DeleteResourceResponse, error) } @@ -71,18 +71,18 @@ func (c *resourceServiceClient) ListResources(ctx context.Context, in *ListResou return out, nil } -func (c *resourceServiceClient) GetResource(ctx context.Context, in *GetResourceRequest, opts ...grpc.CallOption) (*GetResourceResponse, error) { - out := new(GetResourceResponse) - err := c.cc.Invoke(ctx, ResourceService_GetResource_FullMethodName, in, out, opts...) +func (c *resourceServiceClient) SearchResources(ctx context.Context, in *SearchResourcesRequest, opts ...grpc.CallOption) (*SearchResourcesResponse, error) { + out := new(SearchResourcesResponse) + err := c.cc.Invoke(ctx, ResourceService_SearchResources_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *resourceServiceClient) GetResourceByName(ctx context.Context, in *GetResourceByNameRequest, opts ...grpc.CallOption) (*GetResourceByNameResponse, error) { - out := new(GetResourceByNameResponse) - err := c.cc.Invoke(ctx, ResourceService_GetResourceByName_FullMethodName, in, out, opts...) +func (c *resourceServiceClient) GetResource(ctx context.Context, in *GetResourceRequest, opts ...grpc.CallOption) (*GetResourceResponse, error) { + out := new(GetResourceResponse) + err := c.cc.Invoke(ctx, ResourceService_GetResource_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -115,13 +115,13 @@ type ResourceServiceServer interface { CreateResource(context.Context, *CreateResourceRequest) (*CreateResourceResponse, error) // ListResources lists all resources. ListResources(context.Context, *ListResourcesRequest) (*ListResourcesResponse, error) - // GetResource returns a resource by id. + // SearchResources searches memos. + SearchResources(context.Context, *SearchResourcesRequest) (*SearchResourcesResponse, error) + // GetResource returns a resource by name. GetResource(context.Context, *GetResourceRequest) (*GetResourceResponse, error) - // GetResourceByName returns a resource by name. - GetResourceByName(context.Context, *GetResourceByNameRequest) (*GetResourceByNameResponse, error) // UpdateResource updates a resource. UpdateResource(context.Context, *UpdateResourceRequest) (*UpdateResourceResponse, error) - // DeleteResource deletes a resource by id. + // DeleteResource deletes a resource by name. DeleteResource(context.Context, *DeleteResourceRequest) (*DeleteResourceResponse, error) mustEmbedUnimplementedResourceServiceServer() } @@ -136,12 +136,12 @@ func (UnimplementedResourceServiceServer) CreateResource(context.Context, *Creat func (UnimplementedResourceServiceServer) ListResources(context.Context, *ListResourcesRequest) (*ListResourcesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ListResources not implemented") } +func (UnimplementedResourceServiceServer) SearchResources(context.Context, *SearchResourcesRequest) (*SearchResourcesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SearchResources not implemented") +} func (UnimplementedResourceServiceServer) GetResource(context.Context, *GetResourceRequest) (*GetResourceResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetResource not implemented") } -func (UnimplementedResourceServiceServer) GetResourceByName(context.Context, *GetResourceByNameRequest) (*GetResourceByNameResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetResourceByName not implemented") -} func (UnimplementedResourceServiceServer) UpdateResource(context.Context, *UpdateResourceRequest) (*UpdateResourceResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateResource not implemented") } @@ -197,38 +197,38 @@ func _ResourceService_ListResources_Handler(srv interface{}, ctx context.Context return interceptor(ctx, in, info, handler) } -func _ResourceService_GetResource_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetResourceRequest) +func _ResourceService_SearchResources_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SearchResourcesRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(ResourceServiceServer).GetResource(ctx, in) + return srv.(ResourceServiceServer).SearchResources(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: ResourceService_GetResource_FullMethodName, + FullMethod: ResourceService_SearchResources_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ResourceServiceServer).GetResource(ctx, req.(*GetResourceRequest)) + return srv.(ResourceServiceServer).SearchResources(ctx, req.(*SearchResourcesRequest)) } return interceptor(ctx, in, info, handler) } -func _ResourceService_GetResourceByName_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetResourceByNameRequest) +func _ResourceService_GetResource_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetResourceRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(ResourceServiceServer).GetResourceByName(ctx, in) + return srv.(ResourceServiceServer).GetResource(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: ResourceService_GetResourceByName_FullMethodName, + FullMethod: ResourceService_GetResource_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ResourceServiceServer).GetResourceByName(ctx, req.(*GetResourceByNameRequest)) + return srv.(ResourceServiceServer).GetResource(ctx, req.(*GetResourceRequest)) } return interceptor(ctx, in, info, handler) } @@ -285,12 +285,12 @@ var ResourceService_ServiceDesc = grpc.ServiceDesc{ Handler: _ResourceService_ListResources_Handler, }, { - MethodName: "GetResource", - Handler: _ResourceService_GetResource_Handler, + MethodName: "SearchResources", + Handler: _ResourceService_SearchResources_Handler, }, { - MethodName: "GetResourceByName", - Handler: _ResourceService_GetResourceByName_Handler, + MethodName: "GetResource", + Handler: _ResourceService_GetResource_Handler, }, { MethodName: "UpdateResource", diff --git a/proto/gen/api/v2/tag_service.pb.go b/proto/gen/api/v2/tag_service.pb.go index e71d997cc89b6..4cf47b293bae8 100644 --- a/proto/gen/api/v2/tag_service.pb.go +++ b/proto/gen/api/v2/tag_service.pb.go @@ -28,7 +28,7 @@ type Tag struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // The creator of tags. - // Format: users/{username} + // Format: users/{id} Creator string `protobuf:"bytes,2,opt,name=creator,proto3" json:"creator,omitempty"` } @@ -263,7 +263,7 @@ type ListTagsRequest struct { unknownFields protoimpl.UnknownFields // The creator of tags. - // Format: users/{username} + // Format: users/{id} User string `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` } @@ -359,7 +359,7 @@ type RenameTagRequest struct { unknownFields protoimpl.UnknownFields // The creator of tags. - // Format: users/{username} + // Format: users/{id} User string `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` OldName string `protobuf:"bytes,2,opt,name=old_name,json=oldName,proto3" json:"old_name,omitempty"` NewName string `protobuf:"bytes,3,opt,name=new_name,json=newName,proto3" json:"new_name,omitempty"` @@ -556,7 +556,7 @@ type GetTagSuggestionsRequest struct { unknownFields protoimpl.UnknownFields // The creator of tags. - // Format: users/{username} + // Format: users/{id} User string `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` } diff --git a/proto/gen/api/v2/user_service.pb.go b/proto/gen/api/v2/user_service.pb.go index 58e60e8556767..80c0572eff7ea 100644 --- a/proto/gen/api/v2/user_service.pb.go +++ b/proto/gen/api/v2/user_service.pb.go @@ -81,18 +81,20 @@ type User struct { unknownFields protoimpl.UnknownFields // The name of the user. - // Format: users/{username} - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Id int32 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` - Role User_Role `protobuf:"varint,3,opt,name=role,proto3,enum=memos.api.v2.User_Role" json:"role,omitempty"` - Username string `protobuf:"bytes,4,opt,name=username,proto3" json:"username,omitempty"` - Email string `protobuf:"bytes,5,opt,name=email,proto3" json:"email,omitempty"` - Nickname string `protobuf:"bytes,6,opt,name=nickname,proto3" json:"nickname,omitempty"` - AvatarUrl string `protobuf:"bytes,7,opt,name=avatar_url,json=avatarUrl,proto3" json:"avatar_url,omitempty"` - Password string `protobuf:"bytes,8,opt,name=password,proto3" json:"password,omitempty"` - RowStatus RowStatus `protobuf:"varint,9,opt,name=row_status,json=rowStatus,proto3,enum=memos.api.v2.RowStatus" json:"row_status,omitempty"` - CreateTime *timestamppb.Timestamp `protobuf:"bytes,10,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` - UpdateTime *timestamppb.Timestamp `protobuf:"bytes,11,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"` + // Format: users/{id} + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // The system generated uid of the user. + Id int32 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` + Role User_Role `protobuf:"varint,3,opt,name=role,proto3,enum=memos.api.v2.User_Role" json:"role,omitempty"` + Username string `protobuf:"bytes,4,opt,name=username,proto3" json:"username,omitempty"` + Email string `protobuf:"bytes,5,opt,name=email,proto3" json:"email,omitempty"` + Nickname string `protobuf:"bytes,6,opt,name=nickname,proto3" json:"nickname,omitempty"` + AvatarUrl string `protobuf:"bytes,7,opt,name=avatar_url,json=avatarUrl,proto3" json:"avatar_url,omitempty"` + Description string `protobuf:"bytes,8,opt,name=description,proto3" json:"description,omitempty"` + Password string `protobuf:"bytes,9,opt,name=password,proto3" json:"password,omitempty"` + RowStatus RowStatus `protobuf:"varint,10,opt,name=row_status,json=rowStatus,proto3,enum=memos.api.v2.RowStatus" json:"row_status,omitempty"` + CreateTime *timestamppb.Timestamp `protobuf:"bytes,11,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` + UpdateTime *timestamppb.Timestamp `protobuf:"bytes,12,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"` } func (x *User) Reset() { @@ -176,6 +178,13 @@ func (x *User) GetAvatarUrl() string { return "" } +func (x *User) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + func (x *User) GetPassword() string { if x != nil { return x.Password @@ -289,20 +298,116 @@ func (x *ListUsersResponse) GetUsers() []*User { return nil } +type SearchUsersRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Filter is used to filter users returned in the list. + // Format: "username == frank" + Filter string `protobuf:"bytes,1,opt,name=filter,proto3" json:"filter,omitempty"` +} + +func (x *SearchUsersRequest) Reset() { + *x = SearchUsersRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v2_user_service_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SearchUsersRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SearchUsersRequest) ProtoMessage() {} + +func (x *SearchUsersRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_v2_user_service_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 SearchUsersRequest.ProtoReflect.Descriptor instead. +func (*SearchUsersRequest) Descriptor() ([]byte, []int) { + return file_api_v2_user_service_proto_rawDescGZIP(), []int{3} +} + +func (x *SearchUsersRequest) GetFilter() string { + if x != nil { + return x.Filter + } + return "" +} + +type SearchUsersResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Users []*User `protobuf:"bytes,1,rep,name=users,proto3" json:"users,omitempty"` +} + +func (x *SearchUsersResponse) Reset() { + *x = SearchUsersResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v2_user_service_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SearchUsersResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SearchUsersResponse) ProtoMessage() {} + +func (x *SearchUsersResponse) ProtoReflect() protoreflect.Message { + mi := &file_api_v2_user_service_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 SearchUsersResponse.ProtoReflect.Descriptor instead. +func (*SearchUsersResponse) Descriptor() ([]byte, []int) { + return file_api_v2_user_service_proto_rawDescGZIP(), []int{4} +} + +func (x *SearchUsersResponse) GetUsers() []*User { + if x != nil { + return x.Users + } + return nil +} + type GetUserRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // The name of the user. - // Format: users/{username} + // Format: users/{id} Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` } func (x *GetUserRequest) Reset() { *x = GetUserRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_v2_user_service_proto_msgTypes[3] + mi := &file_api_v2_user_service_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -315,7 +420,7 @@ func (x *GetUserRequest) String() string { func (*GetUserRequest) ProtoMessage() {} func (x *GetUserRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_v2_user_service_proto_msgTypes[3] + mi := &file_api_v2_user_service_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -328,7 +433,7 @@ func (x *GetUserRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetUserRequest.ProtoReflect.Descriptor instead. func (*GetUserRequest) Descriptor() ([]byte, []int) { - return file_api_v2_user_service_proto_rawDescGZIP(), []int{3} + return file_api_v2_user_service_proto_rawDescGZIP(), []int{5} } func (x *GetUserRequest) GetName() string { @@ -349,7 +454,7 @@ type GetUserResponse struct { func (x *GetUserResponse) Reset() { *x = GetUserResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_v2_user_service_proto_msgTypes[4] + mi := &file_api_v2_user_service_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -362,7 +467,7 @@ func (x *GetUserResponse) String() string { func (*GetUserResponse) ProtoMessage() {} func (x *GetUserResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_v2_user_service_proto_msgTypes[4] + mi := &file_api_v2_user_service_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -375,7 +480,7 @@ func (x *GetUserResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetUserResponse.ProtoReflect.Descriptor instead. func (*GetUserResponse) Descriptor() ([]byte, []int) { - return file_api_v2_user_service_proto_rawDescGZIP(), []int{4} + return file_api_v2_user_service_proto_rawDescGZIP(), []int{6} } func (x *GetUserResponse) GetUser() *User { @@ -396,7 +501,7 @@ type CreateUserRequest struct { func (x *CreateUserRequest) Reset() { *x = CreateUserRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_v2_user_service_proto_msgTypes[5] + mi := &file_api_v2_user_service_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -409,7 +514,7 @@ func (x *CreateUserRequest) String() string { func (*CreateUserRequest) ProtoMessage() {} func (x *CreateUserRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_v2_user_service_proto_msgTypes[5] + mi := &file_api_v2_user_service_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -422,7 +527,7 @@ func (x *CreateUserRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateUserRequest.ProtoReflect.Descriptor instead. func (*CreateUserRequest) Descriptor() ([]byte, []int) { - return file_api_v2_user_service_proto_rawDescGZIP(), []int{5} + return file_api_v2_user_service_proto_rawDescGZIP(), []int{7} } func (x *CreateUserRequest) GetUser() *User { @@ -443,7 +548,7 @@ type CreateUserResponse struct { func (x *CreateUserResponse) Reset() { *x = CreateUserResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_v2_user_service_proto_msgTypes[6] + mi := &file_api_v2_user_service_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -456,7 +561,7 @@ func (x *CreateUserResponse) String() string { func (*CreateUserResponse) ProtoMessage() {} func (x *CreateUserResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_v2_user_service_proto_msgTypes[6] + mi := &file_api_v2_user_service_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -469,7 +574,7 @@ func (x *CreateUserResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateUserResponse.ProtoReflect.Descriptor instead. func (*CreateUserResponse) Descriptor() ([]byte, []int) { - return file_api_v2_user_service_proto_rawDescGZIP(), []int{6} + return file_api_v2_user_service_proto_rawDescGZIP(), []int{8} } func (x *CreateUserResponse) GetUser() *User { @@ -491,7 +596,7 @@ type UpdateUserRequest struct { func (x *UpdateUserRequest) Reset() { *x = UpdateUserRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_v2_user_service_proto_msgTypes[7] + mi := &file_api_v2_user_service_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -504,7 +609,7 @@ func (x *UpdateUserRequest) String() string { func (*UpdateUserRequest) ProtoMessage() {} func (x *UpdateUserRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_v2_user_service_proto_msgTypes[7] + mi := &file_api_v2_user_service_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -517,7 +622,7 @@ func (x *UpdateUserRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateUserRequest.ProtoReflect.Descriptor instead. func (*UpdateUserRequest) Descriptor() ([]byte, []int) { - return file_api_v2_user_service_proto_rawDescGZIP(), []int{7} + return file_api_v2_user_service_proto_rawDescGZIP(), []int{9} } func (x *UpdateUserRequest) GetUser() *User { @@ -545,7 +650,7 @@ type UpdateUserResponse struct { func (x *UpdateUserResponse) Reset() { *x = UpdateUserResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_v2_user_service_proto_msgTypes[8] + mi := &file_api_v2_user_service_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -558,7 +663,7 @@ func (x *UpdateUserResponse) String() string { func (*UpdateUserResponse) ProtoMessage() {} func (x *UpdateUserResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_v2_user_service_proto_msgTypes[8] + mi := &file_api_v2_user_service_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -571,7 +676,7 @@ func (x *UpdateUserResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateUserResponse.ProtoReflect.Descriptor instead. func (*UpdateUserResponse) Descriptor() ([]byte, []int) { - return file_api_v2_user_service_proto_rawDescGZIP(), []int{8} + return file_api_v2_user_service_proto_rawDescGZIP(), []int{10} } func (x *UpdateUserResponse) GetUser() *User { @@ -587,14 +692,14 @@ type DeleteUserRequest struct { unknownFields protoimpl.UnknownFields // The name of the user. - // Format: users/{username} + // Format: users/{id} Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` } func (x *DeleteUserRequest) Reset() { *x = DeleteUserRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_v2_user_service_proto_msgTypes[9] + mi := &file_api_v2_user_service_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -607,7 +712,7 @@ func (x *DeleteUserRequest) String() string { func (*DeleteUserRequest) ProtoMessage() {} func (x *DeleteUserRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_v2_user_service_proto_msgTypes[9] + mi := &file_api_v2_user_service_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -620,7 +725,7 @@ func (x *DeleteUserRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteUserRequest.ProtoReflect.Descriptor instead. func (*DeleteUserRequest) Descriptor() ([]byte, []int) { - return file_api_v2_user_service_proto_rawDescGZIP(), []int{9} + return file_api_v2_user_service_proto_rawDescGZIP(), []int{11} } func (x *DeleteUserRequest) GetName() string { @@ -639,7 +744,7 @@ type DeleteUserResponse struct { func (x *DeleteUserResponse) Reset() { *x = DeleteUserResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_v2_user_service_proto_msgTypes[10] + mi := &file_api_v2_user_service_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -652,7 +757,7 @@ func (x *DeleteUserResponse) String() string { func (*DeleteUserResponse) ProtoMessage() {} func (x *DeleteUserResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_v2_user_service_proto_msgTypes[10] + mi := &file_api_v2_user_service_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -665,7 +770,7 @@ func (x *DeleteUserResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteUserResponse.ProtoReflect.Descriptor instead. func (*DeleteUserResponse) Descriptor() ([]byte, []int) { - return file_api_v2_user_service_proto_rawDescGZIP(), []int{10} + return file_api_v2_user_service_proto_rawDescGZIP(), []int{12} } type UserSetting struct { @@ -674,7 +779,7 @@ type UserSetting struct { unknownFields protoimpl.UnknownFields // The name of the user. - // Format: users/{username} + // Format: users/{id} Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // The preferred locale of the user. Locale string `protobuf:"bytes,2,opt,name=locale,proto3" json:"locale,omitempty"` @@ -689,7 +794,7 @@ type UserSetting struct { func (x *UserSetting) Reset() { *x = UserSetting{} if protoimpl.UnsafeEnabled { - mi := &file_api_v2_user_service_proto_msgTypes[11] + mi := &file_api_v2_user_service_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -702,7 +807,7 @@ func (x *UserSetting) String() string { func (*UserSetting) ProtoMessage() {} func (x *UserSetting) ProtoReflect() protoreflect.Message { - mi := &file_api_v2_user_service_proto_msgTypes[11] + mi := &file_api_v2_user_service_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -715,7 +820,7 @@ func (x *UserSetting) ProtoReflect() protoreflect.Message { // Deprecated: Use UserSetting.ProtoReflect.Descriptor instead. func (*UserSetting) Descriptor() ([]byte, []int) { - return file_api_v2_user_service_proto_rawDescGZIP(), []int{11} + return file_api_v2_user_service_proto_rawDescGZIP(), []int{13} } func (x *UserSetting) GetName() string { @@ -759,14 +864,14 @@ type GetUserSettingRequest struct { unknownFields protoimpl.UnknownFields // The name of the user. - // Format: users/{username} + // Format: users/{id} Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` } func (x *GetUserSettingRequest) Reset() { *x = GetUserSettingRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_v2_user_service_proto_msgTypes[12] + mi := &file_api_v2_user_service_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -779,7 +884,7 @@ func (x *GetUserSettingRequest) String() string { func (*GetUserSettingRequest) ProtoMessage() {} func (x *GetUserSettingRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_v2_user_service_proto_msgTypes[12] + mi := &file_api_v2_user_service_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -792,7 +897,7 @@ func (x *GetUserSettingRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetUserSettingRequest.ProtoReflect.Descriptor instead. func (*GetUserSettingRequest) Descriptor() ([]byte, []int) { - return file_api_v2_user_service_proto_rawDescGZIP(), []int{12} + return file_api_v2_user_service_proto_rawDescGZIP(), []int{14} } func (x *GetUserSettingRequest) GetName() string { @@ -813,7 +918,7 @@ type GetUserSettingResponse struct { func (x *GetUserSettingResponse) Reset() { *x = GetUserSettingResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_v2_user_service_proto_msgTypes[13] + mi := &file_api_v2_user_service_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -826,7 +931,7 @@ func (x *GetUserSettingResponse) String() string { func (*GetUserSettingResponse) ProtoMessage() {} func (x *GetUserSettingResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_v2_user_service_proto_msgTypes[13] + mi := &file_api_v2_user_service_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -839,7 +944,7 @@ func (x *GetUserSettingResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetUserSettingResponse.ProtoReflect.Descriptor instead. func (*GetUserSettingResponse) Descriptor() ([]byte, []int) { - return file_api_v2_user_service_proto_rawDescGZIP(), []int{13} + return file_api_v2_user_service_proto_rawDescGZIP(), []int{15} } func (x *GetUserSettingResponse) GetSetting() *UserSetting { @@ -861,7 +966,7 @@ type UpdateUserSettingRequest struct { func (x *UpdateUserSettingRequest) Reset() { *x = UpdateUserSettingRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_v2_user_service_proto_msgTypes[14] + mi := &file_api_v2_user_service_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -874,7 +979,7 @@ func (x *UpdateUserSettingRequest) String() string { func (*UpdateUserSettingRequest) ProtoMessage() {} func (x *UpdateUserSettingRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_v2_user_service_proto_msgTypes[14] + mi := &file_api_v2_user_service_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -887,7 +992,7 @@ func (x *UpdateUserSettingRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateUserSettingRequest.ProtoReflect.Descriptor instead. func (*UpdateUserSettingRequest) Descriptor() ([]byte, []int) { - return file_api_v2_user_service_proto_rawDescGZIP(), []int{14} + return file_api_v2_user_service_proto_rawDescGZIP(), []int{16} } func (x *UpdateUserSettingRequest) GetSetting() *UserSetting { @@ -915,7 +1020,7 @@ type UpdateUserSettingResponse struct { func (x *UpdateUserSettingResponse) Reset() { *x = UpdateUserSettingResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_v2_user_service_proto_msgTypes[15] + mi := &file_api_v2_user_service_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -928,7 +1033,7 @@ func (x *UpdateUserSettingResponse) String() string { func (*UpdateUserSettingResponse) ProtoMessage() {} func (x *UpdateUserSettingResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_v2_user_service_proto_msgTypes[15] + mi := &file_api_v2_user_service_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -941,7 +1046,7 @@ func (x *UpdateUserSettingResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateUserSettingResponse.ProtoReflect.Descriptor instead. func (*UpdateUserSettingResponse) Descriptor() ([]byte, []int) { - return file_api_v2_user_service_proto_rawDescGZIP(), []int{15} + return file_api_v2_user_service_proto_rawDescGZIP(), []int{17} } func (x *UpdateUserSettingResponse) GetSetting() *UserSetting { @@ -965,7 +1070,7 @@ type UserAccessToken struct { func (x *UserAccessToken) Reset() { *x = UserAccessToken{} if protoimpl.UnsafeEnabled { - mi := &file_api_v2_user_service_proto_msgTypes[16] + mi := &file_api_v2_user_service_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -978,7 +1083,7 @@ func (x *UserAccessToken) String() string { func (*UserAccessToken) ProtoMessage() {} func (x *UserAccessToken) ProtoReflect() protoreflect.Message { - mi := &file_api_v2_user_service_proto_msgTypes[16] + mi := &file_api_v2_user_service_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -991,7 +1096,7 @@ func (x *UserAccessToken) ProtoReflect() protoreflect.Message { // Deprecated: Use UserAccessToken.ProtoReflect.Descriptor instead. func (*UserAccessToken) Descriptor() ([]byte, []int) { - return file_api_v2_user_service_proto_rawDescGZIP(), []int{16} + return file_api_v2_user_service_proto_rawDescGZIP(), []int{18} } func (x *UserAccessToken) GetAccessToken() string { @@ -1028,14 +1133,14 @@ type ListUserAccessTokensRequest struct { unknownFields protoimpl.UnknownFields // The name of the user. - // Format: users/{username} + // Format: users/{id} Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` } func (x *ListUserAccessTokensRequest) Reset() { *x = ListUserAccessTokensRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_v2_user_service_proto_msgTypes[17] + mi := &file_api_v2_user_service_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1048,7 +1153,7 @@ func (x *ListUserAccessTokensRequest) String() string { func (*ListUserAccessTokensRequest) ProtoMessage() {} func (x *ListUserAccessTokensRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_v2_user_service_proto_msgTypes[17] + mi := &file_api_v2_user_service_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1061,7 +1166,7 @@ func (x *ListUserAccessTokensRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ListUserAccessTokensRequest.ProtoReflect.Descriptor instead. func (*ListUserAccessTokensRequest) Descriptor() ([]byte, []int) { - return file_api_v2_user_service_proto_rawDescGZIP(), []int{17} + return file_api_v2_user_service_proto_rawDescGZIP(), []int{19} } func (x *ListUserAccessTokensRequest) GetName() string { @@ -1082,7 +1187,7 @@ type ListUserAccessTokensResponse struct { func (x *ListUserAccessTokensResponse) Reset() { *x = ListUserAccessTokensResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_v2_user_service_proto_msgTypes[18] + mi := &file_api_v2_user_service_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1095,7 +1200,7 @@ func (x *ListUserAccessTokensResponse) String() string { func (*ListUserAccessTokensResponse) ProtoMessage() {} func (x *ListUserAccessTokensResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_v2_user_service_proto_msgTypes[18] + mi := &file_api_v2_user_service_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1108,7 +1213,7 @@ func (x *ListUserAccessTokensResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ListUserAccessTokensResponse.ProtoReflect.Descriptor instead. func (*ListUserAccessTokensResponse) Descriptor() ([]byte, []int) { - return file_api_v2_user_service_proto_rawDescGZIP(), []int{18} + return file_api_v2_user_service_proto_rawDescGZIP(), []int{20} } func (x *ListUserAccessTokensResponse) GetAccessTokens() []*UserAccessToken { @@ -1124,7 +1229,7 @@ type CreateUserAccessTokenRequest struct { unknownFields protoimpl.UnknownFields // The name of the user. - // Format: users/{username} + // Format: users/{id} Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` ExpiresAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=expires_at,json=expiresAt,proto3,oneof" json:"expires_at,omitempty"` @@ -1133,7 +1238,7 @@ type CreateUserAccessTokenRequest struct { func (x *CreateUserAccessTokenRequest) Reset() { *x = CreateUserAccessTokenRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_v2_user_service_proto_msgTypes[19] + mi := &file_api_v2_user_service_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1146,7 +1251,7 @@ func (x *CreateUserAccessTokenRequest) String() string { func (*CreateUserAccessTokenRequest) ProtoMessage() {} func (x *CreateUserAccessTokenRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_v2_user_service_proto_msgTypes[19] + mi := &file_api_v2_user_service_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1159,7 +1264,7 @@ func (x *CreateUserAccessTokenRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateUserAccessTokenRequest.ProtoReflect.Descriptor instead. func (*CreateUserAccessTokenRequest) Descriptor() ([]byte, []int) { - return file_api_v2_user_service_proto_rawDescGZIP(), []int{19} + return file_api_v2_user_service_proto_rawDescGZIP(), []int{21} } func (x *CreateUserAccessTokenRequest) GetName() string { @@ -1194,7 +1299,7 @@ type CreateUserAccessTokenResponse struct { func (x *CreateUserAccessTokenResponse) Reset() { *x = CreateUserAccessTokenResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_v2_user_service_proto_msgTypes[20] + mi := &file_api_v2_user_service_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1207,7 +1312,7 @@ func (x *CreateUserAccessTokenResponse) String() string { func (*CreateUserAccessTokenResponse) ProtoMessage() {} func (x *CreateUserAccessTokenResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_v2_user_service_proto_msgTypes[20] + mi := &file_api_v2_user_service_proto_msgTypes[22] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1220,7 +1325,7 @@ func (x *CreateUserAccessTokenResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateUserAccessTokenResponse.ProtoReflect.Descriptor instead. func (*CreateUserAccessTokenResponse) Descriptor() ([]byte, []int) { - return file_api_v2_user_service_proto_rawDescGZIP(), []int{20} + return file_api_v2_user_service_proto_rawDescGZIP(), []int{22} } func (x *CreateUserAccessTokenResponse) GetAccessToken() *UserAccessToken { @@ -1236,7 +1341,7 @@ type DeleteUserAccessTokenRequest struct { unknownFields protoimpl.UnknownFields // The name of the user. - // Format: users/{username} + // Format: users/{id} Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // access_token is the access token to delete. AccessToken string `protobuf:"bytes,2,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` @@ -1245,7 +1350,7 @@ type DeleteUserAccessTokenRequest struct { func (x *DeleteUserAccessTokenRequest) Reset() { *x = DeleteUserAccessTokenRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_v2_user_service_proto_msgTypes[21] + mi := &file_api_v2_user_service_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1258,7 +1363,7 @@ func (x *DeleteUserAccessTokenRequest) String() string { func (*DeleteUserAccessTokenRequest) ProtoMessage() {} func (x *DeleteUserAccessTokenRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_v2_user_service_proto_msgTypes[21] + mi := &file_api_v2_user_service_proto_msgTypes[23] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1271,7 +1376,7 @@ func (x *DeleteUserAccessTokenRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteUserAccessTokenRequest.ProtoReflect.Descriptor instead. func (*DeleteUserAccessTokenRequest) Descriptor() ([]byte, []int) { - return file_api_v2_user_service_proto_rawDescGZIP(), []int{21} + return file_api_v2_user_service_proto_rawDescGZIP(), []int{23} } func (x *DeleteUserAccessTokenRequest) GetName() string { @@ -1297,7 +1402,7 @@ type DeleteUserAccessTokenResponse struct { func (x *DeleteUserAccessTokenResponse) Reset() { *x = DeleteUserAccessTokenResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_v2_user_service_proto_msgTypes[22] + mi := &file_api_v2_user_service_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1310,7 +1415,7 @@ func (x *DeleteUserAccessTokenResponse) String() string { func (*DeleteUserAccessTokenResponse) ProtoMessage() {} func (x *DeleteUserAccessTokenResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_v2_user_service_proto_msgTypes[22] + mi := &file_api_v2_user_service_proto_msgTypes[24] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1323,7 +1428,7 @@ func (x *DeleteUserAccessTokenResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteUserAccessTokenResponse.ProtoReflect.Descriptor instead. func (*DeleteUserAccessTokenResponse) Descriptor() ([]byte, []int) { - return file_api_v2_user_service_proto_rawDescGZIP(), []int{22} + return file_api_v2_user_service_proto_rawDescGZIP(), []int{24} } var File_api_v2_user_service_proto protoreflect.FileDescriptor @@ -1342,7 +1447,7 @@ var file_api_v2_user_service_proto_rawDesc = []byte{ 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 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, 0x22, 0xd4, 0x03, 0x0a, 0x04, 0x55, 0x73, + 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf6, 0x03, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x2b, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x03, @@ -1355,240 +1460,256 @@ var file_api_v2_user_service_proto_rawDesc = []byte{ 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x55, 0x72, 0x6c, - 0x12, 0x1f, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x08, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x04, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, - 0x64, 0x12, 0x36, 0x0a, 0x0a, 0x72, 0x6f, 0x77, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, - 0x09, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x6f, 0x77, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x09, - 0x72, 0x6f, 0x77, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x3b, 0x0a, 0x0b, 0x63, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0a, 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, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0b, 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, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, - 0x69, 0x6d, 0x65, 0x22, 0x3b, 0x0a, 0x04, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x52, - 0x4f, 0x4c, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, - 0x00, 0x12, 0x08, 0x0a, 0x04, 0x48, 0x4f, 0x53, 0x54, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x41, - 0x44, 0x4d, 0x49, 0x4e, 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x55, 0x53, 0x45, 0x52, 0x10, 0x03, - 0x22, 0x12, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x22, 0x3d, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x28, 0x0a, 0x05, 0x75, 0x73, 0x65, - 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x05, 0x75, 0x73, - 0x65, 0x72, 0x73, 0x22, 0x24, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x39, 0x0a, 0x0f, 0x47, 0x65, 0x74, - 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x04, - 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x6d, - 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, - 0x75, 0x73, 0x65, 0x72, 0x22, 0x3b, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, - 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x04, 0x75, 0x73, 0x65, - 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, - 0x72, 0x22, 0x3c, 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, - 0x7d, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x2b, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x04, 0x75, 0x73, 0x65, - 0x72, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, - 0x73, 0x6b, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x3c, - 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x27, 0x0a, 0x11, - 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x14, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, - 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xac, 0x01, 0x0a, 0x0b, - 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x16, 0x0a, 0x06, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x70, 0x70, 0x65, 0x61, - 0x72, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x61, 0x70, 0x70, - 0x65, 0x61, 0x72, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x6d, 0x65, 0x6d, 0x6f, 0x5f, - 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0e, 0x6d, 0x65, 0x6d, 0x6f, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, - 0x12, 0x28, 0x0a, 0x10, 0x74, 0x65, 0x6c, 0x65, 0x67, 0x72, 0x61, 0x6d, 0x5f, 0x75, 0x73, 0x65, - 0x72, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x74, 0x65, 0x6c, 0x65, - 0x67, 0x72, 0x61, 0x6d, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x2b, 0x0a, 0x15, 0x47, 0x65, - 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x4d, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x55, 0x73, - 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x33, 0x0a, 0x07, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x73, - 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x22, 0x91, 0x01, 0x0a, 0x18, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x38, 0x0a, 0x07, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x42, - 0x03, 0xe0, 0x41, 0x02, 0x52, 0x07, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x3b, 0x0a, - 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, - 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x50, 0x0a, 0x19, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x07, 0x73, 0x65, 0x74, 0x74, 0x69, - 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, - 0x69, 0x6e, 0x67, 0x52, 0x07, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x22, 0xca, 0x01, 0x0a, - 0x0f, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, - 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, - 0x6b, 0x65, 0x6e, 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, 0x37, 0x0a, 0x09, 0x69, 0x73, 0x73, 0x75, 0x65, 0x64, 0x5f, - 0x61, 0x74, 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, 0x08, 0x69, 0x73, 0x73, 0x75, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, - 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x5f, 0x61, 0x74, 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, 0x09, - 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x41, 0x74, 0x22, 0x31, 0x0a, 0x1b, 0x4c, 0x69, 0x73, - 0x74, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x62, 0x0a, 0x1c, - 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, - 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x0d, - 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, - 0x65, 0x6e, 0x52, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, - 0x22, 0xa3, 0x01, 0x0a, 0x1c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x41, - 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 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, 0x3e, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, - 0x65, 0x73, 0x5f, 0x61, 0x74, 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, 0x48, 0x00, 0x52, 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, - 0x65, 0x73, 0x41, 0x74, 0x88, 0x01, 0x01, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x65, 0x78, 0x70, 0x69, - 0x72, 0x65, 0x73, 0x5f, 0x61, 0x74, 0x22, 0x61, 0x0a, 0x1d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, - 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, - 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, - 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x0b, 0x61, 0x63, - 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x55, 0x0a, 0x1c, 0x44, 0x65, 0x6c, - 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, - 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x21, 0x0a, - 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, - 0x22, 0x1f, 0x0a, 0x1d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, - 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x32, 0xb5, 0x0b, 0x0a, 0x0b, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x12, 0x63, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, 0x1e, - 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, - 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x15, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0f, 0x12, 0x0d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, - 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x12, 0x6d, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, - 0x72, 0x12, 0x1c, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, - 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x1d, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, - 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x25, - 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x12, 0x16, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x75, 0x73, 0x65, - 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x73, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, - 0x73, 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x22, 0xda, 0x41, 0x04, 0x75, 0x73, 0x65, 0x72, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x3a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x0d, 0x2f, 0x61, 0x70, - 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x12, 0x8d, 0x01, 0x0a, 0x0a, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, - 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, - 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6d, 0x65, 0x6d, - 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3c, 0xda, 0x41, - 0x10, 0x75, 0x73, 0x65, 0x72, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, - 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x23, 0x3a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x32, 0x1b, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x6e, 0x61, 0x6d, - 0x65, 0x3d, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x76, 0x0a, 0x0a, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, - 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, - 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, - 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x25, 0xda, 0x41, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x2a, 0x16, 0x2f, 0x61, 0x70, 0x69, - 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, - 0x2a, 0x7d, 0x12, 0x8a, 0x01, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, - 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x23, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, - 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x6d, 0x65, 0x6d, - 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, - 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x2d, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x12, - 0x1e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x75, - 0x73, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, - 0xb3, 0x01, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, - 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x26, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, - 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, - 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4d, 0xda, 0x41, 0x13, 0x73, 0x65, 0x74, 0x74, 0x69, - 0x6e, 0x67, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x31, 0x3a, 0x07, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x32, 0x26, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x2e, - 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x2f, 0x73, 0x65, 0x74, - 0x74, 0x69, 0x6e, 0x67, 0x7d, 0x12, 0xa2, 0x01, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, - 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x12, 0x29, - 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, + 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x1f, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x09, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x04, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, + 0x6f, 0x72, 0x64, 0x12, 0x36, 0x0a, 0x0a, 0x72, 0x6f, 0x77, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x6f, 0x77, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x52, 0x09, 0x72, 0x6f, 0x77, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x3b, 0x0a, 0x0b, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0b, 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, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0c, 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, 0x75, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x3b, 0x0a, 0x04, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x14, 0x0a, + 0x10, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, + 0x44, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x48, 0x4f, 0x53, 0x54, 0x10, 0x01, 0x12, 0x09, 0x0a, + 0x05, 0x41, 0x44, 0x4d, 0x49, 0x4e, 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x55, 0x53, 0x45, 0x52, + 0x10, 0x03, 0x22, 0x12, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x3d, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, + 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x28, 0x0a, 0x05, 0x75, + 0x73, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x6d, + 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x05, + 0x75, 0x73, 0x65, 0x72, 0x73, 0x22, 0x2c, 0x0a, 0x12, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, + 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x66, + 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x6c, + 0x74, 0x65, 0x72, 0x22, 0x3f, 0x0a, 0x13, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, 0x65, + 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x28, 0x0a, 0x05, 0x75, 0x73, + 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, + 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x05, 0x75, + 0x73, 0x65, 0x72, 0x73, 0x22, 0x24, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x39, 0x0a, 0x0f, 0x47, 0x65, + 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, + 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, + 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, + 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x3b, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, + 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x04, 0x75, 0x73, + 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, + 0x65, 0x72, 0x22, 0x3c, 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, + 0x22, 0x7d, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2b, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x04, 0x75, 0x73, + 0x65, 0x72, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, + 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, + 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, + 0x3c, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x27, 0x0a, + 0x11, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x14, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xac, 0x01, 0x0a, + 0x0b, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x70, 0x70, 0x65, + 0x61, 0x72, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x61, 0x70, + 0x70, 0x65, 0x61, 0x72, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x6d, 0x65, 0x6d, 0x6f, + 0x5f, 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0e, 0x6d, 0x65, 0x6d, 0x6f, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, + 0x79, 0x12, 0x28, 0x0a, 0x10, 0x74, 0x65, 0x6c, 0x65, 0x67, 0x72, 0x61, 0x6d, 0x5f, 0x75, 0x73, + 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x74, 0x65, 0x6c, + 0x65, 0x67, 0x72, 0x61, 0x6d, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x2b, 0x0a, 0x15, 0x47, + 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x4d, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x55, + 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x33, 0x0a, 0x07, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x07, + 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x22, 0x91, 0x01, 0x0a, 0x18, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x38, 0x0a, 0x07, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, + 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x07, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x3b, + 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, + 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x50, 0x0a, 0x19, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x07, 0x73, 0x65, 0x74, 0x74, + 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, + 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, + 0x74, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x22, 0xca, 0x01, + 0x0a, 0x0f, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, + 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, + 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, + 0x6f, 0x6b, 0x65, 0x6e, 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, 0x37, 0x0a, 0x09, 0x69, 0x73, 0x73, 0x75, 0x65, 0x64, + 0x5f, 0x61, 0x74, 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, 0x08, 0x69, 0x73, 0x73, 0x75, 0x65, 0x64, 0x41, 0x74, 0x12, + 0x39, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x5f, 0x61, 0x74, 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, + 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x41, 0x74, 0x22, 0x31, 0x0a, 0x1b, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, - 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, - 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, - 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x33, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x26, 0x12, 0x24, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x6e, - 0x61, 0x6d, 0x65, 0x3d, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x61, 0x63, 0x63, - 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x12, 0xa8, 0x01, 0x0a, 0x15, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, - 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x2a, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, - 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x2b, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, - 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x36, 0xda, - 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x3a, 0x01, 0x2a, 0x22, - 0x24, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x75, - 0x73, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, - 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x12, 0xc1, 0x01, 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, - 0x2a, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x44, - 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, - 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x6d, 0x65, - 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x62, 0x0a, + 0x1c, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, + 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, + 0x0d, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, + 0x6b, 0x65, 0x6e, 0x52, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, + 0x73, 0x22, 0xa3, 0x01, 0x0a, 0x1c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, + 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 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, 0x3e, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, + 0x72, 0x65, 0x73, 0x5f, 0x61, 0x74, 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, 0x48, 0x00, 0x52, 0x09, 0x65, 0x78, 0x70, 0x69, + 0x72, 0x65, 0x73, 0x41, 0x74, 0x88, 0x01, 0x01, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x65, 0x78, 0x70, + 0x69, 0x72, 0x65, 0x73, 0x5f, 0x61, 0x74, 0x22, 0x61, 0x0a, 0x1d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4f, 0xda, 0x41, 0x11, 0x6e, 0x61, 0x6d, - 0x65, 0x2c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x35, 0x2a, 0x33, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x6e, - 0x61, 0x6d, 0x65, 0x3d, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x61, 0x63, 0x63, - 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x2f, 0x7b, 0x61, 0x63, 0x63, 0x65, - 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x7d, 0x42, 0xa8, 0x01, 0x0a, 0x10, 0x63, 0x6f, - 0x6d, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x42, 0x10, - 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, - 0x50, 0x01, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x75, - 0x73, 0x65, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x3b, 0x61, - 0x70, 0x69, 0x76, 0x32, 0xa2, 0x02, 0x03, 0x4d, 0x41, 0x58, 0xaa, 0x02, 0x0c, 0x4d, 0x65, 0x6d, - 0x6f, 0x73, 0x2e, 0x41, 0x70, 0x69, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, - 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, 0xe2, 0x02, 0x18, 0x4d, 0x65, 0x6d, 0x6f, 0x73, - 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x70, 0x69, - 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x65, + 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, + 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73, + 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x0b, 0x61, + 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x55, 0x0a, 0x1c, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, + 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x21, + 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, + 0x6e, 0x22, 0x1f, 0x0a, 0x1d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x41, + 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x32, 0xa7, 0x0c, 0x0a, 0x0b, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x12, 0x63, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, + 0x1e, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, + 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x1f, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, + 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x15, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0f, 0x12, 0x0d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, + 0x32, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x12, 0x70, 0x0a, 0x0b, 0x53, 0x65, 0x61, 0x72, 0x63, + 0x68, 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, 0x20, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, 0x65, 0x72, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, + 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1c, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x16, 0x12, 0x14, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x75, 0x73, 0x65, + 0x72, 0x73, 0x3a, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x12, 0x6d, 0x0a, 0x07, 0x47, 0x65, 0x74, + 0x55, 0x73, 0x65, 0x72, 0x12, 0x1c, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x32, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x25, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, + 0x12, 0x16, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, + 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x73, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, + 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x22, 0xda, 0x41, 0x04, 0x75, 0x73, + 0x65, 0x72, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x3a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x0d, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x12, 0x8d, 0x01, + 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x6d, + 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, + 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x3c, 0xda, 0x41, 0x10, 0x75, 0x73, 0x65, 0x72, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, + 0x6d, 0x61, 0x73, 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x23, 0x3a, 0x04, 0x75, 0x73, 0x65, 0x72, + 0x32, 0x1b, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x75, 0x73, 0x65, 0x72, 0x2e, + 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x76, 0x0a, + 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x6d, 0x65, + 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6d, + 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x25, + 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x2a, 0x16, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x75, 0x73, 0x65, + 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x8a, 0x01, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, + 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x23, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, + 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, + 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, + 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x2d, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x20, 0x12, 0x1e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, + 0x65, 0x3d, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x73, 0x65, 0x74, 0x74, 0x69, + 0x6e, 0x67, 0x12, 0xb3, 0x01, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, + 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x26, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, + 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x27, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, + 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4d, 0xda, 0x41, 0x13, 0x73, 0x65, + 0x74, 0x74, 0x69, 0x6e, 0x67, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, + 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x31, 0x3a, 0x07, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, + 0x32, 0x26, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x73, 0x65, 0x74, 0x74, 0x69, + 0x6e, 0x67, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x2f, + 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x7d, 0x12, 0xa2, 0x01, 0x0a, 0x14, 0x4c, 0x69, 0x73, + 0x74, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, + 0x73, 0x12, 0x29, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, + 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x6d, + 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, + 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x33, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x12, 0x24, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, + 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, + 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x12, 0xa8, 0x01, + 0x0a, 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, + 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x2a, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, + 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, + 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x36, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x3a, + 0x01, 0x2a, 0x22, 0x24, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, + 0x65, 0x3d, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x61, 0x63, 0x63, 0x65, 0x73, + 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x12, 0xc1, 0x01, 0x0a, 0x15, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, + 0x65, 0x6e, 0x12, 0x2a, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, + 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, + 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, + 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4f, 0xda, 0x41, 0x11, + 0x6e, 0x61, 0x6d, 0x65, 0x2c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, + 0x6e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x35, 0x2a, 0x33, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, + 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, + 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x2f, 0x7b, 0x61, + 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x7d, 0x42, 0xa8, 0x01, 0x0a, + 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x32, 0x42, 0x10, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x75, 0x73, 0x65, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, + 0x32, 0x3b, 0x61, 0x70, 0x69, 0x76, 0x32, 0xa2, 0x02, 0x03, 0x4d, 0x41, 0x58, 0xaa, 0x02, 0x0c, + 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x70, 0x69, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x0c, 0x4d, + 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, 0xe2, 0x02, 0x18, 0x4d, 0x65, + 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, + 0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1604,82 +1725,87 @@ func file_api_v2_user_service_proto_rawDescGZIP() []byte { } var file_api_v2_user_service_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_api_v2_user_service_proto_msgTypes = make([]protoimpl.MessageInfo, 23) +var file_api_v2_user_service_proto_msgTypes = make([]protoimpl.MessageInfo, 25) var file_api_v2_user_service_proto_goTypes = []interface{}{ (User_Role)(0), // 0: memos.api.v2.User.Role (*User)(nil), // 1: memos.api.v2.User (*ListUsersRequest)(nil), // 2: memos.api.v2.ListUsersRequest (*ListUsersResponse)(nil), // 3: memos.api.v2.ListUsersResponse - (*GetUserRequest)(nil), // 4: memos.api.v2.GetUserRequest - (*GetUserResponse)(nil), // 5: memos.api.v2.GetUserResponse - (*CreateUserRequest)(nil), // 6: memos.api.v2.CreateUserRequest - (*CreateUserResponse)(nil), // 7: memos.api.v2.CreateUserResponse - (*UpdateUserRequest)(nil), // 8: memos.api.v2.UpdateUserRequest - (*UpdateUserResponse)(nil), // 9: memos.api.v2.UpdateUserResponse - (*DeleteUserRequest)(nil), // 10: memos.api.v2.DeleteUserRequest - (*DeleteUserResponse)(nil), // 11: memos.api.v2.DeleteUserResponse - (*UserSetting)(nil), // 12: memos.api.v2.UserSetting - (*GetUserSettingRequest)(nil), // 13: memos.api.v2.GetUserSettingRequest - (*GetUserSettingResponse)(nil), // 14: memos.api.v2.GetUserSettingResponse - (*UpdateUserSettingRequest)(nil), // 15: memos.api.v2.UpdateUserSettingRequest - (*UpdateUserSettingResponse)(nil), // 16: memos.api.v2.UpdateUserSettingResponse - (*UserAccessToken)(nil), // 17: memos.api.v2.UserAccessToken - (*ListUserAccessTokensRequest)(nil), // 18: memos.api.v2.ListUserAccessTokensRequest - (*ListUserAccessTokensResponse)(nil), // 19: memos.api.v2.ListUserAccessTokensResponse - (*CreateUserAccessTokenRequest)(nil), // 20: memos.api.v2.CreateUserAccessTokenRequest - (*CreateUserAccessTokenResponse)(nil), // 21: memos.api.v2.CreateUserAccessTokenResponse - (*DeleteUserAccessTokenRequest)(nil), // 22: memos.api.v2.DeleteUserAccessTokenRequest - (*DeleteUserAccessTokenResponse)(nil), // 23: memos.api.v2.DeleteUserAccessTokenResponse - (RowStatus)(0), // 24: memos.api.v2.RowStatus - (*timestamppb.Timestamp)(nil), // 25: google.protobuf.Timestamp - (*fieldmaskpb.FieldMask)(nil), // 26: google.protobuf.FieldMask + (*SearchUsersRequest)(nil), // 4: memos.api.v2.SearchUsersRequest + (*SearchUsersResponse)(nil), // 5: memos.api.v2.SearchUsersResponse + (*GetUserRequest)(nil), // 6: memos.api.v2.GetUserRequest + (*GetUserResponse)(nil), // 7: memos.api.v2.GetUserResponse + (*CreateUserRequest)(nil), // 8: memos.api.v2.CreateUserRequest + (*CreateUserResponse)(nil), // 9: memos.api.v2.CreateUserResponse + (*UpdateUserRequest)(nil), // 10: memos.api.v2.UpdateUserRequest + (*UpdateUserResponse)(nil), // 11: memos.api.v2.UpdateUserResponse + (*DeleteUserRequest)(nil), // 12: memos.api.v2.DeleteUserRequest + (*DeleteUserResponse)(nil), // 13: memos.api.v2.DeleteUserResponse + (*UserSetting)(nil), // 14: memos.api.v2.UserSetting + (*GetUserSettingRequest)(nil), // 15: memos.api.v2.GetUserSettingRequest + (*GetUserSettingResponse)(nil), // 16: memos.api.v2.GetUserSettingResponse + (*UpdateUserSettingRequest)(nil), // 17: memos.api.v2.UpdateUserSettingRequest + (*UpdateUserSettingResponse)(nil), // 18: memos.api.v2.UpdateUserSettingResponse + (*UserAccessToken)(nil), // 19: memos.api.v2.UserAccessToken + (*ListUserAccessTokensRequest)(nil), // 20: memos.api.v2.ListUserAccessTokensRequest + (*ListUserAccessTokensResponse)(nil), // 21: memos.api.v2.ListUserAccessTokensResponse + (*CreateUserAccessTokenRequest)(nil), // 22: memos.api.v2.CreateUserAccessTokenRequest + (*CreateUserAccessTokenResponse)(nil), // 23: memos.api.v2.CreateUserAccessTokenResponse + (*DeleteUserAccessTokenRequest)(nil), // 24: memos.api.v2.DeleteUserAccessTokenRequest + (*DeleteUserAccessTokenResponse)(nil), // 25: memos.api.v2.DeleteUserAccessTokenResponse + (RowStatus)(0), // 26: memos.api.v2.RowStatus + (*timestamppb.Timestamp)(nil), // 27: google.protobuf.Timestamp + (*fieldmaskpb.FieldMask)(nil), // 28: google.protobuf.FieldMask } var file_api_v2_user_service_proto_depIdxs = []int32{ 0, // 0: memos.api.v2.User.role:type_name -> memos.api.v2.User.Role - 24, // 1: memos.api.v2.User.row_status:type_name -> memos.api.v2.RowStatus - 25, // 2: memos.api.v2.User.create_time:type_name -> google.protobuf.Timestamp - 25, // 3: memos.api.v2.User.update_time:type_name -> google.protobuf.Timestamp + 26, // 1: memos.api.v2.User.row_status:type_name -> memos.api.v2.RowStatus + 27, // 2: memos.api.v2.User.create_time:type_name -> google.protobuf.Timestamp + 27, // 3: memos.api.v2.User.update_time:type_name -> google.protobuf.Timestamp 1, // 4: memos.api.v2.ListUsersResponse.users:type_name -> memos.api.v2.User - 1, // 5: memos.api.v2.GetUserResponse.user:type_name -> memos.api.v2.User - 1, // 6: memos.api.v2.CreateUserRequest.user:type_name -> memos.api.v2.User - 1, // 7: memos.api.v2.CreateUserResponse.user:type_name -> memos.api.v2.User - 1, // 8: memos.api.v2.UpdateUserRequest.user:type_name -> memos.api.v2.User - 26, // 9: memos.api.v2.UpdateUserRequest.update_mask:type_name -> google.protobuf.FieldMask - 1, // 10: memos.api.v2.UpdateUserResponse.user:type_name -> memos.api.v2.User - 12, // 11: memos.api.v2.GetUserSettingResponse.setting:type_name -> memos.api.v2.UserSetting - 12, // 12: memos.api.v2.UpdateUserSettingRequest.setting:type_name -> memos.api.v2.UserSetting - 26, // 13: memos.api.v2.UpdateUserSettingRequest.update_mask:type_name -> google.protobuf.FieldMask - 12, // 14: memos.api.v2.UpdateUserSettingResponse.setting:type_name -> memos.api.v2.UserSetting - 25, // 15: memos.api.v2.UserAccessToken.issued_at:type_name -> google.protobuf.Timestamp - 25, // 16: memos.api.v2.UserAccessToken.expires_at:type_name -> google.protobuf.Timestamp - 17, // 17: memos.api.v2.ListUserAccessTokensResponse.access_tokens:type_name -> memos.api.v2.UserAccessToken - 25, // 18: memos.api.v2.CreateUserAccessTokenRequest.expires_at:type_name -> google.protobuf.Timestamp - 17, // 19: memos.api.v2.CreateUserAccessTokenResponse.access_token:type_name -> memos.api.v2.UserAccessToken - 2, // 20: memos.api.v2.UserService.ListUsers:input_type -> memos.api.v2.ListUsersRequest - 4, // 21: memos.api.v2.UserService.GetUser:input_type -> memos.api.v2.GetUserRequest - 6, // 22: memos.api.v2.UserService.CreateUser:input_type -> memos.api.v2.CreateUserRequest - 8, // 23: memos.api.v2.UserService.UpdateUser:input_type -> memos.api.v2.UpdateUserRequest - 10, // 24: memos.api.v2.UserService.DeleteUser:input_type -> memos.api.v2.DeleteUserRequest - 13, // 25: memos.api.v2.UserService.GetUserSetting:input_type -> memos.api.v2.GetUserSettingRequest - 15, // 26: memos.api.v2.UserService.UpdateUserSetting:input_type -> memos.api.v2.UpdateUserSettingRequest - 18, // 27: memos.api.v2.UserService.ListUserAccessTokens:input_type -> memos.api.v2.ListUserAccessTokensRequest - 20, // 28: memos.api.v2.UserService.CreateUserAccessToken:input_type -> memos.api.v2.CreateUserAccessTokenRequest - 22, // 29: memos.api.v2.UserService.DeleteUserAccessToken:input_type -> memos.api.v2.DeleteUserAccessTokenRequest - 3, // 30: memos.api.v2.UserService.ListUsers:output_type -> memos.api.v2.ListUsersResponse - 5, // 31: memos.api.v2.UserService.GetUser:output_type -> memos.api.v2.GetUserResponse - 7, // 32: memos.api.v2.UserService.CreateUser:output_type -> memos.api.v2.CreateUserResponse - 9, // 33: memos.api.v2.UserService.UpdateUser:output_type -> memos.api.v2.UpdateUserResponse - 11, // 34: memos.api.v2.UserService.DeleteUser:output_type -> memos.api.v2.DeleteUserResponse - 14, // 35: memos.api.v2.UserService.GetUserSetting:output_type -> memos.api.v2.GetUserSettingResponse - 16, // 36: memos.api.v2.UserService.UpdateUserSetting:output_type -> memos.api.v2.UpdateUserSettingResponse - 19, // 37: memos.api.v2.UserService.ListUserAccessTokens:output_type -> memos.api.v2.ListUserAccessTokensResponse - 21, // 38: memos.api.v2.UserService.CreateUserAccessToken:output_type -> memos.api.v2.CreateUserAccessTokenResponse - 23, // 39: memos.api.v2.UserService.DeleteUserAccessToken:output_type -> memos.api.v2.DeleteUserAccessTokenResponse - 30, // [30:40] is the sub-list for method output_type - 20, // [20:30] is the sub-list for method input_type - 20, // [20:20] is the sub-list for extension type_name - 20, // [20:20] is the sub-list for extension extendee - 0, // [0:20] is the sub-list for field type_name + 1, // 5: memos.api.v2.SearchUsersResponse.users:type_name -> memos.api.v2.User + 1, // 6: memos.api.v2.GetUserResponse.user:type_name -> memos.api.v2.User + 1, // 7: memos.api.v2.CreateUserRequest.user:type_name -> memos.api.v2.User + 1, // 8: memos.api.v2.CreateUserResponse.user:type_name -> memos.api.v2.User + 1, // 9: memos.api.v2.UpdateUserRequest.user:type_name -> memos.api.v2.User + 28, // 10: memos.api.v2.UpdateUserRequest.update_mask:type_name -> google.protobuf.FieldMask + 1, // 11: memos.api.v2.UpdateUserResponse.user:type_name -> memos.api.v2.User + 14, // 12: memos.api.v2.GetUserSettingResponse.setting:type_name -> memos.api.v2.UserSetting + 14, // 13: memos.api.v2.UpdateUserSettingRequest.setting:type_name -> memos.api.v2.UserSetting + 28, // 14: memos.api.v2.UpdateUserSettingRequest.update_mask:type_name -> google.protobuf.FieldMask + 14, // 15: memos.api.v2.UpdateUserSettingResponse.setting:type_name -> memos.api.v2.UserSetting + 27, // 16: memos.api.v2.UserAccessToken.issued_at:type_name -> google.protobuf.Timestamp + 27, // 17: memos.api.v2.UserAccessToken.expires_at:type_name -> google.protobuf.Timestamp + 19, // 18: memos.api.v2.ListUserAccessTokensResponse.access_tokens:type_name -> memos.api.v2.UserAccessToken + 27, // 19: memos.api.v2.CreateUserAccessTokenRequest.expires_at:type_name -> google.protobuf.Timestamp + 19, // 20: memos.api.v2.CreateUserAccessTokenResponse.access_token:type_name -> memos.api.v2.UserAccessToken + 2, // 21: memos.api.v2.UserService.ListUsers:input_type -> memos.api.v2.ListUsersRequest + 4, // 22: memos.api.v2.UserService.SearchUsers:input_type -> memos.api.v2.SearchUsersRequest + 6, // 23: memos.api.v2.UserService.GetUser:input_type -> memos.api.v2.GetUserRequest + 8, // 24: memos.api.v2.UserService.CreateUser:input_type -> memos.api.v2.CreateUserRequest + 10, // 25: memos.api.v2.UserService.UpdateUser:input_type -> memos.api.v2.UpdateUserRequest + 12, // 26: memos.api.v2.UserService.DeleteUser:input_type -> memos.api.v2.DeleteUserRequest + 15, // 27: memos.api.v2.UserService.GetUserSetting:input_type -> memos.api.v2.GetUserSettingRequest + 17, // 28: memos.api.v2.UserService.UpdateUserSetting:input_type -> memos.api.v2.UpdateUserSettingRequest + 20, // 29: memos.api.v2.UserService.ListUserAccessTokens:input_type -> memos.api.v2.ListUserAccessTokensRequest + 22, // 30: memos.api.v2.UserService.CreateUserAccessToken:input_type -> memos.api.v2.CreateUserAccessTokenRequest + 24, // 31: memos.api.v2.UserService.DeleteUserAccessToken:input_type -> memos.api.v2.DeleteUserAccessTokenRequest + 3, // 32: memos.api.v2.UserService.ListUsers:output_type -> memos.api.v2.ListUsersResponse + 5, // 33: memos.api.v2.UserService.SearchUsers:output_type -> memos.api.v2.SearchUsersResponse + 7, // 34: memos.api.v2.UserService.GetUser:output_type -> memos.api.v2.GetUserResponse + 9, // 35: memos.api.v2.UserService.CreateUser:output_type -> memos.api.v2.CreateUserResponse + 11, // 36: memos.api.v2.UserService.UpdateUser:output_type -> memos.api.v2.UpdateUserResponse + 13, // 37: memos.api.v2.UserService.DeleteUser:output_type -> memos.api.v2.DeleteUserResponse + 16, // 38: memos.api.v2.UserService.GetUserSetting:output_type -> memos.api.v2.GetUserSettingResponse + 18, // 39: memos.api.v2.UserService.UpdateUserSetting:output_type -> memos.api.v2.UpdateUserSettingResponse + 21, // 40: memos.api.v2.UserService.ListUserAccessTokens:output_type -> memos.api.v2.ListUserAccessTokensResponse + 23, // 41: memos.api.v2.UserService.CreateUserAccessToken:output_type -> memos.api.v2.CreateUserAccessTokenResponse + 25, // 42: memos.api.v2.UserService.DeleteUserAccessToken:output_type -> memos.api.v2.DeleteUserAccessTokenResponse + 32, // [32:43] is the sub-list for method output_type + 21, // [21:32] 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_api_v2_user_service_proto_init() } @@ -1726,7 +1852,7 @@ func file_api_v2_user_service_proto_init() { } } file_api_v2_user_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetUserRequest); i { + switch v := v.(*SearchUsersRequest); i { case 0: return &v.state case 1: @@ -1738,7 +1864,7 @@ func file_api_v2_user_service_proto_init() { } } file_api_v2_user_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetUserResponse); i { + switch v := v.(*SearchUsersResponse); i { case 0: return &v.state case 1: @@ -1750,7 +1876,7 @@ func file_api_v2_user_service_proto_init() { } } file_api_v2_user_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateUserRequest); i { + switch v := v.(*GetUserRequest); i { case 0: return &v.state case 1: @@ -1762,7 +1888,7 @@ func file_api_v2_user_service_proto_init() { } } file_api_v2_user_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateUserResponse); i { + switch v := v.(*GetUserResponse); i { case 0: return &v.state case 1: @@ -1774,7 +1900,7 @@ func file_api_v2_user_service_proto_init() { } } file_api_v2_user_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateUserRequest); i { + switch v := v.(*CreateUserRequest); i { case 0: return &v.state case 1: @@ -1786,7 +1912,7 @@ func file_api_v2_user_service_proto_init() { } } file_api_v2_user_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateUserResponse); i { + switch v := v.(*CreateUserResponse); i { case 0: return &v.state case 1: @@ -1798,7 +1924,7 @@ func file_api_v2_user_service_proto_init() { } } file_api_v2_user_service_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteUserRequest); i { + switch v := v.(*UpdateUserRequest); i { case 0: return &v.state case 1: @@ -1810,7 +1936,7 @@ func file_api_v2_user_service_proto_init() { } } file_api_v2_user_service_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteUserResponse); i { + switch v := v.(*UpdateUserResponse); i { case 0: return &v.state case 1: @@ -1822,7 +1948,7 @@ func file_api_v2_user_service_proto_init() { } } file_api_v2_user_service_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserSetting); i { + switch v := v.(*DeleteUserRequest); i { case 0: return &v.state case 1: @@ -1834,7 +1960,7 @@ func file_api_v2_user_service_proto_init() { } } file_api_v2_user_service_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetUserSettingRequest); i { + switch v := v.(*DeleteUserResponse); i { case 0: return &v.state case 1: @@ -1846,7 +1972,7 @@ func file_api_v2_user_service_proto_init() { } } file_api_v2_user_service_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetUserSettingResponse); i { + switch v := v.(*UserSetting); i { case 0: return &v.state case 1: @@ -1858,7 +1984,7 @@ func file_api_v2_user_service_proto_init() { } } file_api_v2_user_service_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateUserSettingRequest); i { + switch v := v.(*GetUserSettingRequest); i { case 0: return &v.state case 1: @@ -1870,7 +1996,7 @@ func file_api_v2_user_service_proto_init() { } } file_api_v2_user_service_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateUserSettingResponse); i { + switch v := v.(*GetUserSettingResponse); i { case 0: return &v.state case 1: @@ -1882,7 +2008,7 @@ func file_api_v2_user_service_proto_init() { } } file_api_v2_user_service_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserAccessToken); i { + switch v := v.(*UpdateUserSettingRequest); i { case 0: return &v.state case 1: @@ -1894,7 +2020,7 @@ func file_api_v2_user_service_proto_init() { } } file_api_v2_user_service_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListUserAccessTokensRequest); i { + switch v := v.(*UpdateUserSettingResponse); i { case 0: return &v.state case 1: @@ -1906,7 +2032,7 @@ func file_api_v2_user_service_proto_init() { } } file_api_v2_user_service_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListUserAccessTokensResponse); i { + switch v := v.(*UserAccessToken); i { case 0: return &v.state case 1: @@ -1918,7 +2044,7 @@ func file_api_v2_user_service_proto_init() { } } file_api_v2_user_service_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateUserAccessTokenRequest); i { + switch v := v.(*ListUserAccessTokensRequest); i { case 0: return &v.state case 1: @@ -1930,7 +2056,7 @@ func file_api_v2_user_service_proto_init() { } } file_api_v2_user_service_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateUserAccessTokenResponse); i { + switch v := v.(*ListUserAccessTokensResponse); i { case 0: return &v.state case 1: @@ -1942,7 +2068,7 @@ func file_api_v2_user_service_proto_init() { } } file_api_v2_user_service_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteUserAccessTokenRequest); i { + switch v := v.(*CreateUserAccessTokenRequest); i { case 0: return &v.state case 1: @@ -1954,6 +2080,30 @@ func file_api_v2_user_service_proto_init() { } } file_api_v2_user_service_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateUserAccessTokenResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_v2_user_service_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteUserAccessTokenRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_v2_user_service_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DeleteUserAccessTokenResponse); i { case 0: return &v.state @@ -1966,14 +2116,14 @@ func file_api_v2_user_service_proto_init() { } } } - file_api_v2_user_service_proto_msgTypes[19].OneofWrappers = []interface{}{} + file_api_v2_user_service_proto_msgTypes[21].OneofWrappers = []interface{}{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_api_v2_user_service_proto_rawDesc, NumEnums: 1, - NumMessages: 23, + NumMessages: 25, NumExtensions: 0, NumServices: 1, }, diff --git a/proto/gen/api/v2/user_service.pb.gw.go b/proto/gen/api/v2/user_service.pb.gw.go index 5efaa1aabc9e6..0c1a5bfc1de9f 100644 --- a/proto/gen/api/v2/user_service.pb.gw.go +++ b/proto/gen/api/v2/user_service.pb.gw.go @@ -49,6 +49,42 @@ func local_request_UserService_ListUsers_0(ctx context.Context, marshaler runtim } +var ( + filter_UserService_SearchUsers_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_UserService_SearchUsers_0(ctx context.Context, marshaler runtime.Marshaler, client UserServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq SearchUsersRequest + 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_UserService_SearchUsers_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.SearchUsers(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_UserService_SearchUsers_0(ctx context.Context, marshaler runtime.Marshaler, server UserServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq SearchUsersRequest + 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_UserService_SearchUsers_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.SearchUsers(ctx, &protoReq) + return msg, metadata, err + +} + func request_UserService_GetUser_0(ctx context.Context, marshaler runtime.Marshaler, client UserServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq GetUserRequest var metadata runtime.ServerMetadata @@ -662,6 +698,31 @@ func RegisterUserServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux }) + mux.Handle("GET", pattern_UserService_SearchUsers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.UserService/SearchUsers", runtime.WithHTTPPathPattern("/api/v2/users:search")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_UserService_SearchUsers_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_UserService_SearchUsers_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_UserService_GetUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -950,6 +1011,28 @@ func RegisterUserServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux }) + mux.Handle("GET", pattern_UserService_SearchUsers_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) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.UserService/SearchUsers", runtime.WithHTTPPathPattern("/api/v2/users:search")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_UserService_SearchUsers_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_UserService_SearchUsers_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_UserService_GetUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1154,6 +1237,8 @@ func RegisterUserServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux var ( pattern_UserService_ListUsers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v2", "users"}, "")) + pattern_UserService_SearchUsers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v2", "users"}, "search")) + pattern_UserService_GetUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3}, []string{"api", "v2", "users", "name"}, "")) pattern_UserService_CreateUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v2", "users"}, "")) @@ -1176,6 +1261,8 @@ var ( var ( forward_UserService_ListUsers_0 = runtime.ForwardResponseMessage + forward_UserService_SearchUsers_0 = runtime.ForwardResponseMessage + forward_UserService_GetUser_0 = runtime.ForwardResponseMessage forward_UserService_CreateUser_0 = runtime.ForwardResponseMessage diff --git a/proto/gen/api/v2/user_service_grpc.pb.go b/proto/gen/api/v2/user_service_grpc.pb.go index d8345427ad095..000913b5d16e4 100644 --- a/proto/gen/api/v2/user_service_grpc.pb.go +++ b/proto/gen/api/v2/user_service_grpc.pb.go @@ -20,6 +20,7 @@ const _ = grpc.SupportPackageIsVersion7 const ( UserService_ListUsers_FullMethodName = "/memos.api.v2.UserService/ListUsers" + UserService_SearchUsers_FullMethodName = "/memos.api.v2.UserService/SearchUsers" UserService_GetUser_FullMethodName = "/memos.api.v2.UserService/GetUser" UserService_CreateUser_FullMethodName = "/memos.api.v2.UserService/CreateUser" UserService_UpdateUser_FullMethodName = "/memos.api.v2.UserService/UpdateUser" @@ -37,6 +38,8 @@ const ( type UserServiceClient interface { // ListUsers returns a list of users. ListUsers(ctx context.Context, in *ListUsersRequest, opts ...grpc.CallOption) (*ListUsersResponse, error) + // SearchUsers searches users by filter. + SearchUsers(ctx context.Context, in *SearchUsersRequest, opts ...grpc.CallOption) (*SearchUsersResponse, error) // GetUser gets a user by name. GetUser(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*GetUserResponse, error) // CreateUser creates a new user. @@ -74,6 +77,15 @@ func (c *userServiceClient) ListUsers(ctx context.Context, in *ListUsersRequest, return out, nil } +func (c *userServiceClient) SearchUsers(ctx context.Context, in *SearchUsersRequest, opts ...grpc.CallOption) (*SearchUsersResponse, error) { + out := new(SearchUsersResponse) + err := c.cc.Invoke(ctx, UserService_SearchUsers_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *userServiceClient) GetUser(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*GetUserResponse, error) { out := new(GetUserResponse) err := c.cc.Invoke(ctx, UserService_GetUser_FullMethodName, in, out, opts...) @@ -161,6 +173,8 @@ func (c *userServiceClient) DeleteUserAccessToken(ctx context.Context, in *Delet type UserServiceServer interface { // ListUsers returns a list of users. ListUsers(context.Context, *ListUsersRequest) (*ListUsersResponse, error) + // SearchUsers searches users by filter. + SearchUsers(context.Context, *SearchUsersRequest) (*SearchUsersResponse, error) // GetUser gets a user by name. GetUser(context.Context, *GetUserRequest) (*GetUserResponse, error) // CreateUser creates a new user. @@ -189,6 +203,9 @@ type UnimplementedUserServiceServer struct { func (UnimplementedUserServiceServer) ListUsers(context.Context, *ListUsersRequest) (*ListUsersResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ListUsers not implemented") } +func (UnimplementedUserServiceServer) SearchUsers(context.Context, *SearchUsersRequest) (*SearchUsersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SearchUsers not implemented") +} func (UnimplementedUserServiceServer) GetUser(context.Context, *GetUserRequest) (*GetUserResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetUser not implemented") } @@ -247,6 +264,24 @@ func _UserService_ListUsers_Handler(srv interface{}, ctx context.Context, dec fu return interceptor(ctx, in, info, handler) } +func _UserService_SearchUsers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SearchUsersRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).SearchUsers(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UserService_SearchUsers_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).SearchUsers(ctx, req.(*SearchUsersRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _UserService_GetUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(GetUserRequest) if err := dec(in); err != nil { @@ -420,6 +455,10 @@ var UserService_ServiceDesc = grpc.ServiceDesc{ MethodName: "ListUsers", Handler: _UserService_ListUsers_Handler, }, + { + MethodName: "SearchUsers", + Handler: _UserService_SearchUsers_Handler, + }, { MethodName: "GetUser", Handler: _UserService_GetUser_Handler, diff --git a/proto/gen/api/v2/workspace_service.pb.go b/proto/gen/api/v2/workspace_service.pb.go index 89f88fdc3b778..09c8611933560 100644 --- a/proto/gen/api/v2/workspace_service.pb.go +++ b/proto/gen/api/v2/workspace_service.pb.go @@ -26,18 +26,21 @@ type WorkspaceProfile struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + // The name of intance owner. + // Format: "users/{id}" + Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` // version is the current version of instance - Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` // mode is the instance mode (e.g. "prod", "dev" or "demo"). - Mode string `protobuf:"bytes,2,opt,name=mode,proto3" json:"mode,omitempty"` - // allow_registration is whether the registration is allowed. - AllowRegistration bool `protobuf:"varint,3,opt,name=allow_registration,json=allowRegistration,proto3" json:"allow_registration,omitempty"` - // allow_password_login is whether the password login is allowed. - DisablePasswordLogin bool `protobuf:"varint,4,opt,name=disable_password_login,json=disablePasswordLogin,proto3" json:"disable_password_login,omitempty"` + Mode string `protobuf:"bytes,3,opt,name=mode,proto3" json:"mode,omitempty"` + // disallow_signup is whether the signup is disallowed. + DisallowSignup bool `protobuf:"varint,4,opt,name=disallow_signup,json=disallowSignup,proto3" json:"disallow_signup,omitempty"` + // disable_password_login is whether the password login is disabled. + DisablePasswordLogin bool `protobuf:"varint,5,opt,name=disable_password_login,json=disablePasswordLogin,proto3" json:"disable_password_login,omitempty"` // additional_script is the additional script. - AdditionalScript string `protobuf:"bytes,5,opt,name=additional_script,json=additionalScript,proto3" json:"additional_script,omitempty"` + AdditionalScript string `protobuf:"bytes,6,opt,name=additional_script,json=additionalScript,proto3" json:"additional_script,omitempty"` // additional_style is the additional style. - AdditionalStyle string `protobuf:"bytes,6,opt,name=additional_style,json=additionalStyle,proto3" json:"additional_style,omitempty"` + AdditionalStyle string `protobuf:"bytes,7,opt,name=additional_style,json=additionalStyle,proto3" json:"additional_style,omitempty"` } func (x *WorkspaceProfile) Reset() { @@ -72,6 +75,13 @@ func (*WorkspaceProfile) Descriptor() ([]byte, []int) { return file_api_v2_workspace_service_proto_rawDescGZIP(), []int{0} } +func (x *WorkspaceProfile) GetOwner() string { + if x != nil { + return x.Owner + } + return "" +} + func (x *WorkspaceProfile) GetVersion() string { if x != nil { return x.Version @@ -86,9 +96,9 @@ func (x *WorkspaceProfile) GetMode() string { return "" } -func (x *WorkspaceProfile) GetAllowRegistration() bool { +func (x *WorkspaceProfile) GetDisallowSignup() bool { if x != nil { - return x.AllowRegistration + return x.DisallowSignup } return false } @@ -206,22 +216,23 @@ var file_api_v2_workspace_service_proto_rawDesc = []byte{ 0x63, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 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, 0x22, 0xfd, 0x01, 0x0a, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8d, 0x02, 0x0a, 0x10, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, - 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6d, - 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x12, - 0x2d, 0x0a, 0x12, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x61, 0x6c, 0x6c, - 0x6f, 0x77, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x34, + 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x64, 0x69, 0x73, 0x61, 0x6c, 0x6c, 0x6f, + 0x77, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x75, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, + 0x64, 0x69, 0x73, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x53, 0x69, 0x67, 0x6e, 0x75, 0x70, 0x12, 0x34, 0x0a, 0x16, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, - 0x72, 0x64, 0x5f, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x14, + 0x72, 0x64, 0x5f, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x14, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x2b, 0x0a, 0x11, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, - 0x61, 0x6c, 0x5f, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x61, 0x6c, 0x5f, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x12, 0x29, 0x0a, 0x10, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, - 0x73, 0x74, 0x79, 0x6c, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x61, 0x64, 0x64, + 0x73, 0x74, 0x79, 0x6c, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x22, 0x1c, 0x0a, 0x1a, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x6a, 0x0a, 0x1b, 0x47, 0x65, diff --git a/proto/gen/store/README.md b/proto/gen/store/README.md index 5164aa2fb41db..e8a4257e073fb 100644 --- a/proto/gen/store/README.md +++ b/proto/gen/store/README.md @@ -11,6 +11,11 @@ - [store/common.proto](#store_common-proto) - [RowStatus](#memos-store-RowStatus) +- [store/idp.proto](#store_idp-proto) + - [IdentityProviderConfig](#memos-store-IdentityProviderConfig) + - [IdentityProviderConfig.FieldMapping](#memos-store-IdentityProviderConfig-FieldMapping) + - [IdentityProviderConfig.OAuth2](#memos-store-IdentityProviderConfig-OAuth2) + - [store/inbox.proto](#store_inbox-proto) - [InboxMessage](#memos-store-InboxMessage) @@ -133,6 +138,75 @@ + + + +## store/idp.proto + + + + + +### IdentityProviderConfig + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| oauth2 | [IdentityProviderConfig.OAuth2](#memos-store-IdentityProviderConfig-OAuth2) | | | + + + + + + + + +### IdentityProviderConfig.FieldMapping + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| identifier | [string](#string) | | | +| display_name | [string](#string) | | | +| email | [string](#string) | | | + + + + + + + + +### IdentityProviderConfig.OAuth2 + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| client_id | [string](#string) | | | +| client_secret | [string](#string) | | | +| auth_url | [string](#string) | | | +| token_url | [string](#string) | | | +| user_info_url | [string](#string) | | | +| scopes | [string](#string) | repeated | | +| field_mapping | [IdentityProviderConfig.FieldMapping](#memos-store-IdentityProviderConfig-FieldMapping) | | | + + + + + + + + + + + + + + + diff --git a/proto/gen/store/idp.pb.go b/proto/gen/store/idp.pb.go new file mode 100644 index 0000000000000..318e1cd97c362 --- /dev/null +++ b/proto/gen/store/idp.pb.go @@ -0,0 +1,388 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: store/idp.proto + +package store + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +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) +) + +type IdentityProviderConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Config: + // + // *IdentityProviderConfig_Oauth2 + Config isIdentityProviderConfig_Config `protobuf_oneof:"config"` +} + +func (x *IdentityProviderConfig) Reset() { + *x = IdentityProviderConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_store_idp_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *IdentityProviderConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IdentityProviderConfig) ProtoMessage() {} + +func (x *IdentityProviderConfig) ProtoReflect() protoreflect.Message { + mi := &file_store_idp_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 IdentityProviderConfig.ProtoReflect.Descriptor instead. +func (*IdentityProviderConfig) Descriptor() ([]byte, []int) { + return file_store_idp_proto_rawDescGZIP(), []int{0} +} + +func (m *IdentityProviderConfig) GetConfig() isIdentityProviderConfig_Config { + if m != nil { + return m.Config + } + return nil +} + +func (x *IdentityProviderConfig) GetOauth2() *IdentityProviderConfig_OAuth2 { + if x, ok := x.GetConfig().(*IdentityProviderConfig_Oauth2); ok { + return x.Oauth2 + } + return nil +} + +type isIdentityProviderConfig_Config interface { + isIdentityProviderConfig_Config() +} + +type IdentityProviderConfig_Oauth2 struct { + Oauth2 *IdentityProviderConfig_OAuth2 `protobuf:"bytes,1,opt,name=oauth2,proto3,oneof"` +} + +func (*IdentityProviderConfig_Oauth2) isIdentityProviderConfig_Config() {} + +type IdentityProviderConfig_FieldMapping struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Identifier string `protobuf:"bytes,1,opt,name=identifier,proto3" json:"identifier,omitempty"` + DisplayName string `protobuf:"bytes,2,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` + Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` +} + +func (x *IdentityProviderConfig_FieldMapping) Reset() { + *x = IdentityProviderConfig_FieldMapping{} + if protoimpl.UnsafeEnabled { + mi := &file_store_idp_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *IdentityProviderConfig_FieldMapping) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IdentityProviderConfig_FieldMapping) ProtoMessage() {} + +func (x *IdentityProviderConfig_FieldMapping) ProtoReflect() protoreflect.Message { + mi := &file_store_idp_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 IdentityProviderConfig_FieldMapping.ProtoReflect.Descriptor instead. +func (*IdentityProviderConfig_FieldMapping) Descriptor() ([]byte, []int) { + return file_store_idp_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *IdentityProviderConfig_FieldMapping) GetIdentifier() string { + if x != nil { + return x.Identifier + } + return "" +} + +func (x *IdentityProviderConfig_FieldMapping) GetDisplayName() string { + if x != nil { + return x.DisplayName + } + return "" +} + +func (x *IdentityProviderConfig_FieldMapping) GetEmail() string { + if x != nil { + return x.Email + } + return "" +} + +type IdentityProviderConfig_OAuth2 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` + ClientSecret string `protobuf:"bytes,2,opt,name=client_secret,json=clientSecret,proto3" json:"client_secret,omitempty"` + AuthUrl string `protobuf:"bytes,3,opt,name=auth_url,json=authUrl,proto3" json:"auth_url,omitempty"` + TokenUrl string `protobuf:"bytes,4,opt,name=token_url,json=tokenUrl,proto3" json:"token_url,omitempty"` + UserInfoUrl string `protobuf:"bytes,5,opt,name=user_info_url,json=userInfoUrl,proto3" json:"user_info_url,omitempty"` + Scopes []string `protobuf:"bytes,6,rep,name=scopes,proto3" json:"scopes,omitempty"` + FieldMapping *IdentityProviderConfig_FieldMapping `protobuf:"bytes,7,opt,name=field_mapping,json=fieldMapping,proto3" json:"field_mapping,omitempty"` +} + +func (x *IdentityProviderConfig_OAuth2) Reset() { + *x = IdentityProviderConfig_OAuth2{} + if protoimpl.UnsafeEnabled { + mi := &file_store_idp_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *IdentityProviderConfig_OAuth2) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IdentityProviderConfig_OAuth2) ProtoMessage() {} + +func (x *IdentityProviderConfig_OAuth2) ProtoReflect() protoreflect.Message { + mi := &file_store_idp_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 IdentityProviderConfig_OAuth2.ProtoReflect.Descriptor instead. +func (*IdentityProviderConfig_OAuth2) Descriptor() ([]byte, []int) { + return file_store_idp_proto_rawDescGZIP(), []int{0, 1} +} + +func (x *IdentityProviderConfig_OAuth2) GetClientId() string { + if x != nil { + return x.ClientId + } + return "" +} + +func (x *IdentityProviderConfig_OAuth2) GetClientSecret() string { + if x != nil { + return x.ClientSecret + } + return "" +} + +func (x *IdentityProviderConfig_OAuth2) GetAuthUrl() string { + if x != nil { + return x.AuthUrl + } + return "" +} + +func (x *IdentityProviderConfig_OAuth2) GetTokenUrl() string { + if x != nil { + return x.TokenUrl + } + return "" +} + +func (x *IdentityProviderConfig_OAuth2) GetUserInfoUrl() string { + if x != nil { + return x.UserInfoUrl + } + return "" +} + +func (x *IdentityProviderConfig_OAuth2) GetScopes() []string { + if x != nil { + return x.Scopes + } + return nil +} + +func (x *IdentityProviderConfig_OAuth2) GetFieldMapping() *IdentityProviderConfig_FieldMapping { + if x != nil { + return x.FieldMapping + } + return nil +} + +var File_store_idp_proto protoreflect.FileDescriptor + +var file_store_idp_proto_rawDesc = []byte{ + 0x0a, 0x0f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x69, 0x64, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x0b, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x22, 0xe9, + 0x03, 0x0a, 0x16, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, + 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x44, 0x0a, 0x06, 0x6f, 0x61, 0x75, + 0x74, 0x68, 0x32, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, + 0x73, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, + 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x4f, + 0x41, 0x75, 0x74, 0x68, 0x32, 0x48, 0x00, 0x52, 0x06, 0x6f, 0x61, 0x75, 0x74, 0x68, 0x32, 0x1a, + 0x67, 0x0a, 0x0c, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x12, + 0x1e, 0x0a, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, + 0x21, 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, + 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x1a, 0x95, 0x02, 0x0a, 0x06, 0x4f, 0x41, 0x75, + 0x74, 0x68, 0x32, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x64, + 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x63, 0x72, 0x65, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, + 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x75, 0x72, + 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x75, 0x74, 0x68, 0x55, 0x72, 0x6c, + 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x55, 0x72, 0x6c, 0x12, 0x22, 0x0a, + 0x0d, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x75, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x55, 0x72, + 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x06, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x12, 0x55, 0x0a, 0x0d, 0x66, 0x69, 0x65, + 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x30, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x49, + 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x70, 0x70, 0x69, + 0x6e, 0x67, 0x52, 0x0c, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, + 0x42, 0x08, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x93, 0x01, 0x0a, 0x0f, 0x63, + 0x6f, 0x6d, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x42, 0x08, + 0x49, 0x64, 0x70, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x29, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x75, 0x73, 0x65, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, + 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, + 0x73, 0x74, 0x6f, 0x72, 0x65, 0xa2, 0x02, 0x03, 0x4d, 0x53, 0x58, 0xaa, 0x02, 0x0b, 0x4d, 0x65, + 0x6d, 0x6f, 0x73, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0xca, 0x02, 0x0b, 0x4d, 0x65, 0x6d, 0x6f, + 0x73, 0x5c, 0x53, 0x74, 0x6f, 0x72, 0x65, 0xe2, 0x02, 0x17, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c, + 0x53, 0x74, 0x6f, 0x72, 0x65, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0xea, 0x02, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x53, 0x74, 0x6f, 0x72, 0x65, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_store_idp_proto_rawDescOnce sync.Once + file_store_idp_proto_rawDescData = file_store_idp_proto_rawDesc +) + +func file_store_idp_proto_rawDescGZIP() []byte { + file_store_idp_proto_rawDescOnce.Do(func() { + file_store_idp_proto_rawDescData = protoimpl.X.CompressGZIP(file_store_idp_proto_rawDescData) + }) + return file_store_idp_proto_rawDescData +} + +var file_store_idp_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_store_idp_proto_goTypes = []interface{}{ + (*IdentityProviderConfig)(nil), // 0: memos.store.IdentityProviderConfig + (*IdentityProviderConfig_FieldMapping)(nil), // 1: memos.store.IdentityProviderConfig.FieldMapping + (*IdentityProviderConfig_OAuth2)(nil), // 2: memos.store.IdentityProviderConfig.OAuth2 +} +var file_store_idp_proto_depIdxs = []int32{ + 2, // 0: memos.store.IdentityProviderConfig.oauth2:type_name -> memos.store.IdentityProviderConfig.OAuth2 + 1, // 1: memos.store.IdentityProviderConfig.OAuth2.field_mapping:type_name -> memos.store.IdentityProviderConfig.FieldMapping + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_store_idp_proto_init() } +func file_store_idp_proto_init() { + if File_store_idp_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_store_idp_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*IdentityProviderConfig); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_store_idp_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*IdentityProviderConfig_FieldMapping); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_store_idp_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*IdentityProviderConfig_OAuth2); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_store_idp_proto_msgTypes[0].OneofWrappers = []interface{}{ + (*IdentityProviderConfig_Oauth2)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_store_idp_proto_rawDesc, + NumEnums: 0, + NumMessages: 3, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_store_idp_proto_goTypes, + DependencyIndexes: file_store_idp_proto_depIdxs, + MessageInfos: file_store_idp_proto_msgTypes, + }.Build() + File_store_idp_proto = out.File + file_store_idp_proto_rawDesc = nil + file_store_idp_proto_goTypes = nil + file_store_idp_proto_depIdxs = nil +} diff --git a/proto/store/idp.proto b/proto/store/idp.proto new file mode 100644 index 0000000000000..b60c7cedafc7f --- /dev/null +++ b/proto/store/idp.proto @@ -0,0 +1,27 @@ +syntax = "proto3"; + +package memos.store; + +option go_package = "gen/store"; + +message IdentityProviderConfig { + message FieldMapping { + string identifier = 1; + string display_name = 2; + string email = 3; + } + + message OAuth2 { + string client_id = 1; + string client_secret = 2; + string auth_url = 3; + string token_url = 4; + string user_info_url = 5; + repeated string scopes = 6; + FieldMapping field_mapping = 7; + } + + oneof config { + OAuth2 oauth2 = 1; + } +} diff --git a/server/integration/telegram.go b/server/integration/telegram.go index 20f85ac897d45..c19e7cbb03572 100644 --- a/server/integration/telegram.go +++ b/server/integration/telegram.go @@ -74,9 +74,9 @@ func (t *TelegramHandler) MessageHandle(ctx context.Context, bot *telegram.Bot, } create := &store.Memo{ - ResourceName: shortuuid.New(), - CreatorID: creatorID, - Visibility: store.Private, + UID: shortuuid.New(), + CreatorID: creatorID, + Visibility: store.Private, } if message.Text != nil { create.Content = convertToMarkdown(*message.Text, message.Entities) @@ -121,12 +121,12 @@ func (t *TelegramHandler) MessageHandle(ctx context.Context, bot *telegram.Bot, for _, attachment := range attachments { // Fill the common field of create create := store.Resource{ - ResourceName: shortuuid.New(), - CreatorID: creatorID, - Filename: filepath.Base(attachment.FileName), - Type: attachment.GetMimeType(), - Size: attachment.FileSize, - MemoID: &memoMessage.ID, + UID: shortuuid.New(), + CreatorID: creatorID, + Filename: filepath.Base(attachment.FileName), + Type: attachment.GetMimeType(), + Size: attachment.FileSize, + MemoID: &memoMessage.ID, } err := apiv1.SaveResourceBlob(ctx, t.store, &create, bytes.NewReader(attachment.Data)) diff --git a/server/profile/profile.go b/server/profile/profile.go index bd22193f8b7a2..d9d15c27fc3a2 100644 --- a/server/profile/profile.go +++ b/server/profile/profile.go @@ -32,6 +32,8 @@ type Profile struct { Version string `json:"version"` // Frontend indicate the frontend is enabled or not Frontend bool `json:"-"` + // Origins is the list of allowed origins + Origins []string `json:"-"` } func (p *Profile) IsDev() bool { @@ -51,11 +53,9 @@ func checkDataDir(dataDir string) (string, error) { // Trim trailing \ or / in case user supplies dataDir = strings.TrimRight(dataDir, "\\/") - if _, err := os.Stat(dataDir); err != nil { return "", errors.Wrapf(err, "unable to access data folder %s", dataDir) } - return dataDir, nil } diff --git a/server/route/api/v1/auth.go b/server/route/api/v1/auth.go index 2912ffa744533..2e5ed1a831ae4 100644 --- a/server/route/api/v1/auth.go +++ b/server/route/api/v1/auth.go @@ -269,7 +269,7 @@ func (s *APIV1Service) SignUp(c echo.Context) error { if err != nil { return echo.NewHTTPError(http.StatusBadRequest, "Failed to find users").SetInternal(err) } - if !util.ResourceNameMatcher.MatchString(strings.ToLower(signup.Username)) { + if !util.UIDMatcher.MatchString(strings.ToLower(signup.Username)) { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid username %s", signup.Username)).SetInternal(err) } diff --git a/server/route/api/v1/memo.go b/server/route/api/v1/memo.go index 90f01f084afb8..08003ea014437 100644 --- a/server/route/api/v1/memo.go +++ b/server/route/api/v1/memo.go @@ -827,7 +827,7 @@ func (s *APIV1Service) UpdateMemo(c echo.Context) error { func (s *APIV1Service) convertMemoFromStore(ctx context.Context, memo *store.Memo) (*Memo, error) { memoMessage := &Memo{ ID: memo.ID, - Name: memo.ResourceName, + Name: memo.UID, RowStatus: RowStatus(memo.RowStatus.String()), CreatorID: memo.CreatorID, CreatedTs: memo.CreatedTs, @@ -921,11 +921,11 @@ func convertCreateMemoRequestToMemoMessage(memoCreate *CreateMemoRequest) *store createdTs = *memoCreate.CreatedTs } return &store.Memo{ - ResourceName: shortuuid.New(), - CreatorID: memoCreate.CreatorID, - CreatedTs: createdTs, - Content: memoCreate.Content, - Visibility: store.Visibility(memoCreate.Visibility), + UID: shortuuid.New(), + CreatorID: memoCreate.CreatorID, + CreatedTs: createdTs, + Content: memoCreate.Content, + Visibility: store.Visibility(memoCreate.Visibility), } } diff --git a/server/route/api/v1/resource.go b/server/route/api/v1/resource.go index 6f51169533ae7..eb1eeb4be2f61 100644 --- a/server/route/api/v1/resource.go +++ b/server/route/api/v1/resource.go @@ -26,6 +26,7 @@ import ( type Resource struct { ID int32 `json:"id"` Name string `json:"name"` + UID string `json:"uid"` // Standard fields CreatorID int32 `json:"creatorId"` @@ -138,7 +139,7 @@ func (s *APIV1Service) CreateResource(c echo.Context) error { } create := &store.Resource{ - ResourceName: shortuuid.New(), + UID: shortuuid.New(), CreatorID: userID, Filename: request.Filename, ExternalLink: request.ExternalLink, @@ -220,11 +221,11 @@ func (s *APIV1Service) UploadResource(c echo.Context) error { defer sourceFile.Close() create := &store.Resource{ - ResourceName: shortuuid.New(), - CreatorID: userID, - Filename: file.Filename, - Type: file.Header.Get("Content-Type"), - Size: file.Size, + UID: shortuuid.New(), + CreatorID: userID, + Filename: file.Filename, + Type: file.Header.Get("Content-Type"), + Size: file.Size, } err = SaveResourceBlob(ctx, s.Store, create, sourceFile) if err != nil { @@ -371,7 +372,8 @@ func replacePathTemplate(path, filename string) string { func convertResourceFromStore(resource *store.Resource) *Resource { return &Resource{ ID: resource.ID, - Name: resource.ResourceName, + Name: fmt.Sprintf("resources/%d", resource.ID), + UID: resource.UID, CreatorID: resource.CreatorID, CreatedTs: resource.CreatedTs, UpdatedTs: resource.UpdatedTs, diff --git a/server/route/api/v1/tag.go b/server/route/api/v1/tag.go index e75416a2ef575..72da0ccc03173 100644 --- a/server/route/api/v1/tag.go +++ b/server/route/api/v1/tag.go @@ -5,10 +5,10 @@ import ( "fmt" "net/http" "regexp" + "slices" "sort" "github.com/labstack/echo/v4" - "golang.org/x/exp/slices" "github.com/usememos/memos/store" ) diff --git a/server/route/api/v1/user.go b/server/route/api/v1/user.go index 1f56fc2b63b5a..f613203cd7ec4 100644 --- a/server/route/api/v1/user.go +++ b/server/route/api/v1/user.go @@ -157,7 +157,7 @@ func (s *APIV1Service) CreateUser(c echo.Context) error { if err := userCreate.Validate(); err != nil { return echo.NewHTTPError(http.StatusBadRequest, "Invalid user create format").SetInternal(err) } - if !util.ResourceNameMatcher.MatchString(strings.ToLower(userCreate.Username)) { + if !util.UIDMatcher.MatchString(strings.ToLower(userCreate.Username)) { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid username %s", userCreate.Username)).SetInternal(err) } // Disallow host user to be created. @@ -314,14 +314,6 @@ func (s *APIV1Service) DeleteUser(c echo.Context) error { return echo.NewHTTPError(http.StatusBadRequest, "Cannot delete current user") } - findUser, err := s.Store.GetUser(ctx, &store.FindUser{ID: &userID}) - if err != nil { - return echo.NewHTTPError(http.StatusInternalServerError, "Failed to find user").SetInternal(err) - } - if s.Profile.Mode == "demo" && findUser.Username == "memos-demo" { - return echo.NewHTTPError(http.StatusForbidden, "Unauthorized to delete this user in demo mode") - } - if err := s.Store.DeleteUser(ctx, &store.DeleteUser{ ID: userID, }); err != nil { @@ -372,10 +364,6 @@ func (s *APIV1Service) UpdateUser(c echo.Context) error { return echo.NewHTTPError(http.StatusBadRequest, "Invalid update user request").SetInternal(err) } - if s.Profile.Mode == "demo" && *request.Username == "memos-demo" { - return echo.NewHTTPError(http.StatusForbidden, "Unauthorized to update user in demo mode") - } - currentTs := time.Now().Unix() userUpdate := &store.UpdateUser{ ID: userID, @@ -389,7 +377,7 @@ func (s *APIV1Service) UpdateUser(c echo.Context) error { } } if request.Username != nil { - if !util.ResourceNameMatcher.MatchString(strings.ToLower(*request.Username)) { + if !util.UIDMatcher.MatchString(strings.ToLower(*request.Username)) { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid username %s", *request.Username)).SetInternal(err) } userUpdate.Username = request.Username diff --git a/server/route/api/v2/acl_config.go b/server/route/api/v2/acl_config.go index 0ed4fbaa41df5..2eb845b5dac98 100644 --- a/server/route/api/v2/acl_config.go +++ b/server/route/api/v2/acl_config.go @@ -1,7 +1,5 @@ package v2 -import "strings" - var authenticationAllowlistMethods = map[string]bool{ "/memos.api.v2.WorkspaceService/GetWorkspaceProfile": true, "/memos.api.v2.WorkspaceSettingService/GetWorkspaceSetting": true, @@ -11,19 +9,18 @@ var authenticationAllowlistMethods = map[string]bool{ "/memos.api.v2.AuthService/SignOut": true, "/memos.api.v2.AuthService/SignUp": true, "/memos.api.v2.UserService/GetUser": true, + "/memos.api.v2.UserService/SearchUsers": true, "/memos.api.v2.MemoService/ListMemos": true, "/memos.api.v2.MemoService/GetMemo": true, - "/memos.api.v2.MemoService/GetMemoByName": true, + "/memos.api.v2.MemoService/SearchMemos": true, "/memos.api.v2.MemoService/ListMemoResources": true, "/memos.api.v2.MemoService/ListMemoRelations": true, "/memos.api.v2.MemoService/ListMemoComments": true, + "/memos.api.v2.LinkService/GetLinkMetadata": true, } // isUnauthorizeAllowedMethod returns whether the method is exempted from authentication. func isUnauthorizeAllowedMethod(fullMethodName string) bool { - if strings.HasPrefix(fullMethodName, "/grpc.reflection") { - return true - } return authenticationAllowlistMethods[fullMethodName] } diff --git a/server/route/api/v2/apidocs.swagger.md b/server/route/api/v2/apidocs.swagger.md index ee03dcf99c332..57a000981a82b 100644 --- a/server/route/api/v2/apidocs.swagger.md +++ b/server/route/api/v2/apidocs.swagger.md @@ -143,6 +143,24 @@ UpdateInbox updates an inbox. ### /api/v2/{name_1} +#### GET +##### Summary + +GetResource returns a resource by name. + +##### Parameters + +| Name | Located in | Description | Required | Schema | +| ---- | ---------- | ----------- | -------- | ------ | +| name_1 | path | | Yes | string | + +##### Responses + +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | A successful response. | [v2GetResourceResponse](#v2getresourceresponse) | +| default | An unexpected error response. | [googlerpcStatus](#googlerpcstatus) | + #### DELETE ##### Summary @@ -161,6 +179,25 @@ DeleteInbox deletes an inbox. | 200 | A successful response. | [v2DeleteInboxResponse](#v2deleteinboxresponse) | | default | An unexpected error response. | [googlerpcStatus](#googlerpcstatus) | +--- +## LinkService + +### /api/v2/link_metadata + +#### GET +##### Parameters + +| Name | Located in | Description | Required | Schema | +| ---- | ---------- | ----------- | -------- | ------ | +| link | query | | No | string | + +##### Responses + +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | A successful response. | [v2GetLinkMetadataResponse](#v2getlinkmetadataresponse) | +| default | An unexpected error response. | [googlerpcStatus](#googlerpcstatus) | + --- ## MemoService @@ -177,7 +214,7 @@ ListMemos lists memos with pagination and filter. | ---- | ---------- | ----------- | -------- | ------ | | pageSize | query | The maximum number of memos to return. | No | integer | | pageToken | query | A page token, received from a previous `ListMemos` call. Provide this to retrieve the subsequent page. | No | string | -| filter | query | Filter is used to filter memos returned in the list. Format: "creator == users/{username} && visibilities == ['PUBLIC', 'PROTECTED']" | No | string | +| filter | query | Filter is used to filter memos returned in the list. Format: "creator == users/{uid} && visibilities == ['PUBLIC', 'PROTECTED']" | No | string | ##### Responses @@ -204,60 +241,101 @@ CreateMemo creates a memo. | 200 | A successful response. | [v2CreateMemoResponse](#v2creatememoresponse) | | default | An unexpected error response. | [googlerpcStatus](#googlerpcstatus) | -### /api/v2/memos/name/{name} +### /api/v2/memos/stats #### GET ##### Summary -GetMemoByName gets a memo by name. +GetUserMemosStats gets stats of memos for a user. ##### Parameters | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| name | path | | Yes | string | +| name | query | name is the name of the user to get stats for. Format: users/{id} | No | string | +| timezone | query | timezone location Format: uses tz identifier https://en.wikipedia.org/wiki/List_of_tz_database_time_zones | No | string | +| filter | query | Same as ListMemosRequest.filter | No | string | ##### Responses | Code | Description | Schema | | ---- | ----------- | ------ | -| 200 | A successful response. | [v2GetMemoByNameResponse](#v2getmemobynameresponse) | +| 200 | A successful response. | [v2GetUserMemosStatsResponse](#v2getusermemosstatsresponse) | | default | An unexpected error response. | [googlerpcStatus](#googlerpcstatus) | -### /api/v2/memos/stats +### /api/v2/memos:export -#### GET +#### POST ##### Summary -GetUserMemosStats gets stats of memos for a user. +ExportMemos exports memos. ##### Parameters | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| name | query | name is the name of the user to get stats for. Format: users/{username} | No | string | -| timezone | query | timezone location Format: uses tz identifier https://en.wikipedia.org/wiki/List_of_tz_database_time_zones | No | string | | filter | query | Same as ListMemosRequest.filter | No | string | ##### Responses | Code | Description | Schema | | ---- | ----------- | ------ | -| 200 | A successful response. | [v2GetUserMemosStatsResponse](#v2getusermemosstatsresponse) | +| 200 | A successful response. | [v2ExportMemosResponse](#v2exportmemosresponse) | | default | An unexpected error response. | [googlerpcStatus](#googlerpcstatus) | -### /api/v2/memos/{id} +### /api/v2/memos:search #### GET ##### Summary -GetMemo gets a memo by id. +SearchMemos searches memos. ##### Parameters | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| id | path | | Yes | integer | +| filter | query | Filter is used to filter memos returned. Format: "creator == users/{uid} && visibilities == ['PUBLIC', 'PROTECTED']" | No | string | + +##### Responses + +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | A successful response. | [v2SearchMemosResponse](#v2searchmemosresponse) | +| default | An unexpected error response. | [googlerpcStatus](#googlerpcstatus) | + +### /api/v2/{memo.name} + +#### PATCH +##### Summary + +UpdateMemo updates a memo. + +##### Parameters + +| Name | Located in | Description | Required | Schema | +| ---- | ---------- | ----------- | -------- | ------ | +| memo.name | path | The name of the memo. Format: memos/{id} id is the system generated id. | Yes | string | +| memo | body | | Yes | { **"uid"**: string, **"rowStatus"**: [apiv2RowStatus](#apiv2rowstatus), **"creator"**: string, **"createTime"**: dateTime, **"updateTime"**: dateTime, **"displayTime"**: dateTime, **"content"**: string, **"visibility"**: [v2Visibility](#v2visibility), **"pinned"**: boolean, **"parentId"**: integer, **"resources"**: [ [v2Resource](#v2resource) ], **"relations"**: [ [v2MemoRelation](#v2memorelation) ], **"reactions"**: [ [apiv2Reaction](#apiv2reaction) ] } | + +##### Responses + +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | A successful response. | [v2UpdateMemoResponse](#v2updatememoresponse) | +| default | An unexpected error response. | [googlerpcStatus](#googlerpcstatus) | + +### /api/v2/{name_2} + +#### GET +##### Summary + +GetMemo gets a memo. + +##### Parameters + +| Name | Located in | Description | Required | Schema | +| ---- | ---------- | ----------- | -------- | ------ | +| name_2 | path | The name of the memo. Format: memos/{id} | Yes | string | ##### Responses @@ -269,13 +347,33 @@ GetMemo gets a memo by id. #### DELETE ##### Summary -DeleteMemo deletes a memo by id. +DeleteResource deletes a resource by name. ##### Parameters | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| id | path | | Yes | integer | +| name_2 | path | | Yes | string | + +##### Responses + +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | A successful response. | [v2DeleteResourceResponse](#v2deleteresourceresponse) | +| default | An unexpected error response. | [googlerpcStatus](#googlerpcstatus) | + +### /api/v2/{name_3} + +#### DELETE +##### Summary + +DeleteMemo deletes a memo. + +##### Parameters + +| Name | Located in | Description | Required | Schema | +| ---- | ---------- | ----------- | -------- | ------ | +| name_3 | path | The name of the memo. Format: memos/{id} | Yes | string | ##### Responses @@ -284,7 +382,7 @@ DeleteMemo deletes a memo by id. | 200 | A successful response. | [v2DeleteMemoResponse](#v2deletememoresponse) | | default | An unexpected error response. | [googlerpcStatus](#googlerpcstatus) | -### /api/v2/memos/{id}/comments +### /api/v2/{name}/comments #### GET ##### Summary @@ -295,7 +393,7 @@ ListMemoComments lists comments for a memo. | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| id | path | | Yes | integer | +| name | path | The name of the memo. Format: memos/{id} | Yes | string | ##### Responses @@ -313,9 +411,9 @@ CreateMemoComment creates a comment for a memo. | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| id | path | id is the memo id to create comment for. | Yes | integer | -| create.content | query | | No | string | -| create.visibility | query | | No | string | +| name | path | The name of the memo. Format: memos/{id} | Yes | string | +| comment.content | query | | No | string | +| comment.visibility | query | | No | string | ##### Responses @@ -324,7 +422,7 @@ CreateMemoComment creates a comment for a memo. | 200 | A successful response. | [v2CreateMemoCommentResponse](#v2creatememocommentresponse) | | default | An unexpected error response. | [googlerpcStatus](#googlerpcstatus) | -### /api/v2/memos/{id}/reactions +### /api/v2/{name}/reactions #### GET ##### Summary @@ -335,7 +433,7 @@ ListMemoReactions lists reactions for a memo. | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| id | path | | Yes | integer | +| name | path | The name of the memo. Format: memos/{id} | Yes | string | ##### Responses @@ -353,9 +451,9 @@ UpsertMemoReaction upserts a reaction for a memo. | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| id | path | | Yes | integer | +| name | path | The name of the memo. Format: memos/{id} | Yes | string | | reaction.id | query | | No | integer | -| reaction.creator | query | | No | string | +| reaction.creator | query | The name of the creator. Format: users/{id} | No | string | | reaction.contentId | query | | No | string | | reaction.reactionType | query | | No | string | @@ -366,7 +464,7 @@ UpsertMemoReaction upserts a reaction for a memo. | 200 | A successful response. | [v2UpsertMemoReactionResponse](#v2upsertmemoreactionresponse) | | default | An unexpected error response. | [googlerpcStatus](#googlerpcstatus) | -### /api/v2/memos/{id}/reactions/{reactionId} +### /api/v2/{name}/reactions/{reactionId} #### DELETE ##### Summary @@ -377,7 +475,7 @@ DeleteMemoReaction deletes a reaction for a memo. | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| id | path | | Yes | integer | +| name | path | The name of the memo. Format: memos/{id} | Yes | string | | reactionId | path | | Yes | integer | ##### Responses @@ -387,7 +485,7 @@ DeleteMemoReaction deletes a reaction for a memo. | 200 | A successful response. | [v2DeleteMemoReactionResponse](#v2deletememoreactionresponse) | | default | An unexpected error response. | [googlerpcStatus](#googlerpcstatus) | -### /api/v2/memos/{id}/relations +### /api/v2/{name}/relations #### GET ##### Summary @@ -398,7 +496,7 @@ ListMemoRelations lists relations for a memo. | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| id | path | | Yes | integer | +| name | path | The name of the memo. Format: memos/{id} | Yes | string | ##### Responses @@ -416,7 +514,7 @@ SetMemoRelations sets relations for a memo. | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| id | path | | Yes | integer | +| name | path | The name of the memo. Format: memos/{id} | Yes | string | | body | body | | Yes | [MemoServiceSetMemoRelationsBody](#memoservicesetmemorelationsbody) | ##### Responses @@ -426,7 +524,7 @@ SetMemoRelations sets relations for a memo. | 200 | A successful response. | [v2SetMemoRelationsResponse](#v2setmemorelationsresponse) | | default | An unexpected error response. | [googlerpcStatus](#googlerpcstatus) | -### /api/v2/memos/{id}/resources +### /api/v2/{name}/resources #### GET ##### Summary @@ -437,7 +535,7 @@ ListMemoResources lists resources for a memo. | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| id | path | | Yes | integer | +| name | path | The name of the memo. Format: memos/{id} | Yes | string | ##### Responses @@ -455,7 +553,7 @@ SetMemoResources sets resources for a memo. | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| id | path | | Yes | integer | +| name | path | The name of the memo. Format: memos/{id} | Yes | string | | body | body | | Yes | [MemoServiceSetMemoResourcesBody](#memoservicesetmemoresourcesbody) | ##### Responses @@ -465,135 +563,132 @@ SetMemoResources sets resources for a memo. | 200 | A successful response. | [v2SetMemoResourcesResponse](#v2setmemoresourcesresponse) | | default | An unexpected error response. | [googlerpcStatus](#googlerpcstatus) | -### /api/v2/memos/{memo.id} - -#### PATCH -##### Summary +--- +## ResourceService -UpdateMemo updates a memo. +### /api/v2/resources -##### Parameters +#### GET +##### Summary -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ------ | -| memo.id | path | id is the system generated unique identifier. | Yes | integer | -| memo | body | | Yes | { **"name"**: string, **"rowStatus"**: [apiv2RowStatus](#apiv2rowstatus), **"creator"**: string, **"creatorId"**: integer, **"createTime"**: dateTime, **"updateTime"**: dateTime, **"displayTime"**: dateTime, **"content"**: string, **"visibility"**: [v2Visibility](#v2visibility), **"pinned"**: boolean, **"parentId"**: integer, **"resources"**: [ [v2Resource](#v2resource) ], **"relations"**: [ [v2MemoRelation](#v2memorelation) ], **"reactions"**: [ [apiv2Reaction](#apiv2reaction) ] } | +ListResources lists all resources. ##### Responses | Code | Description | Schema | | ---- | ----------- | ------ | -| 200 | A successful response. | [v2UpdateMemoResponse](#v2updatememoresponse) | +| 200 | A successful response. | [v2ListResourcesResponse](#v2listresourcesresponse) | | default | An unexpected error response. | [googlerpcStatus](#googlerpcstatus) | -### /api/v2/memos:export - #### POST ##### Summary -ExportMemos exports memos. +CreateResource creates a new resource. ##### Parameters | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| filter | query | Same as ListMemosRequest.filter | No | string | +| filename | query | | No | string | +| externalLink | query | | No | string | +| type | query | | No | string | +| memoId | query | | No | integer | ##### Responses | Code | Description | Schema | | ---- | ----------- | ------ | -| 200 | A successful response. | [v2ExportMemosResponse](#v2exportmemosresponse) | +| 200 | A successful response. | [v2CreateResourceResponse](#v2createresourceresponse) | | default | An unexpected error response. | [googlerpcStatus](#googlerpcstatus) | ---- -## ResourceService - -### /api/v2/resources +### /api/v2/resources:search #### GET ##### Summary -ListResources lists all resources. +SearchResources searches memos. + +##### Parameters + +| Name | Located in | Description | Required | Schema | +| ---- | ---------- | ----------- | -------- | ------ | +| filter | query | | No | string | ##### Responses | Code | Description | Schema | | ---- | ----------- | ------ | -| 200 | A successful response. | [v2ListResourcesResponse](#v2listresourcesresponse) | +| 200 | A successful response. | [v2SearchResourcesResponse](#v2searchresourcesresponse) | | default | An unexpected error response. | [googlerpcStatus](#googlerpcstatus) | -#### POST +### /api/v2/{name_1} + +#### GET ##### Summary -CreateResource creates a new resource. +GetResource returns a resource by name. ##### Parameters | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| filename | query | | No | string | -| externalLink | query | | No | string | -| type | query | | No | string | -| memoId | query | | No | integer | +| name_1 | path | | Yes | string | ##### Responses | Code | Description | Schema | | ---- | ----------- | ------ | -| 200 | A successful response. | [v2CreateResourceResponse](#v2createresourceresponse) | +| 200 | A successful response. | [v2GetResourceResponse](#v2getresourceresponse) | | default | An unexpected error response. | [googlerpcStatus](#googlerpcstatus) | -### /api/v2/resources/name/{name} - -#### GET +#### DELETE ##### Summary -GetResourceByName returns a resource by name. +DeleteInbox deletes an inbox. ##### Parameters | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| name | path | | Yes | string | +| name_1 | path | The name of the inbox to delete. Format: inboxes/{uid} | Yes | string | ##### Responses | Code | Description | Schema | | ---- | ----------- | ------ | -| 200 | A successful response. | [v2GetResourceByNameResponse](#v2getresourcebynameresponse) | +| 200 | A successful response. | [v2DeleteInboxResponse](#v2deleteinboxresponse) | | default | An unexpected error response. | [googlerpcStatus](#googlerpcstatus) | -### /api/v2/resources/{id} +### /api/v2/{name_2} #### GET ##### Summary -GetResource returns a resource by id. +GetMemo gets a memo. ##### Parameters | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| id | path | | Yes | integer | +| name_2 | path | The name of the memo. Format: memos/{id} | Yes | string | ##### Responses | Code | Description | Schema | | ---- | ----------- | ------ | -| 200 | A successful response. | [v2GetResourceResponse](#v2getresourceresponse) | +| 200 | A successful response. | [v2GetMemoResponse](#v2getmemoresponse) | | default | An unexpected error response. | [googlerpcStatus](#googlerpcstatus) | #### DELETE ##### Summary -DeleteResource deletes a resource by id. +DeleteResource deletes a resource by name. ##### Parameters | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| id | path | | Yes | integer | +| name_2 | path | | Yes | string | ##### Responses @@ -602,7 +697,7 @@ DeleteResource deletes a resource by id. | 200 | A successful response. | [v2DeleteResourceResponse](#v2deleteresourceresponse) | | default | An unexpected error response. | [googlerpcStatus](#googlerpcstatus) | -### /api/v2/resources/{resource.id} +### /api/v2/{resource.name} #### PATCH ##### Summary @@ -613,8 +708,8 @@ UpdateResource updates a resource. | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| resource.id | path | id is the system generated unique identifier. | Yes | integer | -| resource | body | | Yes | { **"name"**: string, **"createTime"**: dateTime, **"filename"**: string, **"externalLink"**: string, **"type"**: string, **"size"**: string (int64), **"memoId"**: integer } | +| resource.name | path | The name of the resource. Format: resources/{id} id is the system generated unique identifier. | Yes | string | +| resource | body | | Yes | { **"uid"**: string, **"createTime"**: dateTime, **"filename"**: string, **"externalLink"**: string, **"type"**: string, **"size"**: string (int64), **"memoId"**: integer } | ##### Responses @@ -637,7 +732,7 @@ ListTags lists tags. | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| user | query | The creator of tags. Format: users/{username} | No | string | +| user | query | The creator of tags. Format: users/{id} | No | string | ##### Responses @@ -656,7 +751,7 @@ DeleteTag deletes a tag. | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | | tag.name | query | | No | string | -| tag.creator | query | The creator of tags. Format: users/{username} | No | string | +| tag.creator | query | The creator of tags. Format: users/{id} | No | string | ##### Responses @@ -694,7 +789,7 @@ GetTagSuggestions gets tag suggestions from the user's memos. | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| user | query | The creator of tags. Format: users/{username} | No | string | +| user | query | The creator of tags. Format: users/{id} | No | string | ##### Responses @@ -729,7 +824,7 @@ All related memos will be updated. | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| user | query | The creator of tags. Format: users/{username} | No | string | +| user | query | The creator of tags. Format: users/{id} | No | string | | oldName | query | | No | string | | newName | query | | No | string | @@ -775,6 +870,26 @@ CreateUser creates a new user. | 200 | A successful response. | [v2CreateUserResponse](#v2createuserresponse) | | default | An unexpected error response. | [googlerpcStatus](#googlerpcstatus) | +### /api/v2/users:search + +#### GET +##### Summary + +SearchUsers searches users by filter. + +##### Parameters + +| Name | Located in | Description | Required | Schema | +| ---- | ---------- | ----------- | -------- | ------ | +| filter | query | | No | string | + +##### Responses + +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | A successful response. | [v2SearchUsersResponse](#v2searchusersresponse) | +| default | An unexpected error response. | [googlerpcStatus](#googlerpcstatus) | + ### /api/v2/{name} #### GET @@ -786,7 +901,7 @@ GetUser gets a user by name. | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| name | path | The name of the user. Format: users/{username} | Yes | string | +| name | path | The name of the user. Format: users/{id} | Yes | string | ##### Responses @@ -804,7 +919,7 @@ DeleteUser deletes a user. | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| name | path | The name of the user. Format: users/{username} | Yes | string | +| name | path | The name of the user. Format: users/{id} | Yes | string | ##### Responses @@ -824,7 +939,7 @@ ListUserAccessTokens returns a list of access tokens for a user. | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| name | path | The name of the user. Format: users/{username} | Yes | string | +| name | path | The name of the user. Format: users/{id} | Yes | string | ##### Responses @@ -842,7 +957,7 @@ CreateUserAccessToken creates a new access token for a user. | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| name | path | The name of the user. Format: users/{username} | Yes | string | +| name | path | The name of the user. Format: users/{id} | Yes | string | | body | body | | Yes | [UserServiceCreateUserAccessTokenBody](#userservicecreateuseraccesstokenbody) | ##### Responses @@ -863,7 +978,7 @@ DeleteUserAccessToken deletes an access token for a user. | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| name | path | The name of the user. Format: users/{username} | Yes | string | +| name | path | The name of the user. Format: users/{id} | Yes | string | | accessToken | path | access_token is the access token to delete. | Yes | string | ##### Responses @@ -884,7 +999,7 @@ GetUserSetting gets the setting of a user. | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| name | path | The name of the user. Format: users/{username} | Yes | string | +| name | path | The name of the user. Format: users/{id} | Yes | string | ##### Responses @@ -904,8 +1019,8 @@ UpdateUserSetting updates the setting of a user. | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| setting.name | path | The name of the user. Format: users/{username} | Yes | string | -| setting | body | | Yes | { **"locale"**: string, **"appearance"**: string, **"memoVisibility"**: string, **"telegramUserId"**: string, **"compactView"**: boolean } | +| setting.name | path | The name of the user. Format: users/{id} | Yes | string | +| setting | body | | Yes | { **"locale"**: string, **"appearance"**: string, **"memoVisibility"**: string, **"telegramUserId"**: string } | ##### Responses @@ -925,8 +1040,8 @@ UpdateUser updates a user. | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| user.name | path | The name of the user. Format: users/{username} | Yes | string | -| user | body | | Yes | { **"id"**: integer, **"role"**: [UserRole](#userrole), **"username"**: string, **"email"**: string, **"nickname"**: string, **"avatarUrl"**: string, **"password"**: string, **"rowStatus"**: [apiv2RowStatus](#apiv2rowstatus), **"createTime"**: dateTime, **"updateTime"**: dateTime } | +| user.name | path | The name of the user. Format: users/{id} | Yes | string | +| user | body | | Yes | { **"id"**: integer, **"role"**: [UserRole](#userrole), **"username"**: string, **"email"**: string, **"nickname"**: string, **"avatarUrl"**: string, **"description"**: string, **"password"**: string, **"rowStatus"**: [apiv2RowStatus](#apiv2rowstatus), **"createTime"**: dateTime, **"updateTime"**: dateTime } | ##### Responses @@ -1197,7 +1312,6 @@ GetActivity returns the activity with the given id. | appearance | string | The preferred appearance of the user. | No | | memoVisibility | string | The default visibility of the memo. | No | | telegramUserId | string | The telegram user id of the user. | No | -| compactView | boolean | The compact view for a memo. | No | #### apiv2Webhook @@ -1375,11 +1489,11 @@ GetActivity returns the activity with the given id. | ---- | ---- | ----------- | -------- | | user | [v2User](#v2user) | | No | -#### v2GetMemoByNameResponse +#### v2GetLinkMetadataResponse | Name | Type | Description | Required | | ---- | ---- | ----------- | -------- | -| memo | [v2Memo](#v2memo) | | No | +| linkMetadata | [v2LinkMetadata](#v2linkmetadata) | | No | #### v2GetMemoResponse @@ -1387,12 +1501,6 @@ GetActivity returns the activity with the given id. | ---- | ---- | ----------- | -------- | | memo | [v2Memo](#v2memo) | | No | -#### v2GetResourceByNameResponse - -| Name | Type | Description | Required | -| ---- | ---- | ----------- | -------- | -| resource | [v2Resource](#v2resource) | | No | - #### v2GetResourceResponse | Name | Type | Description | Required | @@ -1465,6 +1573,14 @@ GetActivity returns the activity with the given id. | ---- | ---- | ----------- | -------- | | v2InboxType | string | | | +#### v2LinkMetadata + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| title | string | | No | +| description | string | | No | +| image | string | | No | + #### v2ListInboxesResponse | Name | Type | Description | Required | @@ -1536,11 +1652,10 @@ GetActivity returns the activity with the given id. | Name | Type | Description | Required | | ---- | ---- | ----------- | -------- | -| id | integer | id is the system generated unique identifier. | No | -| name | string | name is the user provided name. | No | +| name | string | The name of the memo. Format: memos/{id} id is the system generated id. | No | +| uid | string | The user defined id of the memo. | No | | rowStatus | [apiv2RowStatus](#apiv2rowstatus) | | No | | creator | string | | No | -| creatorId | integer | | No | | createTime | dateTime | | No | | updateTime | dateTime | | No | | displayTime | dateTime | | No | @@ -1556,8 +1671,8 @@ GetActivity returns the activity with the given id. | Name | Type | Description | Required | | ---- | ---- | ----------- | -------- | -| memoId | integer | | No | -| relatedMemoId | integer | | No | +| memo | string | | No | +| relatedMemo | string | | No | | type | [v2MemoRelationType](#v2memorelationtype) | | No | #### v2MemoRelationType @@ -1576,8 +1691,8 @@ GetActivity returns the activity with the given id. | Name | Type | Description | Required | | ---- | ---- | ----------- | -------- | -| id | integer | id is the system generated unique identifier. | No | -| name | string | name is the user provided name. | No | +| name | string | The name of the resource. Format: resources/{id} id is the system generated unique identifier. | No | +| uid | string | The user defined id of the resource. | No | | createTime | dateTime | | No | | filename | string | | No | | externalLink | string | | No | @@ -1585,6 +1700,24 @@ GetActivity returns the activity with the given id. | size | string (int64) | | No | | memoId | integer | | No | +#### v2SearchMemosResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| memos | [ [v2Memo](#v2memo) ] | | No | + +#### v2SearchResourcesResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| resources | [ [v2Resource](#v2resource) ] | | No | + +#### v2SearchUsersResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| users | [ [v2User](#v2user) ] | | No | + #### v2SetMemoRelationsResponse | Name | Type | Description | Required | @@ -1693,12 +1826,13 @@ GetActivity returns the activity with the given id. | Name | Type | Description | Required | | ---- | ---- | ----------- | -------- | | name | string | | No | -| id | integer | | No | +| id | integer | The system generated uid of the user. | No | | role | [UserRole](#userrole) | | No | | username | string | | No | | email | string | | No | | nickname | string | | No | | avatarUrl | string | | No | +| description | string | | No | | password | string | | No | | rowStatus | [apiv2RowStatus](#apiv2rowstatus) | | No | | createTime | dateTime | | No | @@ -1723,9 +1857,10 @@ GetActivity returns the activity with the given id. | Name | Type | Description | Required | | ---- | ---- | ----------- | -------- | +| owner | string | | No | | version | string | | No | | mode | string | mode is the instance mode (e.g. "prod", "dev" or "demo"). | No | -| allowRegistration | boolean | allow_registration is whether the registration is allowed. | No | -| disablePasswordLogin | boolean | allow_password_login is whether the password login is allowed. | No | +| disallowSignup | boolean | disallow_signup is whether the signup is disallowed. | No | +| disablePasswordLogin | boolean | disable_password_login is whether the password login is disabled. | No | | additionalScript | string | additional_script is the additional script. | No | | additionalStyle | string | additional_style is the additional style. | No | diff --git a/server/route/api/v2/apidocs.swagger.yaml b/server/route/api/v2/apidocs.swagger.yaml index a495910fa64bd..a6ec1eb0519af 100644 --- a/server/route/api/v2/apidocs.swagger.yaml +++ b/server/route/api/v2/apidocs.swagger.yaml @@ -6,6 +6,7 @@ tags: - name: ActivityService - name: UserService - name: AuthService + - name: IdentityProviderService - name: InboxService - name: LinkService - name: ResourceService @@ -130,6 +131,96 @@ paths: $ref: '#/definitions/googlerpcStatus' tags: - AuthService + /api/v2/identityProviders: + get: + operationId: IdentityProviderService_ListIdentityProviders + responses: + "200": + description: A successful response. + schema: + $ref: '#/definitions/v2ListIdentityProvidersResponse' + default: + description: An unexpected error response. + schema: + $ref: '#/definitions/googlerpcStatus' + tags: + - IdentityProviderService + post: + operationId: IdentityProviderService_CreateIdentityProvider + responses: + "200": + description: A successful response. + schema: + $ref: '#/definitions/v2CreateIdentityProviderResponse' + default: + description: An unexpected error response. + schema: + $ref: '#/definitions/googlerpcStatus' + parameters: + - name: identityProvider.name + description: |- + The name of the identityProvider. + Format: identityProviders/{id} + in: query + required: false + type: string + - name: identityProvider.type + in: query + required: false + type: string + enum: + - TYPE_UNSPECIFIED + - OAUTH2 + default: TYPE_UNSPECIFIED + - name: identityProvider.title + in: query + required: false + type: string + - name: identityProvider.identifierFilter + in: query + required: false + type: string + - name: identityProvider.config.oauth2.clientId + in: query + required: false + type: string + - name: identityProvider.config.oauth2.clientSecret + in: query + required: false + type: string + - name: identityProvider.config.oauth2.authUrl + in: query + required: false + type: string + - name: identityProvider.config.oauth2.tokenUrl + in: query + required: false + type: string + - name: identityProvider.config.oauth2.userInfoUrl + in: query + required: false + type: string + - name: identityProvider.config.oauth2.scopes + in: query + required: false + type: array + items: + type: string + collectionFormat: multi + - name: identityProvider.config.oauth2.fieldMapping.identifier + in: query + required: false + type: string + - name: identityProvider.config.oauth2.fieldMapping.displayName + in: query + required: false + type: string + - name: identityProvider.config.oauth2.fieldMapping.email + in: query + required: false + type: string + tags: + - IdentityProviderService /api/v2/inboxes: get: summary: ListInboxes lists inboxes for a user. @@ -145,12 +236,31 @@ paths: $ref: '#/definitions/googlerpcStatus' parameters: - name: user - description: 'Format: users/{username}' + description: 'Format: users/{id}' in: query required: false type: string tags: - InboxService + /api/v2/link_metadata: + get: + operationId: LinkService_GetLinkMetadata + responses: + "200": + description: A successful response. + schema: + $ref: '#/definitions/v2GetLinkMetadataResponse' + default: + description: An unexpected error response. + schema: + $ref: '#/definitions/googlerpcStatus' + parameters: + - name: link + in: query + required: false + type: string + tags: + - LinkService /api/v2/memos: get: summary: ListMemos lists memos with pagination and filter. @@ -181,7 +291,7 @@ paths: - name: filter description: |- Filter is used to filter memos returned in the list. - Format: "creator == users/{username} && visibilities == ['PUBLIC', 'PROTECTED']" + Format: "creator == users/{uid} && visibilities == ['PUBLIC', 'PROTECTED']" in: query required: false type: string @@ -207,26 +317,6 @@ paths: $ref: '#/definitions/v2CreateMemoRequest' tags: - MemoService - /api/v2/memos/name/{name}: - get: - summary: GetMemoByName gets a memo by name. - operationId: MemoService_GetMemoByName - responses: - "200": - description: A successful response. - schema: - $ref: '#/definitions/v2GetMemoByNameResponse' - default: - description: An unexpected error response. - schema: - $ref: '#/definitions/googlerpcStatus' - parameters: - - name: name - in: path - required: true - type: string - tags: - - MemoService /api/v2/memos/stats: get: summary: GetUserMemosStats gets stats of memos for a user. @@ -244,7 +334,7 @@ paths: - name: name description: |- name is the name of the user to get stats for. - Format: users/{username} + Format: users/{id} in: query required: false type: string @@ -263,888 +353,992 @@ paths: type: string tags: - MemoService - /api/v2/memos/{id}: - get: - summary: GetMemo gets a memo by id. - operationId: MemoService_GetMemo - responses: - "200": - description: A successful response. - schema: - $ref: '#/definitions/v2GetMemoResponse' - default: - description: An unexpected error response. - schema: - $ref: '#/definitions/googlerpcStatus' - parameters: - - name: id - in: path - required: true - type: integer - format: int32 - tags: - - MemoService - delete: - summary: DeleteMemo deletes a memo by id. - operationId: MemoService_DeleteMemo + /api/v2/memos:export: + post: + summary: ExportMemos exports memos. + operationId: MemoService_ExportMemos responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2DeleteMemoResponse' + $ref: '#/definitions/v2ExportMemosResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: id - in: path - required: true - type: integer - format: int32 + - name: filter + description: Same as ListMemosRequest.filter + in: query + required: false + type: string tags: - MemoService - /api/v2/memos/{id}/comments: + /api/v2/memos:search: get: - summary: ListMemoComments lists comments for a memo. - operationId: MemoService_ListMemoComments + summary: SearchMemos searches memos. + operationId: MemoService_SearchMemos responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2ListMemoCommentsResponse' + $ref: '#/definitions/v2SearchMemosResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: id - in: path - required: true - type: integer - format: int32 + - name: filter + description: |- + Filter is used to filter memos returned. + Format: "creator == users/{uid} && visibilities == ['PUBLIC', 'PROTECTED']" + in: query + required: false + type: string tags: - MemoService - post: - summary: CreateMemoComment creates a comment for a memo. - operationId: MemoService_CreateMemoComment + /api/v2/reactions/{reactionId}: + delete: + summary: DeleteMemoReaction deletes a reaction for a memo. + operationId: MemoService_DeleteMemoReaction responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2CreateMemoCommentResponse' + $ref: '#/definitions/v2DeleteMemoReactionResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: id - description: id is the memo id to create comment for. + - name: reactionId in: path required: true type: integer format: int32 - - name: create.content - in: query - required: false - type: string - - name: create.visibility - in: query - required: false - type: string - enum: - - VISIBILITY_UNSPECIFIED - - PRIVATE - - PROTECTED - - PUBLIC - default: VISIBILITY_UNSPECIFIED tags: - MemoService - /api/v2/memos/{id}/reactions: + /api/v2/resources: get: - summary: ListMemoReactions lists reactions for a memo. - operationId: MemoService_ListMemoReactions + summary: ListResources lists all resources. + operationId: ResourceService_ListResources responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2ListMemoReactionsResponse' + $ref: '#/definitions/v2ListResourcesResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' - parameters: - - name: id - in: path - required: true - type: integer - format: int32 tags: - - MemoService + - ResourceService post: - summary: UpsertMemoReaction upserts a reaction for a memo. - operationId: MemoService_UpsertMemoReaction + summary: CreateResource creates a new resource. + operationId: ResourceService_CreateResource responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2UpsertMemoReactionResponse' + $ref: '#/definitions/v2CreateResourceResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: id - in: path - required: true - type: integer - format: int32 - - name: reaction.id + - name: filename in: query required: false - type: integer - format: int32 - - name: reaction.creator + type: string + - name: externalLink in: query required: false type: string - - name: reaction.contentId + - name: type in: query required: false type: string - - name: reaction.reactionType + - name: memo + description: 'Format: memos/{id}' in: query required: false type: string - enum: - - TYPE_UNSPECIFIED - - THUMBS_UP - - THUMBS_DOWN - - HEART - - FIRE - - CLAPPING_HANDS - - LAUGH - - OK_HAND - - ROCKET - - EYES - - THINKING_FACE - - CLOWN_FACE - - QUESTION_MARK - default: TYPE_UNSPECIFIED tags: - - MemoService - /api/v2/memos/{id}/reactions/{reactionId}: - delete: - summary: DeleteMemoReaction deletes a reaction for a memo. - operationId: MemoService_DeleteMemoReaction + - ResourceService + /api/v2/resources:search: + get: + summary: SearchResources searches memos. + operationId: ResourceService_SearchResources responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2DeleteMemoReactionResponse' + $ref: '#/definitions/v2SearchResourcesResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: id - in: path - required: true - type: integer - format: int32 - - name: reactionId - in: path - required: true - type: integer - format: int32 + - name: filter + in: query + required: false + type: string tags: - - MemoService - /api/v2/memos/{id}/relations: + - ResourceService + /api/v2/tags: get: - summary: ListMemoRelations lists relations for a memo. - operationId: MemoService_ListMemoRelations + summary: ListTags lists tags. + operationId: TagService_ListTags responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2ListMemoRelationsResponse' + $ref: '#/definitions/v2ListTagsResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: id - in: path - required: true - type: integer - format: int32 + - name: user + description: |- + The creator of tags. + Format: users/{id} + in: query + required: false + type: string tags: - - MemoService - post: - summary: SetMemoRelations sets relations for a memo. - operationId: MemoService_SetMemoRelations + - TagService + delete: + summary: DeleteTag deletes a tag. + operationId: TagService_DeleteTag responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2SetMemoRelationsResponse' + $ref: '#/definitions/v2DeleteTagResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: id - in: path - required: true - type: integer - format: int32 - - name: body - in: body - required: true + - name: tag.name + in: query + required: false + type: string + - name: tag.creator + description: |- + The creator of tags. + Format: users/{id} + in: query + required: false + type: string + tags: + - TagService + post: + summary: UpsertTag upserts a tag. + operationId: TagService_UpsertTag + responses: + "200": + description: A successful response. schema: - $ref: '#/definitions/MemoServiceSetMemoRelationsBody' + $ref: '#/definitions/v2UpsertTagResponse' + default: + description: An unexpected error response. + schema: + $ref: '#/definitions/googlerpcStatus' + parameters: + - name: name + in: query + required: false + type: string tags: - - MemoService - /api/v2/memos/{id}/resources: + - TagService + /api/v2/tags/suggestion: get: - summary: ListMemoResources lists resources for a memo. - operationId: MemoService_ListMemoResources + summary: GetTagSuggestions gets tag suggestions from the user's memos. + operationId: TagService_GetTagSuggestions responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2ListMemoResourcesResponse' + $ref: '#/definitions/v2GetTagSuggestionsResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: id - in: path - required: true - type: integer - format: int32 + - name: user + description: |- + The creator of tags. + Format: users/{id} + in: query + required: false + type: string tags: - - MemoService + - TagService + /api/v2/tags:batchUpsert: post: - summary: SetMemoResources sets resources for a memo. - operationId: MemoService_SetMemoResources + summary: BatchUpsertTag upserts multiple tags. + operationId: TagService_BatchUpsertTag responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2SetMemoResourcesResponse' + $ref: '#/definitions/v2BatchUpsertTagResponse' + default: + description: An unexpected error response. + schema: + $ref: '#/definitions/googlerpcStatus' + tags: + - TagService + /api/v2/tags:rename: + patch: + summary: |- + RenameTag renames a tag. + All related memos will be updated. + operationId: TagService_RenameTag + responses: + "200": + description: A successful response. + schema: + $ref: '#/definitions/v2RenameTagResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: id - in: path - required: true - type: integer - format: int32 - - name: body - in: body - required: true + - name: user + description: |- + The creator of tags. + Format: users/{id} + in: query + required: false + type: string + - name: oldName + in: query + required: false + type: string + - name: newName + in: query + required: false + type: string + tags: + - TagService + /api/v2/users: + get: + summary: ListUsers returns a list of users. + operationId: UserService_ListUsers + responses: + "200": + description: A successful response. schema: - $ref: '#/definitions/MemoServiceSetMemoResourcesBody' + $ref: '#/definitions/v2ListUsersResponse' + default: + description: An unexpected error response. + schema: + $ref: '#/definitions/googlerpcStatus' tags: - - MemoService - /api/v2/memos/{memo.id}: - patch: - summary: UpdateMemo updates a memo. - operationId: MemoService_UpdateMemo + - UserService + post: + summary: CreateUser creates a new user. + operationId: UserService_CreateUser responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2UpdateMemoResponse' + $ref: '#/definitions/v2CreateUserResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: memo.id - description: id is the system generated unique identifier. - in: path - required: true - type: integer - format: int32 - - name: memo + - name: user in: body required: true schema: - type: object - properties: - name: - type: string - description: name is the user provided name. - rowStatus: - $ref: '#/definitions/apiv2RowStatus' - creator: - type: string - title: |- - The name of the creator. - Format: users/{username} - creatorId: - type: integer - format: int32 - createTime: - type: string - format: date-time - updateTime: - type: string - format: date-time - displayTime: - type: string - format: date-time - content: - type: string - visibility: - $ref: '#/definitions/v2Visibility' - pinned: - type: boolean - parentId: - type: integer - format: int32 - readOnly: true - resources: - type: array - items: - type: object - $ref: '#/definitions/v2Resource' - readOnly: true - relations: - type: array - items: - type: object - $ref: '#/definitions/v2MemoRelation' - readOnly: true - reactions: - type: array - items: - type: object - $ref: '#/definitions/apiv2Reaction' - readOnly: true + $ref: '#/definitions/v2User' tags: - - MemoService - /api/v2/memos:export: - post: - summary: ExportMemos exports memos. - operationId: MemoService_ExportMemos + - UserService + /api/v2/users:search: + get: + summary: SearchUsers searches users by filter. + operationId: UserService_SearchUsers responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2ExportMemosResponse' + $ref: '#/definitions/v2SearchUsersResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - name: filter - description: Same as ListMemosRequest.filter + description: |- + Filter is used to filter users returned in the list. + Format: "username == frank" in: query required: false type: string tags: - - MemoService - /api/v2/metadata: + - UserService + /api/v2/webhooks: get: - operationId: LinkService_GetLinkMetadata + summary: ListWebhooks returns a list of webhooks. + operationId: WebhookService_ListWebhooks responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2GetLinkMetadataResponse' + $ref: '#/definitions/v2ListWebhooksResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: link + - name: creatorId in: query required: false - type: string + type: integer + format: int32 tags: - - LinkService - /api/v2/resources: + - WebhookService + post: + summary: CreateWebhook creates a new webhook. + operationId: WebhookService_CreateWebhook + responses: + "200": + description: A successful response. + schema: + $ref: '#/definitions/v2CreateWebhookResponse' + default: + description: An unexpected error response. + schema: + $ref: '#/definitions/googlerpcStatus' + parameters: + - name: body + in: body + required: true + schema: + $ref: '#/definitions/v2CreateWebhookRequest' + tags: + - WebhookService + /api/v2/webhooks/{id}: get: - summary: ListResources lists all resources. - operationId: ResourceService_ListResources + summary: GetWebhook returns a webhook by id. + operationId: WebhookService_GetWebhook responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2ListResourcesResponse' + $ref: '#/definitions/v2GetWebhookResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' + parameters: + - name: id + in: path + required: true + type: integer + format: int32 tags: - - ResourceService - post: - summary: CreateResource creates a new resource. - operationId: ResourceService_CreateResource + - WebhookService + delete: + summary: DeleteWebhook deletes a webhook by id. + operationId: WebhookService_DeleteWebhook responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2CreateResourceResponse' + $ref: '#/definitions/v2DeleteWebhookResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: filename - in: query - required: false - type: string - - name: externalLink - in: query - required: false - type: string - - name: type - in: query - required: false - type: string - - name: memoId - in: query - required: false + - name: id + in: path + required: true + type: integer + format: int32 + tags: + - WebhookService + /api/v2/webhooks/{webhook.id}: + patch: + summary: UpdateWebhook updates a webhook. + operationId: WebhookService_UpdateWebhook + responses: + "200": + description: A successful response. + schema: + $ref: '#/definitions/v2UpdateWebhookResponse' + default: + description: An unexpected error response. + schema: + $ref: '#/definitions/googlerpcStatus' + parameters: + - name: webhook.id + in: path + required: true type: integer format: int32 + - name: webhook + in: body + required: true + schema: + type: object + properties: + creatorId: + type: integer + format: int32 + createdTime: + type: string + format: date-time + updatedTime: + type: string + format: date-time + rowStatus: + $ref: '#/definitions/apiv2RowStatus' + name: + type: string + url: + type: string + tags: + - WebhookService + /api/v2/workspace/profile: + get: + summary: GetWorkspaceProfile returns the workspace profile. + operationId: WorkspaceService_GetWorkspaceProfile + responses: + "200": + description: A successful response. + schema: + $ref: '#/definitions/v2GetWorkspaceProfileResponse' + default: + description: An unexpected error response. + schema: + $ref: '#/definitions/googlerpcStatus' tags: - - ResourceService - /api/v2/resources/name/{name}: + - WorkspaceService + /api/v2/workspace/{name}: get: - summary: GetResourceByName returns a resource by name. - operationId: ResourceService_GetResourceByName + summary: GetWorkspaceSetting returns the setting by name. + operationId: WorkspaceSettingService_GetWorkspaceSetting responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2GetResourceByNameResponse' + $ref: '#/definitions/v2GetWorkspaceSettingResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - name: name + description: |- + The resource name of the workspace setting. + Format: settings/{setting} in: path required: true type: string + pattern: settings/[^/]+ tags: - - ResourceService - /api/v2/resources/{id}: - get: - summary: GetResource returns a resource by id. - operationId: ResourceService_GetResource + - WorkspaceSettingService + /api/v2/workspace/{setting.name}: + patch: + summary: SetWorkspaceSetting updates the setting. + operationId: WorkspaceSettingService_SetWorkspaceSetting responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2GetResourceResponse' + $ref: '#/definitions/v2SetWorkspaceSettingResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: id + - name: setting.name + description: |- + name is the name of the setting. + Format: settings/{setting} in: path required: true - type: integer - format: int32 + type: string + pattern: settings/[^/]+ + - name: setting + description: setting is the setting to update. + in: body + required: true + schema: + type: object + properties: + generalSetting: + $ref: '#/definitions/apiv2WorkspaceGeneralSetting' + description: general_setting is the general setting of workspace. + title: setting is the setting to update. tags: - - ResourceService - delete: - summary: DeleteResource deletes a resource by id. - operationId: ResourceService_DeleteResource + - WorkspaceSettingService + /api/v2/{identityProvider.name}: + patch: + summary: UpdateIdentityProvider updates an identity provider. + operationId: IdentityProviderService_UpdateIdentityProvider responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2DeleteResourceResponse' + $ref: '#/definitions/v2UpdateIdentityProviderResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: id + - name: identityProvider.name + description: |- + The name of the identityProvider. + Format: identityProviders/{id} in: path required: true - type: integer - format: int32 + type: string + pattern: identityProviders/[^/]+ + - name: identityProvider + description: The identityProvider to update. + in: body + required: true + schema: + type: object + properties: + type: + $ref: '#/definitions/v2IdentityProviderType' + title: + type: string + identifierFilter: + type: string + config: + $ref: '#/definitions/IdentityProviderConfig' + title: The identityProvider to update. tags: - - ResourceService - /api/v2/resources/{resource.id}: + - IdentityProviderService + /api/v2/{inbox.name}: patch: - summary: UpdateResource updates a resource. - operationId: ResourceService_UpdateResource + summary: UpdateInbox updates an inbox. + operationId: InboxService_UpdateInbox responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2UpdateResourceResponse' + $ref: '#/definitions/v2UpdateInboxResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: resource.id - description: id is the system generated unique identifier. + - name: inbox.name + description: |- + The name of the inbox. + Format: inboxes/{id} in: path required: true - type: integer - format: int32 - - name: resource + type: string + pattern: inboxes/[^/]+ + - name: inbox in: body required: true schema: type: object properties: - name: + sender: + type: string + title: 'Format: users/{id}' + receiver: type: string - description: name is the user provided name. + title: 'Format: users/{id}' + status: + $ref: '#/definitions/v2InboxStatus' createTime: type: string format: date-time - filename: - type: string - externalLink: - type: string type: - type: string - size: - type: string - format: int64 - memoId: + $ref: '#/definitions/v2InboxType' + activityId: type: integer format: int32 tags: - - ResourceService - /api/v2/tags: - get: - summary: ListTags lists tags. - operationId: TagService_ListTags + - InboxService + /api/v2/{memo.name}: + patch: + summary: UpdateMemo updates a memo. + operationId: MemoService_UpdateMemo responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2ListTagsResponse' + $ref: '#/definitions/v2UpdateMemoResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: user + - name: memo.name description: |- - The creator of tags. - Format: users/{username} - in: query - required: false + The name of the memo. + Format: memos/{id} + id is the system generated id. + in: path + required: true type: string + pattern: memos/[^/]+ + - name: memo + in: body + required: true + schema: + type: object + properties: + uid: + type: string + description: The user defined id of the memo. + rowStatus: + $ref: '#/definitions/apiv2RowStatus' + creator: + type: string + title: |- + The name of the creator. + Format: users/{id} + createTime: + type: string + format: date-time + updateTime: + type: string + format: date-time + displayTime: + type: string + format: date-time + content: + type: string + visibility: + $ref: '#/definitions/v2Visibility' + pinned: + type: boolean + parentId: + type: integer + format: int32 + readOnly: true + resources: + type: array + items: + type: object + $ref: '#/definitions/v2Resource' + readOnly: true + relations: + type: array + items: + type: object + $ref: '#/definitions/v2MemoRelation' + readOnly: true + reactions: + type: array + items: + type: object + $ref: '#/definitions/apiv2Reaction' + readOnly: true tags: - - TagService - delete: - summary: DeleteTag deletes a tag. - operationId: TagService_DeleteTag + - MemoService + /api/v2/{name_1}: + get: + operationId: IdentityProviderService_GetIdentityProvider responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2DeleteTagResponse' + $ref: '#/definitions/v2GetIdentityProviderResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: tag.name - in: query - required: false - type: string - - name: tag.creator + - name: name_1 description: |- - The creator of tags. - Format: users/{username} - in: query - required: false + The name of the identityProvider to get. + Format: identityProviders/{id} + in: path + required: true type: string + pattern: identityProviders/[^/]+ tags: - - TagService - post: - summary: UpsertTag upserts a tag. - operationId: TagService_UpsertTag + - IdentityProviderService + delete: + summary: DeleteIdentityProvider deletes an identity provider. + operationId: IdentityProviderService_DeleteIdentityProvider responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2UpsertTagResponse' + $ref: '#/definitions/v2DeleteIdentityProviderResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: name - in: query - required: false + - name: name_1 + description: |- + The name of the identityProvider to delete. + Format: identityProviders/{id} + in: path + required: true type: string + pattern: identityProviders/[^/]+ tags: - - TagService - /api/v2/tags/suggestion: + - IdentityProviderService + /api/v2/{name_2}: get: - summary: GetTagSuggestions gets tag suggestions from the user's memos. - operationId: TagService_GetTagSuggestions + summary: GetResource returns a resource by name. + operationId: ResourceService_GetResource responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2GetTagSuggestionsResponse' + $ref: '#/definitions/v2GetResourceResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: user - description: |- - The creator of tags. - Format: users/{username} - in: query - required: false + - name: name_2 + in: path + required: true type: string + pattern: resources/[^/]+ tags: - - TagService - /api/v2/tags:batchUpsert: - post: - summary: BatchUpsertTag upserts multiple tags. - operationId: TagService_BatchUpsertTag - responses: - "200": - description: A successful response. - schema: - $ref: '#/definitions/v2BatchUpsertTagResponse' - default: - description: An unexpected error response. - schema: - $ref: '#/definitions/googlerpcStatus' - tags: - - TagService - /api/v2/tags:rename: - patch: - summary: |- - RenameTag renames a tag. - All related memos will be updated. - operationId: TagService_RenameTag + - ResourceService + delete: + summary: DeleteInbox deletes an inbox. + operationId: InboxService_DeleteInbox responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2RenameTagResponse' + $ref: '#/definitions/v2DeleteInboxResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: user + - name: name_2 description: |- - The creator of tags. - Format: users/{username} - in: query - required: false - type: string - - name: oldName - in: query - required: false - type: string - - name: newName - in: query - required: false + The name of the inbox to delete. + Format: inboxes/{id} + in: path + required: true type: string + pattern: inboxes/[^/]+ tags: - - TagService - /api/v2/users: + - InboxService + /api/v2/{name_3}: get: - summary: ListUsers returns a list of users. - operationId: UserService_ListUsers + summary: GetMemo gets a memo. + operationId: MemoService_GetMemo responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2ListUsersResponse' + $ref: '#/definitions/v2GetMemoResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' + parameters: + - name: name_3 + description: |- + The name of the memo. + Format: memos/{id} + in: path + required: true + type: string + pattern: memos/[^/]+ tags: - - UserService - post: - summary: CreateUser creates a new user. - operationId: UserService_CreateUser + - MemoService + delete: + summary: DeleteResource deletes a resource by name. + operationId: ResourceService_DeleteResource responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2CreateUserResponse' + $ref: '#/definitions/v2DeleteResourceResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: user - in: body + - name: name_3 + in: path required: true - schema: - $ref: '#/definitions/v2User' + type: string + pattern: resources/[^/]+ tags: - - UserService - /api/v2/webhooks: - get: - summary: ListWebhooks returns a list of webhooks. - operationId: WebhookService_ListWebhooks + - ResourceService + /api/v2/{name_4}: + delete: + summary: DeleteMemo deletes a memo. + operationId: MemoService_DeleteMemo responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2ListWebhooksResponse' + $ref: '#/definitions/v2DeleteMemoResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: creatorId - in: query - required: false - type: integer - format: int32 + - name: name_4 + description: |- + The name of the memo. + Format: memos/{id} + in: path + required: true + type: string + pattern: memos/[^/]+ tags: - - WebhookService - post: - summary: CreateWebhook creates a new webhook. - operationId: WebhookService_CreateWebhook + - MemoService + /api/v2/{name}: + get: + summary: GetUser gets a user by name. + operationId: UserService_GetUser responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2CreateWebhookResponse' + $ref: '#/definitions/v2GetUserResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: body - in: body + - name: name + description: |- + The name of the user. + Format: users/{id} + in: path required: true - schema: - $ref: '#/definitions/v2CreateWebhookRequest' + type: string + pattern: users/[^/]+ tags: - - WebhookService - /api/v2/webhooks/{id}: - get: - summary: GetWebhook returns a webhook by id. - operationId: WebhookService_GetWebhook + - UserService + delete: + summary: DeleteUser deletes a user. + operationId: UserService_DeleteUser responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2GetWebhookResponse' + $ref: '#/definitions/v2DeleteUserResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: id + - name: name + description: |- + The name of the user. + Format: users/{id} in: path required: true - type: integer - format: int32 + type: string + pattern: users/[^/]+ tags: - - WebhookService - delete: - summary: DeleteWebhook deletes a webhook by id. - operationId: WebhookService_DeleteWebhook + - UserService + /api/v2/{name}/access_tokens: + get: + summary: ListUserAccessTokens returns a list of access tokens for a user. + operationId: UserService_ListUserAccessTokens responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2DeleteWebhookResponse' + $ref: '#/definitions/v2ListUserAccessTokensResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: id + - name: name + description: |- + The name of the user. + Format: users/{id} in: path required: true - type: integer - format: int32 + type: string + pattern: users/[^/]+ tags: - - WebhookService - /api/v2/webhooks/{webhook.id}: - patch: - summary: UpdateWebhook updates a webhook. - operationId: WebhookService_UpdateWebhook + - UserService + post: + summary: CreateUserAccessToken creates a new access token for a user. + operationId: UserService_CreateUserAccessToken responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2UpdateWebhookResponse' + $ref: '#/definitions/v2CreateUserAccessTokenResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: webhook.id + - name: name + description: |- + The name of the user. + Format: users/{id} in: path required: true - type: integer - format: int32 - - name: webhook + type: string + pattern: users/[^/]+ + - name: body in: body required: true schema: - type: object - properties: - creatorId: - type: integer - format: int32 - createdTime: - type: string - format: date-time - updatedTime: - type: string - format: date-time - rowStatus: - $ref: '#/definitions/apiv2RowStatus' - name: - type: string - url: - type: string + $ref: '#/definitions/UserServiceCreateUserAccessTokenBody' tags: - - WebhookService - /api/v2/workspace/profile: - get: - summary: GetWorkspaceProfile returns the workspace profile. - operationId: WorkspaceService_GetWorkspaceProfile + - UserService + /api/v2/{name}/access_tokens/{accessToken}: + delete: + summary: DeleteUserAccessToken deletes an access token for a user. + operationId: UserService_DeleteUserAccessToken responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2GetWorkspaceProfileResponse' + $ref: '#/definitions/v2DeleteUserAccessTokenResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' + parameters: + - name: name + description: |- + The name of the user. + Format: users/{id} + in: path + required: true + type: string + pattern: users/[^/]+ + - name: accessToken + description: access_token is the access token to delete. + in: path + required: true + type: string tags: - - WorkspaceService - /api/v2/workspace/{name}: + - UserService + /api/v2/{name}/comments: get: - summary: GetWorkspaceSetting returns the setting by name. - operationId: WorkspaceSettingService_GetWorkspaceSetting + summary: ListMemoComments lists comments for a memo. + operationId: MemoService_ListMemoComments responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2GetWorkspaceSettingResponse' + $ref: '#/definitions/v2ListMemoCommentsResponse' default: description: An unexpected error response. schema: @@ -1152,128 +1346,142 @@ paths: parameters: - name: name description: |- - The resource name of the workspace setting. - Format: settings/{setting} + The name of the memo. + Format: memos/{id} in: path required: true type: string - pattern: settings/[^/]+ + pattern: memos/[^/]+ tags: - - WorkspaceSettingService - /api/v2/workspace/{setting.name}: - patch: - summary: SetWorkspaceSetting updates the setting. - operationId: WorkspaceSettingService_SetWorkspaceSetting + - MemoService + post: + summary: CreateMemoComment creates a comment for a memo. + operationId: MemoService_CreateMemoComment responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2SetWorkspaceSettingResponse' + $ref: '#/definitions/v2CreateMemoCommentResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: setting.name + - name: name description: |- - name is the name of the setting. - Format: settings/{setting} + The name of the memo. + Format: memos/{id} in: path required: true type: string - pattern: settings/[^/]+ - - name: setting - description: setting is the setting to update. - in: body - required: true - schema: - type: object - properties: - generalSetting: - $ref: '#/definitions/apiv2WorkspaceGeneralSetting' - description: general_setting is the general setting of workspace. - title: setting is the setting to update. + pattern: memos/[^/]+ + - name: comment.content + in: query + required: false + type: string + - name: comment.visibility + in: query + required: false + type: string + enum: + - VISIBILITY_UNSPECIFIED + - PRIVATE + - PROTECTED + - PUBLIC + default: VISIBILITY_UNSPECIFIED tags: - - WorkspaceSettingService - /api/v2/{inbox.name}: - patch: - summary: UpdateInbox updates an inbox. - operationId: InboxService_UpdateInbox + - MemoService + /api/v2/{name}/reactions: + get: + summary: ListMemoReactions lists reactions for a memo. + operationId: MemoService_ListMemoReactions responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2UpdateInboxResponse' + $ref: '#/definitions/v2ListMemoReactionsResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: inbox.name + - name: name description: |- - The name of the inbox. - Format: inboxes/{uid} + The name of the memo. + Format: memos/{id} in: path required: true - type: string - pattern: inboxes/[^/]+ - - name: inbox - in: body - required: true - schema: - type: object - properties: - sender: - type: string - title: 'Format: users/{username}' - receiver: - type: string - title: 'Format: users/{username}' - status: - $ref: '#/definitions/v2InboxStatus' - createTime: - type: string - format: date-time - type: - $ref: '#/definitions/v2InboxType' - activityId: - type: integer - format: int32 - tags: - - InboxService - /api/v2/{name_1}: - delete: - summary: DeleteInbox deletes an inbox. - operationId: InboxService_DeleteInbox + type: string + pattern: memos/[^/]+ + tags: + - MemoService + post: + summary: UpsertMemoReaction upserts a reaction for a memo. + operationId: MemoService_UpsertMemoReaction responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2DeleteInboxResponse' + $ref: '#/definitions/v2UpsertMemoReactionResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: name_1 + - name: name description: |- - The name of the inbox to delete. - Format: inboxes/{uid} + The name of the memo. + Format: memos/{id} in: path required: true type: string - pattern: inboxes/[^/]+ + pattern: memos/[^/]+ + - name: reaction.id + in: query + required: false + type: integer + format: int32 + - name: reaction.creator + description: |- + The name of the creator. + Format: users/{id} + in: query + required: false + type: string + - name: reaction.contentId + in: query + required: false + type: string + - name: reaction.reactionType + in: query + required: false + type: string + enum: + - TYPE_UNSPECIFIED + - THUMBS_UP + - THUMBS_DOWN + - HEART + - FIRE + - CLAPPING_HANDS + - LAUGH + - OK_HAND + - ROCKET + - EYES + - THINKING_FACE + - CLOWN_FACE + - QUESTION_MARK + default: TYPE_UNSPECIFIED tags: - - InboxService - /api/v2/{name}: + - MemoService + /api/v2/{name}/relations: get: - summary: GetUser gets a user by name. - operationId: UserService_GetUser + summary: ListMemoRelations lists relations for a memo. + operationId: MemoService_ListMemoRelations responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2GetUserResponse' + $ref: '#/definitions/v2ListMemoRelationsResponse' default: description: An unexpected error response. schema: @@ -1281,22 +1489,22 @@ paths: parameters: - name: name description: |- - The name of the user. - Format: users/{username} + The name of the memo. + Format: memos/{id} in: path required: true type: string - pattern: users/[^/]+ + pattern: memos/[^/]+ tags: - - UserService - delete: - summary: DeleteUser deletes a user. - operationId: UserService_DeleteUser + - MemoService + post: + summary: SetMemoRelations sets relations for a memo. + operationId: MemoService_SetMemoRelations responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2DeleteUserResponse' + $ref: '#/definitions/v2SetMemoRelationsResponse' default: description: An unexpected error response. schema: @@ -1304,23 +1512,28 @@ paths: parameters: - name: name description: |- - The name of the user. - Format: users/{username} + The name of the memo. + Format: memos/{id} in: path required: true type: string - pattern: users/[^/]+ + pattern: memos/[^/]+ + - name: body + in: body + required: true + schema: + $ref: '#/definitions/MemoServiceSetMemoRelationsBody' tags: - - UserService - /api/v2/{name}/access_tokens: + - MemoService + /api/v2/{name}/resources: get: - summary: ListUserAccessTokens returns a list of access tokens for a user. - operationId: UserService_ListUserAccessTokens + summary: ListMemoResources lists resources for a memo. + operationId: MemoService_ListMemoResources responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2ListUserAccessTokensResponse' + $ref: '#/definitions/v2ListMemoResourcesResponse' default: description: An unexpected error response. schema: @@ -1328,22 +1541,22 @@ paths: parameters: - name: name description: |- - The name of the user. - Format: users/{username} + The name of the memo. + Format: memos/{id} in: path required: true type: string - pattern: users/[^/]+ + pattern: memos/[^/]+ tags: - - UserService + - MemoService post: - summary: CreateUserAccessToken creates a new access token for a user. - operationId: UserService_CreateUserAccessToken + summary: SetMemoResources sets resources for a memo. + operationId: MemoService_SetMemoResources responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2CreateUserAccessTokenResponse' + $ref: '#/definitions/v2SetMemoResourcesResponse' default: description: An unexpected error response. schema: @@ -1351,28 +1564,28 @@ paths: parameters: - name: name description: |- - The name of the user. - Format: users/{username} + The name of the memo. + Format: memos/{id} in: path required: true type: string - pattern: users/[^/]+ + pattern: memos/[^/]+ - name: body in: body required: true schema: - $ref: '#/definitions/UserServiceCreateUserAccessTokenBody' + $ref: '#/definitions/MemoServiceSetMemoResourcesBody' tags: - - UserService - /api/v2/{name}/access_tokens/{accessToken}: - delete: - summary: DeleteUserAccessToken deletes an access token for a user. - operationId: UserService_DeleteUserAccessToken + - MemoService + /api/v2/{name}/setting: + get: + summary: GetUserSetting gets the setting of a user. + operationId: UserService_GetUserSetting responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2DeleteUserAccessTokenResponse' + $ref: '#/definitions/v2GetUserSettingResponse' default: description: An unexpected error response. schema: @@ -1381,42 +1594,62 @@ paths: - name: name description: |- The name of the user. - Format: users/{username} + Format: users/{id} in: path required: true type: string pattern: users/[^/]+ - - name: accessToken - description: access_token is the access token to delete. - in: path - required: true - type: string tags: - UserService - /api/v2/{name}/setting: - get: - summary: GetUserSetting gets the setting of a user. - operationId: UserService_GetUserSetting + /api/v2/{resource.name}: + patch: + summary: UpdateResource updates a resource. + operationId: ResourceService_UpdateResource responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2GetUserSettingResponse' + $ref: '#/definitions/v2UpdateResourceResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: name + - name: resource.name description: |- - The name of the user. - Format: users/{username} + The name of the resource. + Format: resources/{id} + id is the system generated unique identifier. in: path required: true type: string - pattern: users/[^/]+ + pattern: resources/[^/]+ + - name: resource + in: body + required: true + schema: + type: object + properties: + uid: + type: string + description: The user defined id of the resource. + createTime: + type: string + format: date-time + filename: + type: string + externalLink: + type: string + type: + type: string + size: + type: string + format: int64 + memo: + type: string + title: 'Format: memos/{id}' tags: - - UserService + - ResourceService /api/v2/{setting.name}: patch: summary: UpdateUserSetting updates the setting of a user. @@ -1434,7 +1667,7 @@ paths: - name: setting.name description: |- The name of the user. - Format: users/{username} + Format: users/{id} in: path required: true type: string @@ -1476,7 +1709,7 @@ paths: - name: user.name description: |- The name of the user. - Format: users/{username} + Format: users/{id} in: path required: true type: string @@ -1490,6 +1723,7 @@ paths: id: type: integer format: int32 + description: The system generated uid of the user. role: $ref: '#/definitions/UserRole' username: @@ -1500,6 +1734,8 @@ paths: type: string avatarUrl: type: string + description: + type: string password: type: string rowStatus: @@ -1534,6 +1770,39 @@ paths: tags: - ActivityService definitions: + IdentityProviderConfig: + type: object + properties: + oauth2: + $ref: '#/definitions/IdentityProviderConfigOAuth2' + IdentityProviderConfigFieldMapping: + type: object + properties: + identifier: + type: string + displayName: + type: string + email: + type: string + IdentityProviderConfigOAuth2: + type: object + properties: + clientId: + type: string + clientSecret: + type: string + authUrl: + type: string + tokenUrl: + type: string + userInfoUrl: + type: string + scopes: + type: array + items: + type: string + fieldMapping: + $ref: '#/definitions/IdentityProviderConfigFieldMapping' MemoServiceSetMemoRelationsBody: type: object properties: @@ -1595,6 +1864,9 @@ definitions: format: int32 creator: type: string + title: |- + The name of the creator. + Format: users/{id} contentId: type: string reactionType: @@ -1630,7 +1902,7 @@ definitions: type: string title: |- The name of the user. - Format: users/{username} + Format: users/{id} locale: type: string description: The preferred locale of the user. @@ -1732,6 +2004,12 @@ definitions: $ref: '#/definitions/apiv2ActivityPayload' v2BatchUpsertTagResponse: type: object + v2CreateIdentityProviderResponse: + type: object + properties: + identityProvider: + $ref: '#/definitions/v2IdentityProvider' + description: The created identityProvider. v2CreateMemoCommentResponse: type: object properties: @@ -1776,6 +2054,8 @@ definitions: properties: webhook: $ref: '#/definitions/apiv2Webhook' + v2DeleteIdentityProviderResponse: + type: object v2DeleteInboxResponse: type: object v2DeleteMemoReactionResponse: @@ -1808,26 +2088,22 @@ definitions: properties: user: $ref: '#/definitions/v2User' - v2GetLinkMetadataResponse: + v2GetIdentityProviderResponse: type: object properties: - metadata: - $ref: '#/definitions/v2LinkMetadata' - v2GetMemoByNameResponse: + identityProvider: + $ref: '#/definitions/v2IdentityProvider' + description: The identityProvider. + v2GetLinkMetadataResponse: type: object properties: - memo: - $ref: '#/definitions/v2Memo' + linkMetadata: + $ref: '#/definitions/v2LinkMetadata' v2GetMemoResponse: type: object properties: memo: $ref: '#/definitions/v2Memo' - v2GetResourceByNameResponse: - type: object - properties: - resource: - $ref: '#/definitions/v2Resource' v2GetResourceResponse: type: object properties: @@ -1876,6 +2152,28 @@ definitions: properties: setting: $ref: '#/definitions/apiv2WorkspaceSetting' + v2IdentityProvider: + type: object + properties: + name: + type: string + title: |- + The name of the identityProvider. + Format: identityProviders/{id} + type: + $ref: '#/definitions/v2IdentityProviderType' + title: + type: string + identifierFilter: + type: string + config: + $ref: '#/definitions/IdentityProviderConfig' + v2IdentityProviderType: + type: string + enum: + - TYPE_UNSPECIFIED + - OAUTH2 + default: TYPE_UNSPECIFIED v2Inbox: type: object properties: @@ -1883,13 +2181,13 @@ definitions: type: string title: |- The name of the inbox. - Format: inboxes/{uid} + Format: inboxes/{id} sender: type: string - title: 'Format: users/{username}' + title: 'Format: users/{id}' receiver: type: string - title: 'Format: users/{username}' + title: 'Format: users/{id}' status: $ref: '#/definitions/v2InboxStatus' createTime: @@ -1923,6 +2221,14 @@ definitions: type: string image: type: string + v2ListIdentityProvidersResponse: + type: object + properties: + identityProviders: + type: array + items: + type: object + $ref: '#/definitions/v2IdentityProvider' v2ListInboxesResponse: type: object properties: @@ -2019,23 +2325,22 @@ definitions: v2Memo: type: object properties: - id: - type: integer - format: int32 - description: id is the system generated unique identifier. name: type: string - description: name is the user provided name. + description: |- + The name of the memo. + Format: memos/{id} + id is the system generated id. + uid: + type: string + description: The user defined id of the memo. rowStatus: $ref: '#/definitions/apiv2RowStatus' creator: type: string title: |- The name of the creator. - Format: users/{username} - creatorId: - type: integer - format: int32 + Format: users/{id} createTime: type: string format: date-time @@ -2076,12 +2381,16 @@ definitions: v2MemoRelation: type: object properties: - memoId: - type: integer - format: int32 - relatedMemoId: - type: integer - format: int32 + memo: + type: string + title: |- + The name of memo. + Format: "memos/{uid}" + relatedMemo: + type: string + title: |- + The name of related memo. + Format: "memos/{uid}" type: $ref: '#/definitions/v2MemoRelationType' v2MemoRelationType: @@ -2099,13 +2408,15 @@ definitions: v2Resource: type: object properties: - id: - type: integer - format: int32 - description: id is the system generated unique identifier. name: type: string - description: name is the user provided name. + description: |- + The name of the resource. + Format: resources/{id} + id is the system generated unique identifier. + uid: + type: string + description: The user defined id of the resource. createTime: type: string format: date-time @@ -2118,9 +2429,33 @@ definitions: size: type: string format: int64 - memoId: - type: integer - format: int32 + memo: + type: string + title: 'Format: memos/{id}' + v2SearchMemosResponse: + type: object + properties: + memos: + type: array + items: + type: object + $ref: '#/definitions/v2Memo' + v2SearchResourcesResponse: + type: object + properties: + resources: + type: array + items: + type: object + $ref: '#/definitions/v2Resource' + v2SearchUsersResponse: + type: object + properties: + users: + type: array + items: + type: object + $ref: '#/definitions/v2User' v2SetMemoRelationsResponse: type: object v2SetMemoResourcesResponse: @@ -2156,7 +2491,13 @@ definitions: type: string title: |- The creator of tags. - Format: users/{username} + Format: users/{id} + v2UpdateIdentityProviderResponse: + type: object + properties: + identityProvider: + $ref: '#/definitions/v2IdentityProvider' + description: The updated identityProvider. v2UpdateInboxResponse: type: object properties: @@ -2209,10 +2550,11 @@ definitions: type: string title: |- The name of the user. - Format: users/{username} + Format: users/{id} id: type: integer format: int32 + description: The system generated uid of the user. role: $ref: '#/definitions/UserRole' username: @@ -2223,6 +2565,8 @@ definitions: type: string avatarUrl: type: string + description: + type: string password: type: string rowStatus: @@ -2257,18 +2601,23 @@ definitions: v2WorkspaceProfile: type: object properties: + owner: + type: string + title: |- + The name of intance owner. + Format: "users/{id}" version: type: string title: version is the current version of instance mode: type: string description: mode is the instance mode (e.g. "prod", "dev" or "demo"). - allowRegistration: + disallowSignup: type: boolean - description: allow_registration is whether the registration is allowed. + description: disallow_signup is whether the signup is disallowed. disablePasswordLogin: type: boolean - description: allow_password_login is whether the password login is allowed. + description: disable_password_login is whether the password login is disabled. additionalScript: type: string description: additional_script is the additional script. diff --git a/server/route/api/v2/auth_service.go b/server/route/api/v2/auth_service.go index ef4b139ff4b68..1cf681a9d1549 100644 --- a/server/route/api/v2/auth_service.go +++ b/server/route/api/v2/auth_service.go @@ -30,7 +30,7 @@ func (s *APIV2Service) GetAuthStatus(ctx context.Context, _ *apiv2pb.GetAuthStat if user == nil { // Set the cookie header to expire access token. if err := s.clearAccessTokenCookie(ctx); err != nil { - return nil, status.Errorf(codes.Internal, "failed to set grpc header") + return nil, status.Errorf(codes.Internal, "failed to set grpc header: %v", err) } return nil, status.Errorf(codes.Unauthenticated, "user not found") } @@ -189,6 +189,9 @@ func (s *APIV2Service) SignUp(ctx context.Context, request *apiv2pb.SignUpReques Nickname: request.Username, PasswordHash: string(passwordHash), } + if !util.UIDMatcher.MatchString(strings.ToLower(create.Username)) { + return nil, status.Errorf(codes.InvalidArgument, "invalid username: %s", create.Username) + } hostUserType := store.RoleHost existedHostUsers, err := s.Store.ListUsers(ctx, &store.FindUser{ diff --git a/server/route/api/v2/inbox_service.go b/server/route/api/v2/inbox_service.go index 51b170b2e1ba4..a3238e142e7b2 100644 --- a/server/route/api/v2/inbox_service.go +++ b/server/route/api/v2/inbox_service.go @@ -5,7 +5,6 @@ import ( "fmt" "time" - "github.com/pkg/errors" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "google.golang.org/protobuf/types/known/timestamppb" @@ -31,11 +30,7 @@ func (s *APIV2Service) ListInboxes(ctx context.Context, _ *apiv2pb.ListInboxesRe Inboxes: []*apiv2pb.Inbox{}, } for _, inbox := range inboxes { - inboxMessage, err := s.convertInboxFromStore(ctx, inbox) - if err != nil { - return nil, status.Errorf(codes.Internal, "failed to convert inbox from store: %v", err) - } - response.Inboxes = append(response.Inboxes, inboxMessage) + response.Inboxes = append(response.Inboxes, convertInboxFromStore(inbox)) } return response, nil @@ -67,12 +62,8 @@ func (s *APIV2Service) UpdateInbox(ctx context.Context, request *apiv2pb.UpdateI return nil, status.Errorf(codes.Internal, "failed to update inbox: %v", err) } - inboxMessage, err := s.convertInboxFromStore(ctx, inbox) - if err != nil { - return nil, status.Errorf(codes.Internal, "failed to convert inbox from store: %v", err) - } return &apiv2pb.UpdateInboxResponse{ - Inbox: inboxMessage, + Inbox: convertInboxFromStore(inbox), }, nil } @@ -90,29 +81,16 @@ func (s *APIV2Service) DeleteInbox(ctx context.Context, request *apiv2pb.DeleteI return &apiv2pb.DeleteInboxResponse{}, nil } -func (s *APIV2Service) convertInboxFromStore(ctx context.Context, inbox *store.Inbox) (*apiv2pb.Inbox, error) { - sender, err := s.Store.GetUser(ctx, &store.FindUser{ - ID: &inbox.SenderID, - }) - if err != nil { - return nil, errors.Wrap(err, "failed to get sender") - } - receiver, err := s.Store.GetUser(ctx, &store.FindUser{ - ID: &inbox.ReceiverID, - }) - if err != nil { - return nil, errors.Wrap(err, "failed to get receiver") - } - +func convertInboxFromStore(inbox *store.Inbox) *apiv2pb.Inbox { return &apiv2pb.Inbox{ - Name: fmt.Sprintf("inboxes/%d", inbox.ID), - Sender: fmt.Sprintf("users/%s", sender.Username), - Receiver: fmt.Sprintf("users/%s", receiver.Username), + Name: fmt.Sprintf("%s%d", InboxNamePrefix, inbox.ID), + Sender: fmt.Sprintf("%s%d", UserNamePrefix, inbox.SenderID), + Receiver: fmt.Sprintf("%s%d", UserNamePrefix, inbox.ReceiverID), Status: convertInboxStatusFromStore(inbox.Status), CreateTime: timestamppb.New(time.Unix(inbox.CreatedTs, 0)), Type: apiv2pb.Inbox_Type(inbox.Message.Type), ActivityId: inbox.Message.ActivityId, - }, nil + } } func convertInboxStatusFromStore(status store.InboxStatus) apiv2pb.Inbox_Status { diff --git a/server/route/api/v2/link_service.go b/server/route/api/v2/link_service.go index 5d8948393bbe9..2f23cf0994e56 100644 --- a/server/route/api/v2/link_service.go +++ b/server/route/api/v2/link_service.go @@ -14,7 +14,7 @@ func (*APIV2Service) GetLinkMetadata(_ context.Context, request *apiv2pb.GetLink } return &apiv2pb.GetLinkMetadataResponse{ - Metadata: &apiv2pb.LinkMetadata{ + LinkMetadata: &apiv2pb.LinkMetadata{ Title: htmlMeta.Title, Description: htmlMeta.Description, Image: htmlMeta.Image, diff --git a/server/route/api/v2/memo_relation_service.go b/server/route/api/v2/memo_relation_service.go index 3c20e43f11ccb..9e4967be690e7 100644 --- a/server/route/api/v2/memo_relation_service.go +++ b/server/route/api/v2/memo_relation_service.go @@ -2,6 +2,7 @@ package v2 import ( "context" + "fmt" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -11,10 +12,14 @@ import ( ) func (s *APIV2Service) SetMemoRelations(ctx context.Context, request *apiv2pb.SetMemoRelationsRequest) (*apiv2pb.SetMemoRelationsResponse, error) { + id, err := ExtractMemoIDFromName(request.Name) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "invalid memo name: %v", err) + } referenceType := store.MemoRelationReference // Delete all reference relations first. if err := s.Store.DeleteMemoRelation(ctx, &store.DeleteMemoRelation{ - MemoID: &request.Id, + MemoID: &id, Type: &referenceType, }); err != nil { return nil, status.Errorf(codes.Internal, "failed to delete memo relation") @@ -22,7 +27,7 @@ func (s *APIV2Service) SetMemoRelations(ctx context.Context, request *apiv2pb.Se for _, relation := range request.Relations { // Ignore reflexive relations. - if request.Id == relation.RelatedMemoId { + if request.Name == relation.RelatedMemo { continue } // Ignore comment relations as there's no need to update a comment's relation. @@ -30,9 +35,13 @@ func (s *APIV2Service) SetMemoRelations(ctx context.Context, request *apiv2pb.Se if relation.Type == apiv2pb.MemoRelation_COMMENT { continue } + relatedMemoID, err := ExtractMemoIDFromName(relation.RelatedMemo) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "invalid related memo name: %v", err) + } if _, err := s.Store.UpsertMemoRelation(ctx, &store.MemoRelation{ - MemoID: request.Id, - RelatedMemoID: relation.RelatedMemoId, + MemoID: id, + RelatedMemoID: relatedMemoID, Type: convertMemoRelationTypeToStore(relation.Type), }); err != nil { return nil, status.Errorf(codes.Internal, "failed to upsert memo relation") @@ -43,9 +52,13 @@ func (s *APIV2Service) SetMemoRelations(ctx context.Context, request *apiv2pb.Se } func (s *APIV2Service) ListMemoRelations(ctx context.Context, request *apiv2pb.ListMemoRelationsRequest) (*apiv2pb.ListMemoRelationsResponse, error) { + id, err := ExtractMemoIDFromName(request.Name) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "invalid memo name: %v", err) + } relationList := []*apiv2pb.MemoRelation{} tempList, err := s.Store.ListMemoRelations(ctx, &store.FindMemoRelation{ - MemoID: &request.Id, + MemoID: &id, }) if err != nil { return nil, err @@ -54,7 +67,7 @@ func (s *APIV2Service) ListMemoRelations(ctx context.Context, request *apiv2pb.L relationList = append(relationList, convertMemoRelationFromStore(relation)) } tempList, err = s.Store.ListMemoRelations(ctx, &store.FindMemoRelation{ - RelatedMemoID: &request.Id, + RelatedMemoID: &id, }) if err != nil { return nil, err @@ -71,9 +84,9 @@ func (s *APIV2Service) ListMemoRelations(ctx context.Context, request *apiv2pb.L func convertMemoRelationFromStore(memoRelation *store.MemoRelation) *apiv2pb.MemoRelation { return &apiv2pb.MemoRelation{ - MemoId: memoRelation.MemoID, - RelatedMemoId: memoRelation.RelatedMemoID, - Type: convertMemoRelationTypeFromStore(memoRelation.Type), + Memo: fmt.Sprintf("%s%d", MemoNamePrefix, memoRelation.MemoID), + RelatedMemo: fmt.Sprintf("%s%d", MemoNamePrefix, memoRelation.RelatedMemoID), + Type: convertMemoRelationTypeFromStore(memoRelation.Type), } } diff --git a/server/route/api/v2/memo_resource_service.go b/server/route/api/v2/memo_resource_service.go index 9071d115d7f48..fd7b518c4f5b7 100644 --- a/server/route/api/v2/memo_resource_service.go +++ b/server/route/api/v2/memo_resource_service.go @@ -13,8 +13,12 @@ import ( ) func (s *APIV2Service) SetMemoResources(ctx context.Context, request *apiv2pb.SetMemoResourcesRequest) (*apiv2pb.SetMemoResourcesResponse, error) { + memoID, err := ExtractMemoIDFromName(request.Name) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "invalid memo name: %v", err) + } resources, err := s.Store.ListResources(ctx, &store.FindResource{ - MemoID: &request.Id, + MemoID: &memoID, }) if err != nil { return nil, status.Errorf(codes.Internal, "failed to list resources") @@ -24,7 +28,7 @@ func (s *APIV2Service) SetMemoResources(ctx context.Context, request *apiv2pb.Se for _, resource := range resources { found := false for _, requestResource := range request.Resources { - if resource.ID == int32(requestResource.Id) { + if resource.UID == requestResource.Uid { found = true break } @@ -32,7 +36,7 @@ func (s *APIV2Service) SetMemoResources(ctx context.Context, request *apiv2pb.Se if !found { if err = s.Store.DeleteResource(ctx, &store.DeleteResource{ ID: int32(resource.ID), - MemoID: &request.Id, + MemoID: &memoID, }); err != nil { return nil, status.Errorf(codes.Internal, "failed to delete resource") } @@ -42,10 +46,14 @@ func (s *APIV2Service) SetMemoResources(ctx context.Context, request *apiv2pb.Se slices.Reverse(request.Resources) // Update resources' memo_id in the request. for index, resource := range request.Resources { + id, err := ExtractResourceIDFromName(resource.Name) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "invalid resource name: %v", err) + } updatedTs := time.Now().Unix() + int64(index) if _, err := s.Store.UpdateResource(ctx, &store.UpdateResource{ - ID: resource.Id, - MemoID: &request.Id, + ID: id, + MemoID: &memoID, UpdatedTs: &updatedTs, }); err != nil { return nil, status.Errorf(codes.Internal, "failed to update resource: %v", err) @@ -56,8 +64,12 @@ func (s *APIV2Service) SetMemoResources(ctx context.Context, request *apiv2pb.Se } func (s *APIV2Service) ListMemoResources(ctx context.Context, request *apiv2pb.ListMemoResourcesRequest) (*apiv2pb.ListMemoResourcesResponse, error) { + id, err := ExtractMemoIDFromName(request.Name) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "invalid memo name: %v", err) + } resources, err := s.Store.ListResources(ctx, &store.FindResource{ - MemoID: &request.Id, + MemoID: &id, }) if err != nil { return nil, status.Errorf(codes.Internal, "failed to list resources") diff --git a/server/route/api/v2/memo_service.go b/server/route/api/v2/memo_service.go index 8eb732fc694c5..339020f882e7b 100644 --- a/server/route/api/v2/memo_service.go +++ b/server/route/api/v2/memo_service.go @@ -44,10 +44,10 @@ func (s *APIV2Service) CreateMemo(ctx context.Context, request *apiv2pb.CreateMe } create := &store.Memo{ - ResourceName: shortuuid.New(), - CreatorID: user.ID, - Content: request.Content, - Visibility: convertVisibilityToStore(request.Visibility), + UID: shortuuid.New(), + CreatorID: user.ID, + Content: request.Content, + Visibility: convertVisibilityToStore(request.Visibility), } // Find disable public memos system setting. disablePublicMemosSystem, err := s.getDisablePublicMemosSystemSettingValue(ctx) @@ -106,7 +106,7 @@ func (s *APIV2Service) ListMemos(ctx context.Context, request *apiv2pb.ListMemos memoFind.Offset = &offset memos, err := s.Store.ListMemos(ctx, memoFind) if err != nil { - return nil, status.Errorf(codes.Internal, "failed to list memos") + return nil, status.Errorf(codes.Internal, "failed to list memos: %v", err) } memoMessages := []*apiv2pb.Memo{} @@ -133,42 +133,45 @@ func (s *APIV2Service) ListMemos(ctx context.Context, request *apiv2pb.ListMemos return response, nil } -func (s *APIV2Service) GetMemo(ctx context.Context, request *apiv2pb.GetMemoRequest) (*apiv2pb.GetMemoResponse, error) { - memo, err := s.Store.GetMemo(ctx, &store.FindMemo{ - ID: &request.Id, - }) +func (s *APIV2Service) SearchMemos(ctx context.Context, request *apiv2pb.SearchMemosRequest) (*apiv2pb.SearchMemosResponse, error) { + defaultSearchLimit := 10 + memoFind := &store.FindMemo{ + // Exclude comments by default. + ExcludeComments: true, + Limit: &defaultSearchLimit, + } + err := s.buildMemoFindWithFilter(ctx, memoFind, request.Filter) if err != nil { - return nil, err + return nil, status.Errorf(codes.InvalidArgument, "failed to build find memos with filter") } - if memo == nil { - return nil, status.Errorf(codes.NotFound, "memo not found") + + memos, err := s.Store.ListMemos(ctx, memoFind) + if err != nil { + return nil, status.Errorf(codes.Internal, "failed to search memos") } - if memo.Visibility != store.Public { - user, err := getCurrentUser(ctx, s.Store) + + memoMessages := []*apiv2pb.Memo{} + for _, memo := range memos { + memoMessage, err := s.convertMemoFromStore(ctx, memo) if err != nil { - return nil, status.Errorf(codes.Internal, "failed to get user") - } - if user == nil { - return nil, status.Errorf(codes.PermissionDenied, "permission denied") - } - if memo.Visibility == store.Private && memo.CreatorID != user.ID { - return nil, status.Errorf(codes.PermissionDenied, "permission denied") + return nil, errors.Wrap(err, "failed to convert memo") } + memoMessages = append(memoMessages, memoMessage) } - memoMessage, err := s.convertMemoFromStore(ctx, memo) - if err != nil { - return nil, errors.Wrap(err, "failed to convert memo") - } - response := &apiv2pb.GetMemoResponse{ - Memo: memoMessage, + response := &apiv2pb.SearchMemosResponse{ + Memos: memoMessages, } return response, nil } -func (s *APIV2Service) GetMemoByName(ctx context.Context, request *apiv2pb.GetMemoByNameRequest) (*apiv2pb.GetMemoByNameResponse, error) { +func (s *APIV2Service) GetMemo(ctx context.Context, request *apiv2pb.GetMemoRequest) (*apiv2pb.GetMemoResponse, error) { + id, err := ExtractMemoIDFromName(request.Name) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "invalid memo name: %v", err) + } memo, err := s.Store.GetMemo(ctx, &store.FindMemo{ - ResourceName: &request.Name, + ID: &id, }) if err != nil { return nil, err @@ -193,20 +196,22 @@ func (s *APIV2Service) GetMemoByName(ctx context.Context, request *apiv2pb.GetMe if err != nil { return nil, errors.Wrap(err, "failed to convert memo") } - response := &apiv2pb.GetMemoByNameResponse{ + response := &apiv2pb.GetMemoResponse{ Memo: memoMessage, } return response, nil } func (s *APIV2Service) UpdateMemo(ctx context.Context, request *apiv2pb.UpdateMemoRequest) (*apiv2pb.UpdateMemoResponse, error) { + id, err := ExtractMemoIDFromName(request.Memo.Name) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "invalid memo name: %v", err) + } if request.UpdateMask == nil || len(request.UpdateMask.Paths) == 0 { return nil, status.Errorf(codes.InvalidArgument, "update mask is required") } - memo, err := s.Store.GetMemo(ctx, &store.FindMemo{ - ID: &request.Memo.Id, - }) + memo, err := s.Store.GetMemo(ctx, &store.FindMemo{ID: &id}) if err != nil { return nil, err } @@ -221,15 +226,15 @@ func (s *APIV2Service) UpdateMemo(ctx context.Context, request *apiv2pb.UpdateMe currentTs := time.Now().Unix() update := &store.UpdateMemo{ - ID: request.Memo.Id, + ID: id, UpdatedTs: ¤tTs, } for _, path := range request.UpdateMask.Paths { if path == "content" { update.Content = &request.Memo.Content - } else if path == "resource_name" { - update.ResourceName = &request.Memo.Name - if !util.ResourceNameMatcher.MatchString(*update.ResourceName) { + } else if path == "uid" { + update.UID = &request.Memo.Name + if !util.UIDMatcher.MatchString(*update.UID) { return nil, status.Errorf(codes.InvalidArgument, "invalid resource name") } } else if path == "visibility" { @@ -251,7 +256,7 @@ func (s *APIV2Service) UpdateMemo(ctx context.Context, request *apiv2pb.UpdateMe update.CreatedTs = &createdTs } else if path == "pinned" { if _, err := s.Store.UpsertMemoOrganizer(ctx, &store.MemoOrganizer{ - MemoID: request.Memo.Id, + MemoID: id, UserID: user.ID, Pinned: request.Memo.Pinned, }); err != nil { @@ -268,7 +273,7 @@ func (s *APIV2Service) UpdateMemo(ctx context.Context, request *apiv2pb.UpdateMe } memo, err = s.Store.GetMemo(ctx, &store.FindMemo{ - ID: &request.Memo.Id, + ID: &id, }) if err != nil { return nil, errors.Wrap(err, "failed to get memo") @@ -288,8 +293,12 @@ func (s *APIV2Service) UpdateMemo(ctx context.Context, request *apiv2pb.UpdateMe } func (s *APIV2Service) DeleteMemo(ctx context.Context, request *apiv2pb.DeleteMemoRequest) (*apiv2pb.DeleteMemoResponse, error) { + id, err := ExtractMemoIDFromName(request.Name) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "invalid memo name: %v", err) + } memo, err := s.Store.GetMemo(ctx, &store.FindMemo{ - ID: &request.Id, + ID: &id, }) if err != nil { return nil, err @@ -310,9 +319,7 @@ func (s *APIV2Service) DeleteMemo(ctx context.Context, request *apiv2pb.DeleteMe } } - if err = s.Store.DeleteMemo(ctx, &store.DeleteMemo{ - ID: request.Id, - }); err != nil { + if err = s.Store.DeleteMemo(ctx, &store.DeleteMemo{ID: id}); err != nil { return nil, status.Errorf(codes.Internal, "failed to delete memo") } @@ -320,36 +327,48 @@ func (s *APIV2Service) DeleteMemo(ctx context.Context, request *apiv2pb.DeleteMe } func (s *APIV2Service) CreateMemoComment(ctx context.Context, request *apiv2pb.CreateMemoCommentRequest) (*apiv2pb.CreateMemoCommentResponse, error) { - relatedMemo, err := s.Store.GetMemo(ctx, &store.FindMemo{ID: &request.Id}) + id, err := ExtractMemoIDFromName(request.Name) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "invalid memo name: %v", err) + } + relatedMemo, err := s.Store.GetMemo(ctx, &store.FindMemo{ID: &id}) if err != nil { return nil, status.Errorf(codes.Internal, "failed to get memo") } // Create the comment memo first. - createMemoResponse, err := s.CreateMemo(ctx, request.Create) + createMemoResponse, err := s.CreateMemo(ctx, request.Comment) if err != nil { return nil, status.Errorf(codes.Internal, "failed to create memo") } // Build the relation between the comment memo and the original memo. memo := createMemoResponse.Memo + memoID, err := ExtractMemoIDFromName(memo.Name) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "invalid memo name: %v", err) + } _, err = s.Store.UpsertMemoRelation(ctx, &store.MemoRelation{ - MemoID: memo.Id, - RelatedMemoID: request.Id, + MemoID: memoID, + RelatedMemoID: relatedMemo.ID, Type: store.MemoRelationComment, }) if err != nil { return nil, status.Errorf(codes.Internal, "failed to create memo relation") } - if memo.Visibility != apiv2pb.Visibility_PRIVATE && memo.CreatorId != relatedMemo.CreatorID { + creatorID, err := ExtractUserIDFromName(memo.Creator) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "invalid memo creator") + } + if memo.Visibility != apiv2pb.Visibility_PRIVATE && creatorID != relatedMemo.CreatorID { activity, err := s.Store.CreateActivity(ctx, &store.Activity{ - CreatorID: memo.CreatorId, + CreatorID: creatorID, Type: store.ActivityTypeMemoComment, Level: store.ActivityLevelInfo, Payload: &storepb.ActivityPayload{ MemoComment: &storepb.ActivityMemoCommentPayload{ - MemoId: memo.Id, - RelatedMemoId: request.Id, + MemoId: memoID, + RelatedMemoId: relatedMemo.ID, }, }, }) @@ -357,7 +376,7 @@ func (s *APIV2Service) CreateMemoComment(ctx context.Context, request *apiv2pb.C return nil, status.Errorf(codes.Internal, "failed to create activity") } if _, err := s.Store.CreateInbox(ctx, &store.Inbox{ - SenderID: memo.CreatorId, + SenderID: creatorID, ReceiverID: relatedMemo.CreatorID, Status: store.UNREAD, Message: &storepb.InboxMessage{ @@ -376,9 +395,13 @@ func (s *APIV2Service) CreateMemoComment(ctx context.Context, request *apiv2pb.C } func (s *APIV2Service) ListMemoComments(ctx context.Context, request *apiv2pb.ListMemoCommentsRequest) (*apiv2pb.ListMemoCommentsResponse, error) { + id, err := ExtractMemoIDFromName(request.Name) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "invalid memo name: %v", err) + } memoRelationComment := store.MemoRelationComment memoRelations, err := s.Store.ListMemoRelations(ctx, &store.FindMemoRelation{ - RelatedMemoID: &request.Id, + RelatedMemoID: &id, Type: &memoRelationComment, }) if err != nil { @@ -409,12 +432,12 @@ func (s *APIV2Service) ListMemoComments(ctx context.Context, request *apiv2pb.Li } func (s *APIV2Service) GetUserMemosStats(ctx context.Context, request *apiv2pb.GetUserMemosStatsRequest) (*apiv2pb.GetUserMemosStatsResponse, error) { - username, err := ExtractUsernameFromName(request.Name) + userID, err := ExtractUserIDFromName(request.Name) if err != nil { - return nil, status.Errorf(codes.InvalidArgument, "invalid username") + return nil, errors.Wrap(err, "invalid user name") } user, err := s.Store.GetUser(ctx, &store.FindUser{ - Username: &username, + ID: &userID, }) if err != nil { return nil, status.Errorf(codes.Internal, "failed to get user") @@ -436,7 +459,7 @@ func (s *APIV2Service) GetUserMemosStats(ctx context.Context, request *apiv2pb.G memos, err := s.Store.ListMemos(ctx, memoFind) if err != nil { - return nil, status.Errorf(codes.Internal, "failed to list memos") + return nil, status.Errorf(codes.Internal, "failed to list memos: %v", err) } location, err := time.LoadLocation(request.Timezone) @@ -471,12 +494,12 @@ func (s *APIV2Service) ExportMemos(ctx context.Context, request *apiv2pb.ExportM ExcludeComments: true, } if err := s.buildMemoFindWithFilter(ctx, memoFind, request.Filter); err != nil { - return nil, status.Errorf(codes.Internal, "failed to build find memos with filter") + return nil, status.Errorf(codes.Internal, "failed to build find memos with filter: %v", err) } memos, err := s.Store.ListMemos(ctx, memoFind) if err != nil { - return nil, status.Errorf(codes.Internal, "failed to list memos") + return nil, status.Errorf(codes.Internal, "failed to list memos: %v", err) } buf := new(bytes.Buffer) @@ -515,27 +538,27 @@ func (s *APIV2Service) convertMemoFromStore(ctx context.Context, memo *store.Mem return nil, errors.Wrap(err, "failed to get creator") } - listMemoRelationsResponse, err := s.ListMemoRelations(ctx, &apiv2pb.ListMemoRelationsRequest{Id: memo.ID}) + name := fmt.Sprintf("%s%d", MemoNamePrefix, memo.ID) + listMemoRelationsResponse, err := s.ListMemoRelations(ctx, &apiv2pb.ListMemoRelationsRequest{Name: name}) if err != nil { return nil, errors.Wrap(err, "failed to list memo relations") } - listMemoResourcesResponse, err := s.ListMemoResources(ctx, &apiv2pb.ListMemoResourcesRequest{Id: memo.ID}) + listMemoResourcesResponse, err := s.ListMemoResources(ctx, &apiv2pb.ListMemoResourcesRequest{Name: name}) if err != nil { return nil, errors.Wrap(err, "failed to list memo resources") } - listMemoReactionsResponse, err := s.ListMemoReactions(ctx, &apiv2pb.ListMemoReactionsRequest{Id: memo.ID}) + listMemoReactionsResponse, err := s.ListMemoReactions(ctx, &apiv2pb.ListMemoReactionsRequest{Name: name}) if err != nil { return nil, errors.Wrap(err, "failed to list memo reactions") } return &apiv2pb.Memo{ - Id: int32(memo.ID), - Name: memo.ResourceName, + Name: name, + Uid: memo.UID, RowStatus: convertRowStatusFromStore(memo.RowStatus), - Creator: fmt.Sprintf("%s%s", UserNamePrefix, creator.Username), - CreatorId: int32(memo.CreatorID), + Creator: fmt.Sprintf("%s%d", UserNamePrefix, creator.ID), CreateTime: timestamppb.New(time.Unix(memo.CreatedTs, 0)), UpdateTime: timestamppb.New(time.Unix(memo.UpdatedTs, 0)), DisplayTime: timestamppb.New(time.Unix(displayTs, 0)), @@ -617,7 +640,7 @@ func (s *APIV2Service) buildMemoFindWithFilter(ctx context.Context, find *store. find = &store.FindMemo{} } if filter != "" { - filter, err := parseListMemosFilter(filter) + filter, err := parseSearchMemosFilter(filter) if err != nil { return status.Errorf(codes.InvalidArgument, "invalid filter: %v", err) } @@ -653,12 +676,12 @@ func (s *APIV2Service) buildMemoFindWithFilter(ctx context.Context, find *store. } } if filter.Creator != nil { - username, err := ExtractUsernameFromName(*filter.Creator) + userID, err := ExtractUserIDFromName(*filter.Creator) if err != nil { - return status.Errorf(codes.InvalidArgument, "invalid creator name") + return errors.Wrap(err, "invalid user name") } user, err := s.Store.GetUser(ctx, &store.FindUser{ - Username: &username, + ID: &userID, }) if err != nil { return status.Errorf(codes.Internal, "failed to get user") @@ -668,9 +691,18 @@ func (s *APIV2Service) buildMemoFindWithFilter(ctx context.Context, find *store. } find.CreatorID = &user.ID } + if filter.UID != nil { + find.UID = filter.UID + } if filter.RowStatus != nil { find.RowStatus = filter.RowStatus } + if filter.Random { + find.Random = filter.Random + } + if filter.Limit != nil { + find.Limit = filter.Limit + } } // If the user is not authenticated, only public memos are visible. @@ -695,29 +727,35 @@ func (s *APIV2Service) buildMemoFindWithFilter(ctx context.Context, find *store. return nil } -// ListMemosFilterCELAttributes are the CEL attributes for ListMemosFilter. -var ListMemosFilterCELAttributes = []cel.EnvOption{ +// SearchMemosFilterCELAttributes are the CEL attributes. +var SearchMemosFilterCELAttributes = []cel.EnvOption{ cel.Variable("content_search", cel.ListType(cel.StringType)), cel.Variable("visibilities", cel.ListType(cel.StringType)), cel.Variable("order_by_pinned", cel.BoolType), cel.Variable("display_time_before", cel.IntType), cel.Variable("display_time_after", cel.IntType), cel.Variable("creator", cel.StringType), + cel.Variable("uid", cel.StringType), cel.Variable("row_status", cel.StringType), + cel.Variable("random", cel.BoolType), + cel.Variable("limit", cel.IntType), } -type ListMemosFilter struct { +type SearchMemosFilter struct { ContentSearch []string Visibilities []store.Visibility OrderByPinned bool DisplayTimeBefore *int64 DisplayTimeAfter *int64 Creator *string + UID *string RowStatus *store.RowStatus + Random bool + Limit *int } -func parseListMemosFilter(expression string) (*ListMemosFilter, error) { - e, err := cel.NewEnv(ListMemosFilterCELAttributes...) +func parseSearchMemosFilter(expression string) (*SearchMemosFilter, error) { + e, err := cel.NewEnv(SearchMemosFilterCELAttributes...) if err != nil { return nil, err } @@ -725,17 +763,17 @@ func parseListMemosFilter(expression string) (*ListMemosFilter, error) { if issues != nil { return nil, errors.Errorf("found issue %v", issues) } - filter := &ListMemosFilter{} + filter := &SearchMemosFilter{} expr, err := cel.AstToParsedExpr(ast) if err != nil { return nil, err } callExpr := expr.GetExpr().GetCallExpr() - findField(callExpr, filter) + findSearchMemosField(callExpr, filter) return filter, nil } -func findField(callExpr *expr.Expr_Call, filter *ListMemosFilter) { +func findSearchMemosField(callExpr *expr.Expr_Call, filter *SearchMemosFilter) { if len(callExpr.Args) == 2 { idExpr := callExpr.Args[0].GetIdentExpr() if idExpr != nil { @@ -765,9 +803,18 @@ func findField(callExpr *expr.Expr_Call, filter *ListMemosFilter) { } else if idExpr.Name == "creator" { creator := callExpr.Args[1].GetConstExpr().GetStringValue() filter.Creator = &creator + } else if idExpr.Name == "uid" { + uid := callExpr.Args[1].GetConstExpr().GetStringValue() + filter.UID = &uid } else if idExpr.Name == "row_status" { rowStatus := store.RowStatus(callExpr.Args[1].GetConstExpr().GetStringValue()) filter.RowStatus = &rowStatus + } else if idExpr.Name == "random" { + value := callExpr.Args[1].GetConstExpr().GetBoolValue() + filter.Random = value + } else if idExpr.Name == "limit" { + limit := int(callExpr.Args[1].GetConstExpr().GetInt64Value()) + filter.Limit = &limit } return } @@ -775,7 +822,7 @@ func findField(callExpr *expr.Expr_Call, filter *ListMemosFilter) { for _, arg := range callExpr.Args { callExpr := arg.GetCallExpr() if callExpr != nil { - findField(callExpr, filter) + findSearchMemosField(callExpr, filter) } } } @@ -796,31 +843,45 @@ func (s *APIV2Service) DispatchMemoDeletedWebhook(ctx context.Context, memo *api } func (s *APIV2Service) dispatchMemoRelatedWebhook(ctx context.Context, memo *apiv2pb.Memo, activityType string) error { + creatorID, err := ExtractUserIDFromName(memo.Creator) + if err != nil { + return status.Errorf(codes.InvalidArgument, "invalid memo creator") + } webhooks, err := s.Store.ListWebhooks(ctx, &store.FindWebhook{ - CreatorID: &memo.CreatorId, + CreatorID: &creatorID, }) if err != nil { return err } for _, hook := range webhooks { - payload := convertMemoToWebhookPayload(memo) + payload, err := convertMemoToWebhookPayload(memo) + if err != nil { + return errors.Wrap(err, "failed to convert memo to webhook payload") + } payload.ActivityType = activityType payload.URL = hook.Url - err := webhook.Post(*payload) - if err != nil { + if err := webhook.Post(*payload); err != nil { return errors.Wrap(err, "failed to post webhook") } } return nil } -func convertMemoToWebhookPayload(memo *apiv2pb.Memo) *webhook.WebhookPayload { +func convertMemoToWebhookPayload(memo *apiv2pb.Memo) (*webhook.WebhookPayload, error) { + creatorID, err := ExtractUserIDFromName(memo.Creator) + if err != nil { + return nil, errors.Wrap(err, "invalid memo creator") + } + id, err := ExtractMemoIDFromName(memo.Name) + if err != nil { + return nil, errors.Wrap(err, "invalid memo name") + } return &webhook.WebhookPayload{ - CreatorID: memo.CreatorId, + CreatorID: creatorID, CreatedTs: time.Now().Unix(), Memo: &webhook.Memo{ - ID: memo.Id, - CreatorID: memo.CreatorId, + ID: id, + CreatorID: creatorID, CreatedTs: memo.CreateTime.Seconds, UpdatedTs: memo.UpdateTime.Seconds, Content: memo.Content, @@ -830,7 +891,7 @@ func convertMemoToWebhookPayload(memo *apiv2pb.Memo) *webhook.WebhookPayload { resources := []*webhook.Resource{} for _, resource := range memo.Resources { resources = append(resources, &webhook.Resource{ - ID: resource.Id, + UID: resource.Uid, Filename: resource.Filename, ExternalLink: resource.ExternalLink, Type: resource.Type, @@ -839,17 +900,6 @@ func convertMemoToWebhookPayload(memo *apiv2pb.Memo) *webhook.WebhookPayload { } return resources }(), - RelationList: func() []*webhook.MemoRelation { - relations := []*webhook.MemoRelation{} - for _, relation := range memo.Relations { - relations = append(relations, &webhook.MemoRelation{ - MemoID: relation.MemoId, - RelatedMemoID: relation.RelatedMemoId, - Type: relation.Type.String(), - }) - } - return relations - }(), }, - } + }, nil } diff --git a/server/route/api/v2/reaction_service.go b/server/route/api/v2/reaction_service.go index 8a507bc2d2d84..94f27d50df001 100644 --- a/server/route/api/v2/reaction_service.go +++ b/server/route/api/v2/reaction_service.go @@ -13,9 +13,8 @@ import ( ) func (s *APIV2Service) ListMemoReactions(ctx context.Context, request *apiv2pb.ListMemoReactionsRequest) (*apiv2pb.ListMemoReactionsResponse, error) { - contentID := fmt.Sprintf("memos/%d", request.Id) reactions, err := s.Store.ListReactions(ctx, &store.FindReaction{ - ContentID: &contentID, + ContentID: &request.Name, }) if err != nil { return nil, status.Errorf(codes.Internal, "failed to list reactions") @@ -59,7 +58,7 @@ func (s *APIV2Service) UpsertMemoReaction(ctx context.Context, request *apiv2pb. func (s *APIV2Service) DeleteMemoReaction(ctx context.Context, request *apiv2pb.DeleteMemoReactionRequest) (*apiv2pb.DeleteMemoReactionResponse, error) { if err := s.Store.DeleteReaction(ctx, &store.DeleteReaction{ - ID: request.Id, + ID: request.ReactionId, }); err != nil { return nil, status.Errorf(codes.Internal, "failed to delete reaction") } @@ -76,7 +75,7 @@ func (s *APIV2Service) convertReactionFromStore(ctx context.Context, reaction *s } return &apiv2pb.Reaction{ Id: reaction.Id, - Creator: fmt.Sprintf("%s%s", UserNamePrefix, creator.Username), + Creator: fmt.Sprintf("%s%d", UserNamePrefix, creator.ID), ContentId: reaction.ContentId, ReactionType: apiv2pb.Reaction_Type(reaction.ReactionType), }, nil diff --git a/server/route/api/v2/resource_name.go b/server/route/api/v2/resource_name.go index a2987dfbd3bbb..0aebea390244b 100644 --- a/server/route/api/v2/resource_name.go +++ b/server/route/api/v2/resource_name.go @@ -12,6 +12,8 @@ import ( const ( WorkspaceSettingNamePrefix = "settings/" UserNamePrefix = "users/" + MemoNamePrefix = "memos/" + ResourceNamePrefix = "resources/" InboxNamePrefix = "inboxes/" ) @@ -43,13 +45,43 @@ func ExtractWorkspaceSettingKeyFromName(name string) (string, error) { return tokens[0], nil } -// ExtractUsernameFromName returns the username from a resource name. -func ExtractUsernameFromName(name string) (string, error) { +// ExtractUserIDFromName returns the uid from a resource name. +func ExtractUserIDFromName(name string) (int32, error) { tokens, err := GetNameParentTokens(name, UserNamePrefix) if err != nil { - return "", err + return 0, err } - return tokens[0], nil + id, err := util.ConvertStringToInt32(tokens[0]) + if err != nil { + return 0, errors.Errorf("invalid user ID %q", tokens[0]) + } + return id, nil +} + +// ExtractMemoIDFromName returns the memo ID from a resource name. +func ExtractMemoIDFromName(name string) (int32, error) { + tokens, err := GetNameParentTokens(name, MemoNamePrefix) + if err != nil { + return 0, err + } + id, err := util.ConvertStringToInt32(tokens[0]) + if err != nil { + return 0, errors.Errorf("invalid memo ID %q", tokens[0]) + } + return id, nil +} + +// ExtractResourceIDFromName returns the resource ID from a resource name. +func ExtractResourceIDFromName(name string) (int32, error) { + tokens, err := GetNameParentTokens(name, ResourceNamePrefix) + if err != nil { + return 0, err + } + id, err := util.ConvertStringToInt32(tokens[0]) + if err != nil { + return 0, errors.Errorf("invalid resource ID %q", tokens[0]) + } + return id, nil } // ExtractInboxIDFromName returns the inbox ID from a resource name. diff --git a/server/route/api/v2/resource_service.go b/server/route/api/v2/resource_service.go index 88c25690f59db..705f78c2068e8 100644 --- a/server/route/api/v2/resource_service.go +++ b/server/route/api/v2/resource_service.go @@ -2,10 +2,14 @@ package v2 import ( "context" + "fmt" "net/url" "time" + "github.com/google/cel-go/cel" "github.com/lithammer/shortuuid/v4" + "github.com/pkg/errors" + expr "google.golang.org/genproto/googleapis/api/expr/v1alpha1" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "google.golang.org/protobuf/types/known/timestamppb" @@ -31,14 +35,18 @@ func (s *APIV2Service) CreateResource(ctx context.Context, request *apiv2pb.Crea } create := &store.Resource{ - ResourceName: shortuuid.New(), + UID: shortuuid.New(), CreatorID: user.ID, Filename: request.Filename, ExternalLink: request.ExternalLink, Type: request.Type, } - if request.MemoId != nil { - create.MemoID = request.MemoId + if request.Memo != nil { + memoID, err := ExtractMemoIDFromName(*request.Memo) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "invalid memo id: %v", err) + } + create.MemoID = &memoID } resource, err := s.Store.CreateResource(ctx, create) if err != nil { @@ -69,25 +77,42 @@ func (s *APIV2Service) ListResources(ctx context.Context, _ *apiv2pb.ListResourc return response, nil } -func (s *APIV2Service) GetResource(ctx context.Context, request *apiv2pb.GetResourceRequest) (*apiv2pb.GetResourceResponse, error) { - resource, err := s.Store.GetResource(ctx, &store.FindResource{ - ID: &request.Id, - }) +func (s *APIV2Service) SearchResources(ctx context.Context, request *apiv2pb.SearchResourcesRequest) (*apiv2pb.SearchResourcesResponse, error) { + if request.Filter == "" { + return nil, status.Errorf(codes.InvalidArgument, "filter is empty") + } + filter, err := parseSearchResourcesFilter(request.Filter) if err != nil { - return nil, status.Errorf(codes.Internal, "failed to get resource: %v", err) + return nil, status.Errorf(codes.InvalidArgument, "failed to parse filter: %v", err) } - if resource == nil { - return nil, status.Errorf(codes.NotFound, "resource not found") + resourceFind := &store.FindResource{} + if filter.UID != nil { + resourceFind.UID = filter.UID + } + user, err := getCurrentUser(ctx, s.Store) + if err != nil { + return nil, status.Errorf(codes.Internal, "failed to get current user: %v", err) + } + resourceFind.CreatorID = &user.ID + resources, err := s.Store.ListResources(ctx, resourceFind) + if err != nil { + return nil, status.Errorf(codes.Internal, "failed to search resources: %v", err) } - return &apiv2pb.GetResourceResponse{ - Resource: s.convertResourceFromStore(ctx, resource), - }, nil + response := &apiv2pb.SearchResourcesResponse{} + for _, resource := range resources { + response.Resources = append(response.Resources, s.convertResourceFromStore(ctx, resource)) + } + return response, nil } -func (s *APIV2Service) GetResourceByName(ctx context.Context, request *apiv2pb.GetResourceByNameRequest) (*apiv2pb.GetResourceByNameResponse, error) { +func (s *APIV2Service) GetResource(ctx context.Context, request *apiv2pb.GetResourceRequest) (*apiv2pb.GetResourceResponse, error) { + id, err := ExtractResourceIDFromName(request.Name) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "invalid resource id: %v", err) + } resource, err := s.Store.GetResource(ctx, &store.FindResource{ - ResourceName: &request.Name, + ID: &id, }) if err != nil { return nil, status.Errorf(codes.Internal, "failed to get resource: %v", err) @@ -96,26 +121,37 @@ func (s *APIV2Service) GetResourceByName(ctx context.Context, request *apiv2pb.G return nil, status.Errorf(codes.NotFound, "resource not found") } - return &apiv2pb.GetResourceByNameResponse{ + return &apiv2pb.GetResourceResponse{ Resource: s.convertResourceFromStore(ctx, resource), }, nil } func (s *APIV2Service) UpdateResource(ctx context.Context, request *apiv2pb.UpdateResourceRequest) (*apiv2pb.UpdateResourceResponse, error) { + id, err := ExtractResourceIDFromName(request.Resource.Name) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "invalid resource id: %v", err) + } if request.UpdateMask == nil || len(request.UpdateMask.Paths) == 0 { return nil, status.Errorf(codes.InvalidArgument, "update mask is required") } currentTs := time.Now().Unix() update := &store.UpdateResource{ - ID: request.Resource.Id, + ID: id, UpdatedTs: ¤tTs, } for _, field := range request.UpdateMask.Paths { if field == "filename" { update.Filename = &request.Resource.Filename - } else if field == "memo_id" { - update.MemoID = request.Resource.MemoId + } else if field == "memo" { + if request.Resource.Memo == nil { + return nil, status.Errorf(codes.InvalidArgument, "memo is required") + } + memoID, err := ExtractMemoIDFromName(*request.Resource.Memo) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "invalid memo id: %v", err) + } + update.MemoID = &memoID } } @@ -129,12 +165,16 @@ func (s *APIV2Service) UpdateResource(ctx context.Context, request *apiv2pb.Upda } func (s *APIV2Service) DeleteResource(ctx context.Context, request *apiv2pb.DeleteResourceRequest) (*apiv2pb.DeleteResourceResponse, error) { + id, err := ExtractResourceIDFromName(request.Name) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "invalid resource id: %v", err) + } user, err := getCurrentUser(ctx, s.Store) if err != nil { return nil, status.Errorf(codes.Internal, "failed to get current user: %v", err) } resource, err := s.Store.GetResource(ctx, &store.FindResource{ - ID: &request.Id, + ID: &id, CreatorID: &user.ID, }) if err != nil { @@ -153,24 +193,71 @@ func (s *APIV2Service) DeleteResource(ctx context.Context, request *apiv2pb.Dele } func (s *APIV2Service) convertResourceFromStore(ctx context.Context, resource *store.Resource) *apiv2pb.Resource { - var memoID *int32 + resourceMessage := &apiv2pb.Resource{ + Name: fmt.Sprintf("%s%d", ResourceNamePrefix, resource.ID), + Uid: resource.UID, + CreateTime: timestamppb.New(time.Unix(resource.CreatedTs, 0)), + Filename: resource.Filename, + ExternalLink: resource.ExternalLink, + Type: resource.Type, + Size: resource.Size, + } if resource.MemoID != nil { memo, _ := s.Store.GetMemo(ctx, &store.FindMemo{ ID: resource.MemoID, }) if memo != nil { - memoID = &memo.ID + memoName := fmt.Sprintf("%s%d", MemoNamePrefix, memo.ID) + resourceMessage.Memo = &memoName } } - return &apiv2pb.Resource{ - Id: resource.ID, - Name: resource.ResourceName, - CreateTime: timestamppb.New(time.Unix(resource.CreatedTs, 0)), - Filename: resource.Filename, - ExternalLink: resource.ExternalLink, - Type: resource.Type, - Size: resource.Size, - MemoId: memoID, + return resourceMessage +} + +// SearchResourcesFilterCELAttributes are the CEL attributes for SearchResourcesFilter. +var SearchResourcesFilterCELAttributes = []cel.EnvOption{ + cel.Variable("uid", cel.StringType), +} + +type SearchResourcesFilter struct { + UID *string +} + +func parseSearchResourcesFilter(expression string) (*SearchResourcesFilter, error) { + e, err := cel.NewEnv(SearchResourcesFilterCELAttributes...) + if err != nil { + return nil, err + } + ast, issues := e.Compile(expression) + if issues != nil { + return nil, errors.Errorf("found issue %v", issues) + } + filter := &SearchResourcesFilter{} + expr, err := cel.AstToParsedExpr(ast) + if err != nil { + return nil, err + } + callExpr := expr.GetExpr().GetCallExpr() + findSearchResourcesField(callExpr, filter) + return filter, nil +} + +func findSearchResourcesField(callExpr *expr.Expr_Call, filter *SearchResourcesFilter) { + if len(callExpr.Args) == 2 { + idExpr := callExpr.Args[0].GetIdentExpr() + if idExpr != nil { + if idExpr.Name == "uid" { + uid := callExpr.Args[1].GetConstExpr().GetStringValue() + filter.UID = &uid + } + return + } + } + for _, arg := range callExpr.Args { + callExpr := arg.GetCallExpr() + if callExpr != nil { + findSearchResourcesField(callExpr, filter) + } } } diff --git a/server/route/api/v2/tag_service.go b/server/route/api/v2/tag_service.go index 3e888a86a74c0..431c596d39961 100644 --- a/server/route/api/v2/tag_service.go +++ b/server/route/api/v2/tag_service.go @@ -51,22 +51,13 @@ func (s *APIV2Service) BatchUpsertTag(ctx context.Context, request *apiv2pb.Batc } func (s *APIV2Service) ListTags(ctx context.Context, request *apiv2pb.ListTagsRequest) (*apiv2pb.ListTagsResponse, error) { - username, err := ExtractUsernameFromName(request.User) + tagFind := &store.FindTag{} + userID, err := ExtractUserIDFromName(request.User) if err != nil { - return nil, status.Errorf(codes.InvalidArgument, "invalid username: %v", err) + return nil, status.Errorf(codes.InvalidArgument, "invalid user name: %v", err) } - user, err := s.Store.GetUser(ctx, &store.FindUser{ - Username: &username, - }) - if err != nil { - return nil, status.Errorf(codes.Internal, "failed to get user: %v", err) - } - if user == nil { - return nil, status.Errorf(codes.NotFound, "user not found") - } - tags, err := s.Store.ListTags(ctx, &store.FindTag{ - CreatorID: user.ID, - }) + tagFind.CreatorID = userID + tags, err := s.Store.ListTags(ctx, tagFind) if err != nil { return nil, status.Errorf(codes.Internal, "failed to list tags: %v", err) } @@ -83,12 +74,12 @@ func (s *APIV2Service) ListTags(ctx context.Context, request *apiv2pb.ListTagsRe } func (s *APIV2Service) RenameTag(ctx context.Context, request *apiv2pb.RenameTagRequest) (*apiv2pb.RenameTagResponse, error) { - username, err := ExtractUsernameFromName(request.User) + userID, err := ExtractUserIDFromName(request.User) if err != nil { - return nil, status.Errorf(codes.InvalidArgument, "invalid username: %v", err) + return nil, status.Errorf(codes.InvalidArgument, "invalid user name: %v", err) } user, err := s.Store.GetUser(ctx, &store.FindUser{ - Username: &username, + ID: &userID, }) if err != nil { return nil, status.Errorf(codes.Internal, "failed to get user: %v", err) @@ -148,12 +139,12 @@ func (s *APIV2Service) RenameTag(ctx context.Context, request *apiv2pb.RenameTag } func (s *APIV2Service) DeleteTag(ctx context.Context, request *apiv2pb.DeleteTagRequest) (*apiv2pb.DeleteTagResponse, error) { - username, err := ExtractUsernameFromName(request.Tag.Creator) + userID, err := ExtractUserIDFromName(request.Tag.Creator) if err != nil { - return nil, status.Errorf(codes.InvalidArgument, "invalid username: %v", err) + return nil, status.Errorf(codes.InvalidArgument, "invalid user name: %v", err) } user, err := s.Store.GetUser(ctx, &store.FindUser{ - Username: &username, + ID: &userID, }) if err != nil { return nil, status.Errorf(codes.Internal, "failed to get user: %v", err) @@ -172,12 +163,12 @@ func (s *APIV2Service) DeleteTag(ctx context.Context, request *apiv2pb.DeleteTag } func (s *APIV2Service) GetTagSuggestions(ctx context.Context, request *apiv2pb.GetTagSuggestionsRequest) (*apiv2pb.GetTagSuggestionsResponse, error) { - username, err := ExtractUsernameFromName(request.User) + userID, err := ExtractUserIDFromName(request.User) if err != nil { - return nil, status.Errorf(codes.InvalidArgument, "invalid username: %v", err) + return nil, status.Errorf(codes.InvalidArgument, "invalid user name: %v", err) } user, err := s.Store.GetUser(ctx, &store.FindUser{ - Username: &username, + ID: &userID, }) if err != nil { return nil, status.Errorf(codes.Internal, "failed to get user: %v", err) @@ -244,7 +235,7 @@ func (s *APIV2Service) convertTagFromStore(ctx context.Context, tag *store.Tag) } return &apiv2pb.Tag{ Name: tag.Name, - Creator: fmt.Sprintf("%s%s", UserNamePrefix, user.Username), + Creator: fmt.Sprintf("%s%d", UserNamePrefix, user.ID), }, nil } diff --git a/server/route/api/v2/user_service.go b/server/route/api/v2/user_service.go index 16f3732798a83..6175dd92ce8cb 100644 --- a/server/route/api/v2/user_service.go +++ b/server/route/api/v2/user_service.go @@ -4,14 +4,16 @@ import ( "context" "fmt" "net/http" + "slices" "strings" "time" "github.com/golang-jwt/jwt/v5" + "github.com/google/cel-go/cel" "github.com/labstack/echo/v4" "github.com/pkg/errors" "golang.org/x/crypto/bcrypt" - "golang.org/x/exp/slices" + expr "google.golang.org/genproto/googleapis/api/expr/v1alpha1" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "google.golang.org/protobuf/types/known/timestamppb" @@ -46,13 +48,46 @@ func (s *APIV2Service) ListUsers(ctx context.Context, _ *apiv2pb.ListUsersReques return response, nil } +func (s *APIV2Service) SearchUsers(ctx context.Context, request *apiv2pb.SearchUsersRequest) (*apiv2pb.SearchUsersResponse, error) { + if request.Filter == "" { + return nil, status.Errorf(codes.InvalidArgument, "filter is empty") + } + filter, err := parseSearchUsersFilter(request.Filter) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "failed to parse filter: %v", err) + } + userFind := &store.FindUser{} + if filter.Username != nil { + userFind.Username = filter.Username + } + if filter.Random { + userFind.Random = true + } + if filter.Limit != nil { + userFind.Limit = filter.Limit + } + + users, err := s.Store.ListUsers(ctx, userFind) + if err != nil { + return nil, status.Errorf(codes.Internal, "failed to search users: %v", err) + } + + response := &apiv2pb.SearchUsersResponse{ + Users: []*apiv2pb.User{}, + } + for _, user := range users { + response.Users = append(response.Users, convertUserFromStore(user)) + } + return response, nil +} + func (s *APIV2Service) GetUser(ctx context.Context, request *apiv2pb.GetUserRequest) (*apiv2pb.GetUserResponse, error) { - username, err := ExtractUsernameFromName(request.Name) + userID, err := ExtractUserIDFromName(request.Name) if err != nil { - return nil, status.Errorf(codes.InvalidArgument, "name is required") + return nil, status.Errorf(codes.InvalidArgument, "invalid user name: %v", err) } user, err := s.Store.GetUser(ctx, &store.FindUser{ - Username: &username, + ID: &userID, }) if err != nil { return nil, status.Errorf(codes.Internal, "failed to get user: %v", err) @@ -76,13 +111,8 @@ func (s *APIV2Service) CreateUser(ctx context.Context, request *apiv2pb.CreateUs if currentUser.Role != store.RoleHost { return nil, status.Errorf(codes.PermissionDenied, "permission denied") } - - username, err := ExtractUsernameFromName(request.User.Name) - if err != nil { - return nil, status.Errorf(codes.InvalidArgument, "name is required") - } - if !util.ResourceNameMatcher.MatchString(strings.ToLower(username)) { - return nil, status.Errorf(codes.InvalidArgument, "invalid username: %s", username) + if !util.UIDMatcher.MatchString(strings.ToLower(request.User.Username)) { + return nil, status.Errorf(codes.InvalidArgument, "invalid username: %s", request.User.Username) } passwordHash, err := bcrypt.GenerateFromPassword([]byte(request.User.Password), bcrypt.DefaultCost) if err != nil { @@ -90,7 +120,7 @@ func (s *APIV2Service) CreateUser(ctx context.Context, request *apiv2pb.CreateUs } user, err := s.Store.CreateUser(ctx, &store.User{ - Username: username, + Username: request.User.Username, Role: convertUserRoleToStore(request.User.Role), Email: request.User.Email, Nickname: request.User.Nickname, @@ -107,22 +137,22 @@ func (s *APIV2Service) CreateUser(ctx context.Context, request *apiv2pb.CreateUs } func (s *APIV2Service) UpdateUser(ctx context.Context, request *apiv2pb.UpdateUserRequest) (*apiv2pb.UpdateUserResponse, error) { - username, err := ExtractUsernameFromName(request.User.Name) + userID, err := ExtractUserIDFromName(request.User.Name) if err != nil { - return nil, status.Errorf(codes.InvalidArgument, "name is required") + return nil, status.Errorf(codes.InvalidArgument, "invalid user name: %v", err) } currentUser, err := getCurrentUser(ctx, s.Store) if err != nil { return nil, status.Errorf(codes.Internal, "failed to get user: %v", err) } - if currentUser.Username != username && currentUser.Role != store.RoleAdmin && currentUser.Role != store.RoleHost { + if currentUser.ID != userID && currentUser.Role != store.RoleAdmin && currentUser.Role != store.RoleHost { return nil, status.Errorf(codes.PermissionDenied, "permission denied") } if request.UpdateMask == nil || len(request.UpdateMask.Paths) == 0 { return nil, status.Errorf(codes.InvalidArgument, "update mask is empty") } - user, err := s.Store.GetUser(ctx, &store.FindUser{Username: &username}) + user, err := s.Store.GetUser(ctx, &store.FindUser{ID: &userID}) if err != nil { return nil, status.Errorf(codes.Internal, "failed to get user: %v", err) } @@ -130,10 +160,6 @@ func (s *APIV2Service) UpdateUser(ctx context.Context, request *apiv2pb.UpdateUs return nil, status.Errorf(codes.NotFound, "user not found") } - if s.Profile.Mode == "demo" && user.Username == "memos-demo" { - return nil, status.Errorf(codes.PermissionDenied, "unauthorized to update user in demo mode") - } - currentTs := time.Now().Unix() update := &store.UpdateUser{ ID: user.ID, @@ -141,7 +167,7 @@ func (s *APIV2Service) UpdateUser(ctx context.Context, request *apiv2pb.UpdateUs } for _, field := range request.UpdateMask.Paths { if field == "username" { - if !util.ResourceNameMatcher.MatchString(strings.ToLower(request.User.Username)) { + if !util.UIDMatcher.MatchString(strings.ToLower(request.User.Username)) { return nil, status.Errorf(codes.InvalidArgument, "invalid username: %s", request.User.Username) } update.Username = &request.User.Username @@ -151,6 +177,8 @@ func (s *APIV2Service) UpdateUser(ctx context.Context, request *apiv2pb.UpdateUs update.Email = &request.User.Email } else if field == "avatar_url" { update.AvatarURL = &request.User.AvatarUrl + } else if field == "description" { + update.Description = &request.User.Description } else if field == "role" { role := convertUserRoleToStore(request.User.Role) update.Role = &role @@ -181,19 +209,19 @@ func (s *APIV2Service) UpdateUser(ctx context.Context, request *apiv2pb.UpdateUs } func (s *APIV2Service) DeleteUser(ctx context.Context, request *apiv2pb.DeleteUserRequest) (*apiv2pb.DeleteUserResponse, error) { - username, err := ExtractUsernameFromName(request.Name) + userID, err := ExtractUserIDFromName(request.Name) if err != nil { - return nil, status.Errorf(codes.InvalidArgument, "name is required") + return nil, status.Errorf(codes.InvalidArgument, "invalid user name: %v", err) } currentUser, err := getCurrentUser(ctx, s.Store) if err != nil { return nil, status.Errorf(codes.Internal, "failed to get user: %v", err) } - if currentUser.Username != username && currentUser.Role != store.RoleAdmin && currentUser.Role != store.RoleHost { + if currentUser.ID != userID && currentUser.Role != store.RoleAdmin && currentUser.Role != store.RoleHost { return nil, status.Errorf(codes.PermissionDenied, "permission denied") } - user, err := s.Store.GetUser(ctx, &store.FindUser{Username: &username}) + user, err := s.Store.GetUser(ctx, &store.FindUser{ID: &userID}) if err != nil { return nil, status.Errorf(codes.Internal, "failed to get user: %v", err) } @@ -201,10 +229,6 @@ func (s *APIV2Service) DeleteUser(ctx context.Context, request *apiv2pb.DeleteUs return nil, status.Errorf(codes.NotFound, "user not found") } - if s.Profile.Mode == "demo" && user.Username == "memos-demo" { - return nil, status.Errorf(codes.PermissionDenied, "unauthorized to delete this user in demo mode") - } - if err := s.Store.DeleteUser(ctx, &store.DeleteUser{ ID: user.ID, }); err != nil { @@ -316,36 +340,16 @@ func (s *APIV2Service) UpdateUserSetting(ctx context.Context, request *apiv2pb.U }, nil } -func (s *APIV2Service) ListUserAccessTokens(ctx context.Context, request *apiv2pb.ListUserAccessTokensRequest) (*apiv2pb.ListUserAccessTokensResponse, error) { - user, err := getCurrentUser(ctx, s.Store) +func (s *APIV2Service) ListUserAccessTokens(ctx context.Context, _ *apiv2pb.ListUserAccessTokensRequest) (*apiv2pb.ListUserAccessTokensResponse, error) { + currentUser, err := getCurrentUser(ctx, s.Store) if err != nil { return nil, status.Errorf(codes.Internal, "failed to get current user: %v", err) } - if user == nil { + if currentUser == nil { return nil, status.Errorf(codes.PermissionDenied, "permission denied") } - userID := user.ID - username, err := ExtractUsernameFromName(request.Name) - if err != nil { - return nil, status.Errorf(codes.InvalidArgument, "name is required") - } - // List access token for other users need to be verified. - if user.Username != username { - // Normal users can only list their access tokens. - if user.Role == store.RoleUser { - return nil, status.Errorf(codes.PermissionDenied, "permission denied") - } - - // The request user must be exist. - requestUser, err := s.Store.GetUser(ctx, &store.FindUser{Username: &username}) - if requestUser == nil || err != nil { - return nil, status.Errorf(codes.NotFound, "fail to find user %s", username) - } - userID = requestUser.ID - } - - userAccessTokens, err := s.Store.GetUserAccessTokens(ctx, userID) + userAccessTokens, err := s.Store.GetUserAccessTokens(ctx, currentUser.ID) if err != nil { return nil, status.Errorf(codes.Internal, "failed to list access tokens: %v", err) } @@ -505,16 +509,17 @@ func (s *APIV2Service) UpsertAccessTokenToStore(ctx context.Context, user *store func convertUserFromStore(user *store.User) *apiv2pb.User { return &apiv2pb.User{ - Name: fmt.Sprintf("%s%s", UserNamePrefix, user.Username), - Id: user.ID, - RowStatus: convertRowStatusFromStore(user.RowStatus), - CreateTime: timestamppb.New(time.Unix(user.CreatedTs, 0)), - UpdateTime: timestamppb.New(time.Unix(user.UpdatedTs, 0)), - Role: convertUserRoleFromStore(user.Role), - Username: user.Username, - Email: user.Email, - Nickname: user.Nickname, - AvatarUrl: user.AvatarURL, + Name: fmt.Sprintf("%s%d", UserNamePrefix, user.ID), + Id: user.ID, + RowStatus: convertRowStatusFromStore(user.RowStatus), + CreateTime: timestamppb.New(time.Unix(user.CreatedTs, 0)), + UpdateTime: timestamppb.New(time.Unix(user.UpdatedTs, 0)), + Role: convertUserRoleFromStore(user.Role), + Username: user.Username, + Email: user.Email, + Nickname: user.Nickname, + AvatarUrl: user.AvatarURL, + Description: user.Description, } } @@ -543,3 +548,60 @@ func convertUserRoleToStore(role apiv2pb.User_Role) store.Role { return store.RoleUser } } + +// SearchUsersFilterCELAttributes are the CEL attributes for SearchUsersFilter. +var SearchUsersFilterCELAttributes = []cel.EnvOption{ + cel.Variable("username", cel.StringType), + cel.Variable("random", cel.BoolType), + cel.Variable("limit", cel.IntType), +} + +type SearchUsersFilter struct { + Username *string + Random bool + Limit *int +} + +func parseSearchUsersFilter(expression string) (*SearchUsersFilter, error) { + e, err := cel.NewEnv(SearchUsersFilterCELAttributes...) + if err != nil { + return nil, err + } + ast, issues := e.Compile(expression) + if issues != nil { + return nil, errors.Errorf("found issue %v", issues) + } + filter := &SearchUsersFilter{} + expr, err := cel.AstToParsedExpr(ast) + if err != nil { + return nil, err + } + callExpr := expr.GetExpr().GetCallExpr() + findSearchUsersField(callExpr, filter) + return filter, nil +} + +func findSearchUsersField(callExpr *expr.Expr_Call, filter *SearchUsersFilter) { + if len(callExpr.Args) == 2 { + idExpr := callExpr.Args[0].GetIdentExpr() + if idExpr != nil { + if idExpr.Name == "username" { + username := callExpr.Args[1].GetConstExpr().GetStringValue() + filter.Username = &username + } else if idExpr.Name == "random" { + random := callExpr.Args[1].GetConstExpr().GetBoolValue() + filter.Random = random + } else if idExpr.Name == "limit" { + limit := int(callExpr.Args[1].GetConstExpr().GetInt64Value()) + filter.Limit = &limit + } + return + } + } + for _, arg := range callExpr.Args { + callExpr := arg.GetCallExpr() + if callExpr != nil { + findSearchUsersField(callExpr, filter) + } + } +} diff --git a/server/route/api/v2/workspace_service.go b/server/route/api/v2/workspace_service.go index 78b31a7e2689b..e6251b2747b6b 100644 --- a/server/route/api/v2/workspace_service.go +++ b/server/route/api/v2/workspace_service.go @@ -3,15 +3,57 @@ package v2 import ( "context" + "github.com/pkg/errors" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + apiv2pb "github.com/usememos/memos/proto/gen/api/v2" + "github.com/usememos/memos/store" ) -func (s *APIV2Service) GetWorkspaceProfile(_ context.Context, _ *apiv2pb.GetWorkspaceProfileRequest) (*apiv2pb.GetWorkspaceProfileResponse, error) { +var ownerCache *apiv2pb.User + +func (s *APIV2Service) GetWorkspaceProfile(ctx context.Context, _ *apiv2pb.GetWorkspaceProfileRequest) (*apiv2pb.GetWorkspaceProfileResponse, error) { workspaceProfile := &apiv2pb.WorkspaceProfile{ Version: s.Profile.Version, Mode: s.Profile.Mode, } + owner, err := s.GetInstanceOwner(ctx) + if err != nil { + return nil, status.Errorf(codes.Internal, "failed to get instance owner: %v", err) + } + if owner != nil { + workspaceProfile.Owner = owner.Name + } + generalSetting, err := s.Store.GetWorkspaceGeneralSetting(ctx) + if err != nil { + return nil, status.Errorf(codes.Internal, "failed to get workspace general setting: %v", err) + } + workspaceProfile.DisallowSignup = generalSetting.DisallowSignup + workspaceProfile.DisablePasswordLogin = generalSetting.DisallowPasswordLogin + workspaceProfile.AdditionalStyle = generalSetting.AdditionalStyle + workspaceProfile.AdditionalScript = generalSetting.AdditionalScript return &apiv2pb.GetWorkspaceProfileResponse{ WorkspaceProfile: workspaceProfile, }, nil } + +func (s *APIV2Service) GetInstanceOwner(ctx context.Context) (*apiv2pb.User, error) { + if ownerCache != nil { + return ownerCache, nil + } + + hostUserType := store.RoleHost + user, err := s.Store.GetUser(ctx, &store.FindUser{ + Role: &hostUserType, + }) + if err != nil { + return nil, errors.Wrapf(err, "failed to find owner") + } + if user == nil { + return nil, nil + } + + ownerCache = convertUserFromStore(user) + return ownerCache, nil +} diff --git a/server/route/api/v2/workspace_setting_service.go b/server/route/api/v2/workspace_setting_service.go index 8b3941997d332..44a38d8dadf1b 100644 --- a/server/route/api/v2/workspace_setting_service.go +++ b/server/route/api/v2/workspace_setting_service.go @@ -34,6 +34,10 @@ func (s *APIV2Service) GetWorkspaceSetting(ctx context.Context, request *apiv2pb } func (s *APIV2Service) SetWorkspaceSetting(ctx context.Context, request *apiv2pb.SetWorkspaceSettingRequest) (*apiv2pb.SetWorkspaceSettingResponse, error) { + if s.Profile.Mode == "demo" { + return nil, status.Errorf(codes.InvalidArgument, "setting workspace setting is not allowed in demo mode") + } + user, err := getCurrentUser(ctx, s.Store) if err != nil { return nil, status.Errorf(codes.Internal, "failed to get current user: %v", err) diff --git a/server/route/frontend/frontend.go b/server/route/frontend/frontend.go index 02c56860d504c..ecc5607d30c21 100644 --- a/server/route/frontend/frontend.go +++ b/server/route/frontend/frontend.go @@ -53,11 +53,11 @@ func (s *FrontendService) Serve(ctx context.Context, e *echo.Echo) { func (s *FrontendService) registerRoutes(e *echo.Echo) { rawIndexHTML := getRawIndexHTML() - e.GET("/m/:name", func(c echo.Context) error { + e.GET("/m/:uid", func(c echo.Context) error { ctx := c.Request().Context() - resourceName := c.Param("name") + uid := c.Param("uid") memo, err := s.Store.GetMemo(ctx, &store.FindMemo{ - ResourceName: &resourceName, + UID: &uid, }) if err != nil { return c.HTML(http.StatusOK, rawIndexHTML) @@ -108,7 +108,7 @@ Sitemap: %s/sitemap.xml`, instanceURL, instanceURL) return err } for _, memo := range memoList { - urlsets = append(urlsets, fmt.Sprintf(`{t(isCreating ? "setting.sso-section.create-sso" : "setting.sso-section.update-sso")}
+{t(isCreating ? "setting.sso-section.create-sso" : "setting.sso-section.update-sso")}
{"Add references"}
+{t("reference.add-references")}