diff --git a/.vscode/settings.json b/.vscode/settings.json index c825599..92ac17c 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -10,5 +10,11 @@ "username": "crab", "password": "crab" } + ], + "cSpell.words": [ + "dbpool", + "jackc", + "pgconn", + "pgxpool" ] } \ No newline at end of file diff --git a/api/smm_core.proto b/api/smm_core.proto index 2f166e6..e7a9aec 100644 --- a/api/smm_core.proto +++ b/api/smm_core.proto @@ -73,6 +73,11 @@ service SmmCore { delete: "/budgets/{budget_id}/users/{user_id}" }; } + rpc GetBudgetCategories(GetBudgetCategoriesReq) returns (Categories) { + option (google.api.http) = { + get: "/budgets/{budget_id}/categories" + }; + } // categories rpc AddCategory(AddCategoryReq) returns (Category) { @@ -86,11 +91,6 @@ service SmmCore { put: "/categories/{id}" }; } - rpc GetCategories(GetCategoriesReq) returns (Categories) { - option (google.api.http) = { - get: "/categories" - }; - } rpc DeleteCategories(DeleteCategoriesReq) returns (Category) { option (google.api.http) = { delete: "/categories/{id}" @@ -150,6 +150,7 @@ message Budget { string name = 2; int32 start_day = 3; int32 monthly_limit = 4; + repeated Category categories = 5; } message UpdateBudgetReq { @@ -187,6 +188,10 @@ message RemoveUserFromBudgetReq { int32 budget_id = 2; } +message GetBudgetCategoriesReq { + int32 budget_id = 2; +} + message AddCategoryReq { string name = 1; int32 budget_id = 2; @@ -209,11 +214,6 @@ message UpdateCategoryReq { int32 monthly_limit = 4; } -message GetCategoriesReq { - bool favorite = 1; - int32 budget_id = 2; -} - message Categories { repeated Category categories = 1; } diff --git a/cmd/smm_core/main.go b/cmd/smm_core/main.go index 59650ec..eb52e5c 100644 --- a/cmd/smm_core/main.go +++ b/cmd/smm_core/main.go @@ -39,7 +39,7 @@ func main() { categoryService := category.NewCategoryService(dbpool) userService := user.NewUserService(dbpool) - budgetService := budget.NewBudgetService(dbpool) + budgetService := budget.NewBudgetService(dbpool, categoryService) // Create a gRPC server object s := grpc.NewServer( diff --git a/internal/app/mappers.go b/internal/app/mappers.go index ffc18b0..b0d132f 100644 --- a/internal/app/mappers.go +++ b/internal/app/mappers.go @@ -2,6 +2,7 @@ package app import ( "git.3crabs.ru/save_my_money/smm_core/internal/services/budget" + "git.3crabs.ru/save_my_money/smm_core/internal/services/category" "git.3crabs.ru/save_my_money/smm_core/internal/services/user" proto "git.3crabs.ru/save_my_money/smm_core/proto" ) @@ -19,5 +20,23 @@ func mapBudget(budget *budget.BudgetEntity) *proto.Budget { Name: budget.Name, StartDay: int32(budget.StartDay), MonthlyLimit: int32(budget.MonthlyLimit), + Categories: mapCategories(budget.Categories), } } + +func mapCategory(category *category.CategoryEntity) *proto.Category { + return &proto.Category{ + Id: int32(category.Id), + Name: category.Name, + Favorite: category.Favorite, + MonthlyLimit: int32(category.MonthlyLimit), + } +} + +func mapCategories(categories []*category.CategoryEntity) []*proto.Category { + res := make([]*proto.Category, 0, len(categories)) + for _, item := range categories { + res = append(res, mapCategory(item)) + } + return res +} diff --git a/internal/app/server.go b/internal/app/server.go index 7c8e59e..6f0ebf8 100644 --- a/internal/app/server.go +++ b/internal/app/server.go @@ -103,9 +103,37 @@ func (s *Server) AddUserToBudget(ctx context.Context, req *proto.AddUserToBudget return &proto.OK{}, nil } -// AddCategory implements proto.SmmCoreServer. -func (s *Server) AddCategory(context.Context, *proto.AddCategoryReq) (*proto.Category, error) { - panic("unimplemented") +func (s *Server) AddCategory(ctx context.Context, req *proto.AddCategoryReq) (*proto.Category, error) { + category, err := s.categoryService.AddCategory( + ctx, + &category.CategoryEntity{ + Name: req.Name, + BudgetId: int(req.BudgetId), + Favorite: req.Favorite, + MonthlyLimit: int(req.MonthlyLimit), + }, + ) + if err != nil { + return nil, err + } + return mapCategory(category), nil +} + +func (s *Server) GetBudgetCategories(ctx context.Context, req *proto.GetBudgetCategoriesReq) (*proto.Categories, error) { + categories, err := s.budgetService.GetBudgetCategories( + ctx, + int(req.BudgetId), + ) + if err != nil { + return nil, err + } + res := make([]*proto.Category, 0, len(categories)) + for _, category := range categories { + res = append(res, mapCategory(category)) + } + return &proto.Categories{ + Categories: res, + }, nil } // AddWaste implements proto.SmmCoreServer. @@ -133,11 +161,6 @@ func (s *Server) GetBudgetUsers(context.Context, *proto.GetBudgetUsersReq) (*pro panic("unimplemented") } -// GetCategories implements proto.SmmCoreServer. -func (s *Server) GetCategories(context.Context, *proto.GetCategoriesReq) (*proto.Categories, error) { - panic("unimplemented") -} - // GetCategoriesStat implements proto.SmmCoreServer. func (s *Server) GetCategoriesStat(context.Context, *proto.GetCategoriesStatReq) (*proto.CategoriesStat, error) { panic("unimplemented") diff --git a/internal/services/budget/budget_service.go b/internal/services/budget/budget_service.go index 1645f17..77fcab5 100644 --- a/internal/services/budget/budget_service.go +++ b/internal/services/budget/budget_service.go @@ -4,6 +4,7 @@ import ( "context" "fmt" + "git.3crabs.ru/save_my_money/smm_core/internal/services/category" "git.3crabs.ru/save_my_money/smm_core/internal/services/context_utils" "github.com/jackc/pgx/v5" "github.com/jackc/pgx/v5/pgxpool" @@ -14,17 +15,21 @@ type BudgetEntity struct { Name string StartDay int MonthlyLimit int + Categories []*category.CategoryEntity } type BudgetService struct { - db *pgxpool.Pool + db *pgxpool.Pool + categoryService *category.CategoryService } func NewBudgetService( db *pgxpool.Pool, + categoryService *category.CategoryService, ) *BudgetService { return &BudgetService{ - db: db, + db: db, + categoryService: categoryService, } } @@ -55,6 +60,23 @@ func (s *BudgetService) AddBudget(ctx context.Context, budget *BudgetEntity) (*B return nil, err } + defaultCategories := []*category.CategoryEntity{ + { + Name: "Транспорт", + BudgetId: budget.Id, + }, + { + Name: "Продукты", + BudgetId: budget.Id, + }, + } + for _, category := range defaultCategories { + _, err = s.categoryService.AddCategory(ctx, category) + if err != nil { + return nil, err + } + } + if err = tx.Commit(ctx); err != nil { return nil, err } @@ -83,6 +105,7 @@ func (s *BudgetService) GetBudgets(ctx context.Context) ([]*BudgetEntity, error) if err != nil { return nil, err } + budget.Categories, err = s.GetBudgetCategories(ctx, budget.Id) budgets = append(budgets, budget) } @@ -105,3 +128,29 @@ func (s *BudgetService) AddUserToBudget( } return id, nil } + +func (s *BudgetService) GetBudgetCategories( + ctx context.Context, + budgetId int, +) ([]*category.CategoryEntity, error) { + query := `SELECT id, name, favorite, monthly_limit FROM categories WHERE budget_id = @budget_id` + args := pgx.NamedArgs{ + "budget_id": budgetId, + } + rows, err := s.db.Query(ctx, query, args) + if err != nil { + return nil, err + } + categories := []*category.CategoryEntity{} + defer rows.Close() + for rows.Next() { + category := &category.CategoryEntity{} + err = rows.Scan(&category.Id, &category.Name, &category.Favorite, &category.MonthlyLimit) + if err != nil { + return nil, err + } + categories = append(categories, category) + } + + return categories, nil +} diff --git a/internal/services/category/category_service.go b/internal/services/category/category_service.go index 71fe159..67a64fc 100644 --- a/internal/services/category/category_service.go +++ b/internal/services/category/category_service.go @@ -2,29 +2,20 @@ package category import ( "context" - "errors" "fmt" - "git.3crabs.ru/save_my_money/smm_core/internal/services/context_utils" "github.com/jackc/pgx/v5" - "github.com/jackc/pgx/v5/pgconn" "github.com/jackc/pgx/v5/pgxpool" ) type CategoryEntity struct { Id int Name string - UserId int + BudgetId int Favorite bool MonthlyLimit int } -type CategoryAlreadyExistsErr struct{} - -func (e *CategoryAlreadyExistsErr) Error() string { - return "category already exists error" -} - type CategoryService struct { db *pgxpool.Pool } @@ -38,24 +29,14 @@ func NewCategoryService( } func (s *CategoryService) AddCategory(ctx context.Context, category *CategoryEntity) (*CategoryEntity, error) { - userId, err := context_utils.GetUserId(ctx) - if err != nil { - return nil, err - } - query := `INSERT INTO categories (name, user_id, favorite, monthly_limit) VALUES (@name, @user_id, @favorite, @monthly_limit) RETURNING id` + query := `INSERT INTO categories (name, budget_id, favorite, monthly_limit) VALUES (@name, @budget_id, @favorite, @monthly_limit) RETURNING id` args := pgx.NamedArgs{ "name": category.Name, - "user_id": userId, + "budget_id": category.BudgetId, "favorite": category.Favorite, "monthly_limit": category.MonthlyLimit, } if err := s.db.QueryRow(ctx, query, args).Scan(&category.Id); err != nil { - var pgErr *pgconn.PgError - if errors.As(err, &pgErr) { - if pgErr.Code == "23505" && pgErr.ConstraintName == "categories_user_id_name_key" { // unique_violation - return nil, &CategoryAlreadyExistsErr{} - } - } return nil, fmt.Errorf("unable to insert row: %w", err) } return category, nil diff --git a/internal/services/requests.restbook b/internal/services/requests.restbook index 81eeabb..afaef27 100644 --- a/internal/services/requests.restbook +++ b/internal/services/requests.restbook @@ -1 +1 @@ -[{"kind":1,"language":"markdown","value":"# Добавление пользователя","outputs":[]},{"kind":2,"language":"rest-book","value":"POST http://localhost:8090/users\nauthorization: Y3JhYjpjcmFi\n\n{\n \"username\": \"foo\",\n \"password\": \"bar\"\n}","outputs":[{"mime":"x-application/rest-book","value":{"status":200,"statusText":"OK","headers":{"Date":"Sun, 24 Nov 2024 15:18:48 GMT","Content-Type":"application/json","Content-Length":"26"},"config":{"timeout":10000,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","headers":{"Accept":"application/json, text/plain, */*","Content-Type":"application/json","authorization":"Y3JhYjpjcmFi","User-Agent":"axios/0.21.4","Content-Length":36}},"request":{"method":"POST","httpVersion":"1.1","responseUrl":"http://localhost:8090/users","timeout":10000,"headers":{"authorization":"Y3JhYjpjcmFi"},"data":{"username":"foo2","password":"bar"}},"data":{"id":2,"username":"foo2"}}},{"mime":"text/x-json","value":{"status":200,"statusText":"OK","headers":{"Date":"Sun, 24 Nov 2024 15:18:48 GMT","Content-Type":"application/json","Content-Length":"26"},"config":{"timeout":10000,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","headers":{"Accept":"application/json, text/plain, */*","Content-Type":"application/json","authorization":"Y3JhYjpjcmFi","User-Agent":"axios/0.21.4","Content-Length":36}},"request":{"method":"POST","httpVersion":"1.1","responseUrl":"http://localhost:8090/users","timeout":10000,"headers":{"authorization":"Y3JhYjpjcmFi"},"data":{"username":"foo2","password":"bar"}},"data":{"id":2,"username":"foo2"}}},{"mime":"text/html","value":"[object Object]"}]},{"kind":1,"language":"markdown","value":"# Авторизация","outputs":[]},{"kind":2,"language":"rest-book","value":"POST http://localhost:8090/login\nauthorization: Y3JhYjpjcmFi\n\n{\n \"username\": \"foo\",\n \"password\": \"bar\"\n}","outputs":[{"mime":"x-application/rest-book","value":{"status":200,"statusText":"OK","headers":{"Date":"Sun, 24 Nov 2024 15:18:53 GMT","Content-Type":"application/json","Content-Length":"25"},"config":{"timeout":10000,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","headers":{"Accept":"application/json, text/plain, */*","Content-Type":"application/json","authorization":"Y3JhYjpjcmFi","User-Agent":"axios/0.21.4","Content-Length":35}},"request":{"method":"POST","httpVersion":"1.1","responseUrl":"http://localhost:8090/login","timeout":10000,"headers":{"authorization":"Y3JhYjpjcmFi"},"data":{"username":"foo","password":"bar"}},"data":{"id":1,"username":"foo"}}},{"mime":"text/x-json","value":{"status":200,"statusText":"OK","headers":{"Date":"Sun, 24 Nov 2024 15:18:53 GMT","Content-Type":"application/json","Content-Length":"25"},"config":{"timeout":10000,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","headers":{"Accept":"application/json, text/plain, */*","Content-Type":"application/json","authorization":"Y3JhYjpjcmFi","User-Agent":"axios/0.21.4","Content-Length":35}},"request":{"method":"POST","httpVersion":"1.1","responseUrl":"http://localhost:8090/login","timeout":10000,"headers":{"authorization":"Y3JhYjpjcmFi"},"data":{"username":"foo","password":"bar"}},"data":{"id":1,"username":"foo"}}},{"mime":"text/html","value":"[object Object]"}]},{"kind":1,"language":"markdown","value":"# Добавление бюджета","outputs":[]},{"kind":2,"language":"rest-book","value":"POST http://localhost:8090/budgets\nauthorization: Y3JhYjpjcmFi\nUser-Id: 1\n\n{\n \"name\": \"Семейный\"\n}","outputs":[{"mime":"x-application/rest-book","value":{"status":200,"statusText":"OK","headers":{"Date":"Sun, 24 Nov 2024 15:18:59 GMT","Content-Type":"application/json","Content-Length":"64"},"config":{"timeout":10000,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","headers":{"Accept":"application/json, text/plain, */*","Content-Type":"application/json","authorization":"Y3JhYjpjcmFi","User-Id":"1","User-Agent":"axios/0.21.4","Content-Length":27}},"request":{"method":"POST","httpVersion":"1.1","responseUrl":"http://localhost:8090/budgets","timeout":10000,"headers":{"authorization":"Y3JhYjpjcmFi","User-Id":"1"},"data":{"name":"Семейный"}},"data":{"id":1,"name":"Семейный","startDay":0,"monthlyLimit":0}}},{"mime":"text/x-json","value":{"status":200,"statusText":"OK","headers":{"Date":"Sun, 24 Nov 2024 15:18:59 GMT","Content-Type":"application/json","Content-Length":"64"},"config":{"timeout":10000,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","headers":{"Accept":"application/json, text/plain, */*","Content-Type":"application/json","authorization":"Y3JhYjpjcmFi","User-Id":"1","User-Agent":"axios/0.21.4","Content-Length":27}},"request":{"method":"POST","httpVersion":"1.1","responseUrl":"http://localhost:8090/budgets","timeout":10000,"headers":{"authorization":"Y3JhYjpjcmFi","User-Id":"1"},"data":{"name":"Семейный"}},"data":{"id":1,"name":"Семейный","startDay":0,"monthlyLimit":0}}},{"mime":"text/html","value":"[object Object]"}]},{"kind":1,"language":"markdown","value":"# Запрос бюджетов","outputs":[]},{"kind":2,"language":"rest-book","value":"GET http://localhost:8090/budgets\nauthorization: Y3JhYjpjcmFi\nUser-Id: 1","outputs":[{"mime":"x-application/rest-book","value":{"status":200,"statusText":"OK","headers":{"Date":"Sun, 24 Nov 2024 15:21:42 GMT","Content-Type":"application/json","Content-Length":"81"},"config":{"timeout":10000,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","headers":{"Accept":"application/json, text/plain, */*","authorization":"Y3JhYjpjcmFi","User-Id":"1","User-Agent":"axios/0.21.4"}},"request":{"method":"GET","httpVersion":"1.1","responseUrl":"http://localhost:8090/budgets","timeout":10000,"headers":{"authorization":"Y3JhYjpjcmFi","User-Id":"1"}},"data":{"budgets":[{"id":1,"name":"Семейный","startDay":0,"monthlyLimit":0}]}}},{"mime":"text/x-json","value":{"status":200,"statusText":"OK","headers":{"Date":"Sun, 24 Nov 2024 15:21:42 GMT","Content-Type":"application/json","Content-Length":"81"},"config":{"timeout":10000,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","headers":{"Accept":"application/json, text/plain, */*","authorization":"Y3JhYjpjcmFi","User-Id":"1","User-Agent":"axios/0.21.4"}},"request":{"method":"GET","httpVersion":"1.1","responseUrl":"http://localhost:8090/budgets","timeout":10000,"headers":{"authorization":"Y3JhYjpjcmFi","User-Id":"1"}},"data":{"budgets":[{"id":1,"name":"Семейный","startDay":0,"monthlyLimit":0}]}}},{"mime":"text/html","value":"[object Object]"}]},{"kind":1,"language":"markdown","value":"# Добавление пользователя в бюджет","outputs":[]},{"kind":2,"language":"rest-book","value":"PUT http://localhost:8090/budgets/1/users\nauthorization: Y3JhYjpjcmFi\nUser-Id: 1\n\n{\n \"user_id\": \"2\"\n}","outputs":[{"mime":"x-application/rest-book","value":{"status":200,"statusText":"OK","headers":{"Date":"Sun, 24 Nov 2024 15:21:36 GMT","Content-Type":"application/json","Content-Length":"2"},"config":{"timeout":10000,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","headers":{"Accept":"application/json, text/plain, */*","Content-Type":"application/json","authorization":"Y3JhYjpjcmFi","User-Id":"1","User-Agent":"axios/0.21.4","Content-Length":15}},"request":{"method":"PUT","httpVersion":"1.1","responseUrl":"http://localhost:8090/budgets/1/users","timeout":10000,"headers":{"authorization":"Y3JhYjpjcmFi","User-Id":"1"},"data":{"user_id":"2"}},"data":{}}},{"mime":"text/x-json","value":{"status":200,"statusText":"OK","headers":{"Date":"Sun, 24 Nov 2024 15:21:36 GMT","Content-Type":"application/json","Content-Length":"2"},"config":{"timeout":10000,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","headers":{"Accept":"application/json, text/plain, */*","Content-Type":"application/json","authorization":"Y3JhYjpjcmFi","User-Id":"1","User-Agent":"axios/0.21.4","Content-Length":15}},"request":{"method":"PUT","httpVersion":"1.1","responseUrl":"http://localhost:8090/budgets/1/users","timeout":10000,"headers":{"authorization":"Y3JhYjpjcmFi","User-Id":"1"},"data":{"user_id":"2"}},"data":{}}},{"mime":"text/html","value":"[object Object]"}]}] \ No newline at end of file +[{"kind":1,"language":"markdown","value":"# Добавление пользователя","outputs":[]},{"kind":2,"language":"rest-book","value":"POST http://localhost:8090/users\nauthorization: Y3JhYjpjcmFi\n\n{\n \"username\": \"foo\",\n \"password\": \"bar\"\n}","outputs":[{"mime":"x-application/rest-book","value":{"status":200,"statusText":"OK","headers":{"Date":"Mon, 25 Nov 2024 06:30:36 GMT","Content-Type":"application/json","Content-Length":"25"},"config":{"timeout":10000,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","headers":{"Accept":"application/json, text/plain, */*","Content-Type":"application/json","authorization":"Y3JhYjpjcmFi","User-Agent":"axios/0.21.4","Content-Length":35}},"request":{"method":"POST","httpVersion":"1.1","responseUrl":"http://localhost:8090/users","timeout":10000,"headers":{"authorization":"Y3JhYjpjcmFi"},"data":{"username":"foo","password":"bar"}},"data":{"id":1,"username":"foo"}}},{"mime":"text/x-json","value":{"status":200,"statusText":"OK","headers":{"Date":"Mon, 25 Nov 2024 06:30:36 GMT","Content-Type":"application/json","Content-Length":"25"},"config":{"timeout":10000,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","headers":{"Accept":"application/json, text/plain, */*","Content-Type":"application/json","authorization":"Y3JhYjpjcmFi","User-Agent":"axios/0.21.4","Content-Length":35}},"request":{"method":"POST","httpVersion":"1.1","responseUrl":"http://localhost:8090/users","timeout":10000,"headers":{"authorization":"Y3JhYjpjcmFi"},"data":{"username":"foo","password":"bar"}},"data":{"id":1,"username":"foo"}}},{"mime":"text/html","value":"[object Object]"}]},{"kind":1,"language":"markdown","value":"# Авторизация","outputs":[]},{"kind":2,"language":"rest-book","value":"POST http://localhost:8090/login\nauthorization: Y3JhYjpjcmFi\n\n{\n \"username\": \"foo\",\n \"password\": \"bar\"\n}","outputs":[{"mime":"x-application/rest-book","value":{"status":200,"statusText":"OK","headers":{"Date":"Sun, 24 Nov 2024 15:18:53 GMT","Content-Type":"application/json","Content-Length":"25"},"config":{"timeout":10000,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","headers":{"Accept":"application/json, text/plain, */*","Content-Type":"application/json","authorization":"Y3JhYjpjcmFi","User-Agent":"axios/0.21.4","Content-Length":35}},"request":{"method":"POST","httpVersion":"1.1","responseUrl":"http://localhost:8090/login","timeout":10000,"headers":{"authorization":"Y3JhYjpjcmFi"},"data":{"username":"foo","password":"bar"}},"data":{"id":1,"username":"foo"}}},{"mime":"text/x-json","value":{"status":200,"statusText":"OK","headers":{"Date":"Sun, 24 Nov 2024 15:18:53 GMT","Content-Type":"application/json","Content-Length":"25"},"config":{"timeout":10000,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","headers":{"Accept":"application/json, text/plain, */*","Content-Type":"application/json","authorization":"Y3JhYjpjcmFi","User-Agent":"axios/0.21.4","Content-Length":35}},"request":{"method":"POST","httpVersion":"1.1","responseUrl":"http://localhost:8090/login","timeout":10000,"headers":{"authorization":"Y3JhYjpjcmFi"},"data":{"username":"foo","password":"bar"}},"data":{"id":1,"username":"foo"}}},{"mime":"text/html","value":"[object Object]"}]},{"kind":1,"language":"markdown","value":"# Добавление бюджета","outputs":[]},{"kind":2,"language":"rest-book","value":"POST http://localhost:8090/budgets\nauthorization: Y3JhYjpjcmFi\nUser-Id: 1\n\n{\n \"name\": \"Семейный\"\n}","outputs":[{"mime":"x-application/rest-book","value":{"status":200,"statusText":"OK","headers":{"Date":"Mon, 25 Nov 2024 06:30:43 GMT","Content-Type":"application/json","Content-Length":"64"},"config":{"timeout":10000,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","headers":{"Accept":"application/json, text/plain, */*","Content-Type":"application/json","authorization":"Y3JhYjpjcmFi","User-Id":"1","User-Agent":"axios/0.21.4","Content-Length":27}},"request":{"method":"POST","httpVersion":"1.1","responseUrl":"http://localhost:8090/budgets","timeout":10000,"headers":{"authorization":"Y3JhYjpjcmFi","User-Id":"1"},"data":{"name":"Семейный"}},"data":{"id":1,"name":"Семейный","startDay":0,"monthlyLimit":0}}},{"mime":"text/x-json","value":{"status":200,"statusText":"OK","headers":{"Date":"Mon, 25 Nov 2024 06:30:43 GMT","Content-Type":"application/json","Content-Length":"64"},"config":{"timeout":10000,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","headers":{"Accept":"application/json, text/plain, */*","Content-Type":"application/json","authorization":"Y3JhYjpjcmFi","User-Id":"1","User-Agent":"axios/0.21.4","Content-Length":27}},"request":{"method":"POST","httpVersion":"1.1","responseUrl":"http://localhost:8090/budgets","timeout":10000,"headers":{"authorization":"Y3JhYjpjcmFi","User-Id":"1"},"data":{"name":"Семейный"}},"data":{"id":1,"name":"Семейный","startDay":0,"monthlyLimit":0}}},{"mime":"text/html","value":"[object Object]"}]},{"kind":1,"language":"markdown","value":"# Запрос бюджетов","outputs":[]},{"kind":2,"language":"rest-book","value":"GET http://localhost:8090/budgets\nauthorization: Y3JhYjpjcmFi\nUser-Id: 1","outputs":[{"mime":"x-application/rest-book","value":{"status":200,"statusText":"OK","headers":{"Date":"Mon, 25 Nov 2024 06:34:50 GMT","Content-Type":"application/json","Content-Length":"272"},"config":{"timeout":10000,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","headers":{"Accept":"application/json, text/plain, */*","authorization":"Y3JhYjpjcmFi","User-Id":"1","User-Agent":"axios/0.21.4"}},"request":{"method":"GET","httpVersion":"1.1","responseUrl":"http://localhost:8090/budgets","timeout":10000,"headers":{"authorization":"Y3JhYjpjcmFi","User-Id":"1"}},"data":{"budgets":[{"id":1,"name":"Семейный","startDay":0,"monthlyLimit":0,"categories":[{"id":1,"name":"Транспорт","budgetId":0,"favorite":false,"monthlyLimit":0},{"id":2,"name":"Продукты","budgetId":0,"favorite":false,"monthlyLimit":0}]}]}}},{"mime":"text/x-json","value":{"status":200,"statusText":"OK","headers":{"Date":"Mon, 25 Nov 2024 06:34:50 GMT","Content-Type":"application/json","Content-Length":"272"},"config":{"timeout":10000,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","headers":{"Accept":"application/json, text/plain, */*","authorization":"Y3JhYjpjcmFi","User-Id":"1","User-Agent":"axios/0.21.4"}},"request":{"method":"GET","httpVersion":"1.1","responseUrl":"http://localhost:8090/budgets","timeout":10000,"headers":{"authorization":"Y3JhYjpjcmFi","User-Id":"1"}},"data":{"budgets":[{"id":1,"name":"Семейный","startDay":0,"monthlyLimit":0,"categories":[{"id":1,"name":"Транспорт","budgetId":0,"favorite":false,"monthlyLimit":0},{"id":2,"name":"Продукты","budgetId":0,"favorite":false,"monthlyLimit":0}]}]}}},{"mime":"text/html","value":"[object Object]"}]},{"kind":1,"language":"markdown","value":"# Добавление пользователя в бюджет","outputs":[]},{"kind":2,"language":"rest-book","value":"PUT http://localhost:8090/budgets/1/users\nauthorization: Y3JhYjpjcmFi\nUser-Id: 1\n\n{\n \"user_id\": \"2\"\n}","outputs":[{"mime":"x-application/rest-book","value":{"status":200,"statusText":"OK","headers":{"Date":"Sun, 24 Nov 2024 15:21:36 GMT","Content-Type":"application/json","Content-Length":"2"},"config":{"timeout":10000,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","headers":{"Accept":"application/json, text/plain, */*","Content-Type":"application/json","authorization":"Y3JhYjpjcmFi","User-Id":"1","User-Agent":"axios/0.21.4","Content-Length":15}},"request":{"method":"PUT","httpVersion":"1.1","responseUrl":"http://localhost:8090/budgets/1/users","timeout":10000,"headers":{"authorization":"Y3JhYjpjcmFi","User-Id":"1"},"data":{"user_id":"2"}},"data":{}}},{"mime":"text/x-json","value":{"status":200,"statusText":"OK","headers":{"Date":"Sun, 24 Nov 2024 15:21:36 GMT","Content-Type":"application/json","Content-Length":"2"},"config":{"timeout":10000,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","headers":{"Accept":"application/json, text/plain, */*","Content-Type":"application/json","authorization":"Y3JhYjpjcmFi","User-Id":"1","User-Agent":"axios/0.21.4","Content-Length":15}},"request":{"method":"PUT","httpVersion":"1.1","responseUrl":"http://localhost:8090/budgets/1/users","timeout":10000,"headers":{"authorization":"Y3JhYjpjcmFi","User-Id":"1"},"data":{"user_id":"2"}},"data":{}}},{"mime":"text/html","value":"[object Object]"}]}] \ No newline at end of file diff --git a/proto/smm_core.pb.go b/proto/smm_core.pb.go index 6a2e508..24dc03a 100644 --- a/proto/smm_core.pb.go +++ b/proto/smm_core.pb.go @@ -355,10 +355,11 @@ type Budget struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - StartDay int32 `protobuf:"varint,3,opt,name=start_day,json=startDay,proto3" json:"start_day,omitempty"` - MonthlyLimit int32 `protobuf:"varint,4,opt,name=monthly_limit,json=monthlyLimit,proto3" json:"monthly_limit,omitempty"` + Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + StartDay int32 `protobuf:"varint,3,opt,name=start_day,json=startDay,proto3" json:"start_day,omitempty"` + MonthlyLimit int32 `protobuf:"varint,4,opt,name=monthly_limit,json=monthlyLimit,proto3" json:"monthly_limit,omitempty"` + Categories []*Category `protobuf:"bytes,5,rep,name=categories,proto3" json:"categories,omitempty"` } func (x *Budget) Reset() { @@ -419,6 +420,13 @@ func (x *Budget) GetMonthlyLimit() int32 { return 0 } +func (x *Budget) GetCategories() []*Category { + if x != nil { + return x.Categories + } + return nil +} + type UpdateBudgetReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -810,6 +818,51 @@ func (x *RemoveUserFromBudgetReq) GetBudgetId() int32 { return 0 } +type GetBudgetCategoriesReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + BudgetId int32 `protobuf:"varint,2,opt,name=budget_id,json=budgetId,proto3" json:"budget_id,omitempty"` +} + +func (x *GetBudgetCategoriesReq) Reset() { + *x = GetBudgetCategoriesReq{} + mi := &file_smm_core_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetBudgetCategoriesReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetBudgetCategoriesReq) ProtoMessage() {} + +func (x *GetBudgetCategoriesReq) ProtoReflect() protoreflect.Message { + mi := &file_smm_core_proto_msgTypes[16] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetBudgetCategoriesReq.ProtoReflect.Descriptor instead. +func (*GetBudgetCategoriesReq) Descriptor() ([]byte, []int) { + return file_smm_core_proto_rawDescGZIP(), []int{16} +} + +func (x *GetBudgetCategoriesReq) GetBudgetId() int32 { + if x != nil { + return x.BudgetId + } + return 0 +} + type AddCategoryReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -823,7 +876,7 @@ type AddCategoryReq struct { func (x *AddCategoryReq) Reset() { *x = AddCategoryReq{} - mi := &file_smm_core_proto_msgTypes[16] + mi := &file_smm_core_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -835,7 +888,7 @@ func (x *AddCategoryReq) String() string { func (*AddCategoryReq) ProtoMessage() {} func (x *AddCategoryReq) ProtoReflect() protoreflect.Message { - mi := &file_smm_core_proto_msgTypes[16] + mi := &file_smm_core_proto_msgTypes[17] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -848,7 +901,7 @@ func (x *AddCategoryReq) ProtoReflect() protoreflect.Message { // Deprecated: Use AddCategoryReq.ProtoReflect.Descriptor instead. func (*AddCategoryReq) Descriptor() ([]byte, []int) { - return file_smm_core_proto_rawDescGZIP(), []int{16} + return file_smm_core_proto_rawDescGZIP(), []int{17} } func (x *AddCategoryReq) GetName() string { @@ -893,7 +946,7 @@ type Category struct { func (x *Category) Reset() { *x = Category{} - mi := &file_smm_core_proto_msgTypes[17] + mi := &file_smm_core_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -905,7 +958,7 @@ func (x *Category) String() string { func (*Category) ProtoMessage() {} func (x *Category) ProtoReflect() protoreflect.Message { - mi := &file_smm_core_proto_msgTypes[17] + mi := &file_smm_core_proto_msgTypes[18] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -918,7 +971,7 @@ func (x *Category) ProtoReflect() protoreflect.Message { // Deprecated: Use Category.ProtoReflect.Descriptor instead. func (*Category) Descriptor() ([]byte, []int) { - return file_smm_core_proto_rawDescGZIP(), []int{17} + return file_smm_core_proto_rawDescGZIP(), []int{18} } func (x *Category) GetId() int32 { @@ -969,7 +1022,7 @@ type UpdateCategoryReq struct { func (x *UpdateCategoryReq) Reset() { *x = UpdateCategoryReq{} - mi := &file_smm_core_proto_msgTypes[18] + mi := &file_smm_core_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -981,7 +1034,7 @@ func (x *UpdateCategoryReq) String() string { func (*UpdateCategoryReq) ProtoMessage() {} func (x *UpdateCategoryReq) ProtoReflect() protoreflect.Message { - mi := &file_smm_core_proto_msgTypes[18] + mi := &file_smm_core_proto_msgTypes[19] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -994,7 +1047,7 @@ func (x *UpdateCategoryReq) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateCategoryReq.ProtoReflect.Descriptor instead. func (*UpdateCategoryReq) Descriptor() ([]byte, []int) { - return file_smm_core_proto_rawDescGZIP(), []int{18} + return file_smm_core_proto_rawDescGZIP(), []int{19} } func (x *UpdateCategoryReq) GetId() int32 { @@ -1025,59 +1078,6 @@ func (x *UpdateCategoryReq) GetMonthlyLimit() int32 { return 0 } -type GetCategoriesReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Favorite bool `protobuf:"varint,1,opt,name=favorite,proto3" json:"favorite,omitempty"` - BudgetId int32 `protobuf:"varint,2,opt,name=budget_id,json=budgetId,proto3" json:"budget_id,omitempty"` -} - -func (x *GetCategoriesReq) Reset() { - *x = GetCategoriesReq{} - mi := &file_smm_core_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetCategoriesReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetCategoriesReq) ProtoMessage() {} - -func (x *GetCategoriesReq) ProtoReflect() protoreflect.Message { - mi := &file_smm_core_proto_msgTypes[19] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetCategoriesReq.ProtoReflect.Descriptor instead. -func (*GetCategoriesReq) Descriptor() ([]byte, []int) { - return file_smm_core_proto_rawDescGZIP(), []int{19} -} - -func (x *GetCategoriesReq) GetFavorite() bool { - if x != nil { - return x.Favorite - } - return false -} - -func (x *GetCategoriesReq) GetBudgetId() int32 { - if x != nil { - return x.BudgetId - } - return 0 -} - type Categories struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1531,214 +1531,219 @@ var file_smm_core_proto_rawDesc = []byte{ 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x64, 0x61, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x73, 0x74, 0x61, 0x72, 0x74, 0x44, 0x61, 0x79, 0x12, 0x23, 0x0a, 0x0d, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x6c, 0x79, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x0c, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x6c, 0x79, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x6e, - 0x0a, 0x06, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 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, 0x1b, 0x0a, 0x09, - 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x64, 0x61, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x08, 0x73, 0x74, 0x61, 0x72, 0x74, 0x44, 0x61, 0x79, 0x12, 0x23, 0x0a, 0x0d, 0x6d, 0x6f, 0x6e, - 0x74, 0x68, 0x6c, 0x79, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x0c, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x6c, 0x79, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x77, - 0x0a, 0x0f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x52, 0x65, - 0x71, 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, 0x1b, 0x0a, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x64, - 0x61, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x73, 0x74, 0x61, 0x72, 0x74, 0x44, - 0x61, 0x79, 0x12, 0x23, 0x0a, 0x0d, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x6c, 0x79, 0x5f, 0x6c, 0x69, - 0x6d, 0x69, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x6d, 0x6f, 0x6e, 0x74, 0x68, - 0x6c, 0x79, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x0f, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x42, 0x75, - 0x64, 0x67, 0x65, 0x74, 0x73, 0x52, 0x65, 0x71, 0x22, 0x3b, 0x0a, 0x07, 0x42, 0x75, 0x64, 0x67, - 0x65, 0x74, 0x73, 0x12, 0x30, 0x0a, 0x07, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, - 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x52, 0x07, 0x62, 0x75, - 0x64, 0x67, 0x65, 0x74, 0x73, 0x22, 0x21, 0x0a, 0x0f, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, - 0x75, 0x64, 0x67, 0x65, 0x74, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, 0x4a, 0x0a, 0x12, 0x41, 0x64, 0x64, 0x55, - 0x73, 0x65, 0x72, 0x54, 0x6f, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x52, 0x65, 0x71, 0x12, 0x17, - 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x62, 0x75, 0x64, 0x67, 0x65, - 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x62, 0x75, 0x64, 0x67, - 0x65, 0x74, 0x49, 0x64, 0x22, 0x23, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x42, 0x75, 0x64, 0x67, 0x65, - 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, 0x33, 0x0a, 0x05, 0x55, 0x73, 0x65, - 0x72, 0x73, 0x12, 0x2a, 0x0a, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x14, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, - 0x72, 0x65, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x22, 0x4f, - 0x0a, 0x17, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x55, 0x73, 0x65, 0x72, 0x46, 0x72, 0x6f, 0x6d, + 0x52, 0x0c, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x6c, 0x79, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0xa8, + 0x01, 0x0a, 0x06, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 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, 0x1b, 0x0a, + 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x64, 0x61, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x08, 0x73, 0x74, 0x61, 0x72, 0x74, 0x44, 0x61, 0x79, 0x12, 0x23, 0x0a, 0x0d, 0x6d, 0x6f, + 0x6e, 0x74, 0x68, 0x6c, 0x79, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x0c, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x6c, 0x79, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, + 0x38, 0x0a, 0x0a, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x18, 0x05, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, + 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x0a, 0x63, + 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x22, 0x77, 0x0a, 0x0f, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x52, 0x65, 0x71, 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, 0x1b, 0x0a, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x64, 0x61, 0x79, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x08, 0x73, 0x74, 0x61, 0x72, 0x74, 0x44, 0x61, 0x79, 0x12, 0x23, 0x0a, + 0x0d, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x6c, 0x79, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x6c, 0x79, 0x4c, 0x69, 0x6d, + 0x69, 0x74, 0x22, 0x0f, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x73, + 0x52, 0x65, 0x71, 0x22, 0x3b, 0x0a, 0x07, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x73, 0x12, 0x30, + 0x0a, 0x07, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x16, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, + 0x2e, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x52, 0x07, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, 0x73, + 0x22, 0x21, 0x0a, 0x0f, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, + 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x02, 0x69, 0x64, 0x22, 0x4a, 0x0a, 0x12, 0x41, 0x64, 0x64, 0x55, 0x73, 0x65, 0x72, 0x54, 0x6f, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, 0x49, 0x64, 0x22, - 0x82, 0x01, 0x0a, 0x0e, 0x41, 0x64, 0x64, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, - 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, - 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x62, 0x75, 0x64, 0x67, 0x65, - 0x74, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x66, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x12, - 0x23, 0x0a, 0x0d, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x6c, 0x79, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x6c, 0x79, 0x4c, - 0x69, 0x6d, 0x69, 0x74, 0x22, 0x8c, 0x01, 0x0a, 0x08, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, - 0x79, 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, 0x1b, 0x0a, 0x09, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, 0x5f, - 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, - 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x66, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x12, 0x23, - 0x0a, 0x0d, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x6c, 0x79, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x6c, 0x79, 0x4c, 0x69, - 0x6d, 0x69, 0x74, 0x22, 0x78, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x61, 0x74, - 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 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, 0x1a, 0x0a, 0x08, - 0x66, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, - 0x66, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x6d, 0x6f, 0x6e, 0x74, - 0x68, 0x6c, 0x79, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x0c, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x6c, 0x79, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x4b, 0x0a, - 0x10, 0x47, 0x65, 0x74, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, - 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x08, 0x66, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x12, 0x1b, 0x0a, - 0x09, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x08, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, 0x49, 0x64, 0x22, 0x46, 0x0a, 0x0a, 0x43, 0x61, - 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x12, 0x38, 0x0a, 0x0a, 0x63, 0x61, 0x74, 0x65, - 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x63, - 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x61, - 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x0a, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, - 0x65, 0x73, 0x22, 0x25, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x61, 0x74, 0x65, - 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, 0x70, 0x0a, 0x0b, 0x41, 0x64, 0x64, - 0x57, 0x61, 0x73, 0x74, 0x65, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, - 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x70, 0x72, 0x69, - 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x02, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, - 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x0a, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x49, 0x64, 0x22, 0x59, 0x0a, 0x05, 0x57, - 0x61, 0x73, 0x74, 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, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x69, 0x63, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x12, 0x16, - 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x02, 0x52, 0x06, - 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x20, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x57, 0x61, 0x73, 0x74, 0x65, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, 0x28, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x43, - 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x53, 0x74, 0x61, 0x74, 0x52, 0x65, 0x71, - 0x12, 0x10, 0x0a, 0x03, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x05, 0x52, 0x03, 0x69, - 0x64, 0x73, 0x22, 0x44, 0x0a, 0x0e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, - 0x53, 0x74, 0x61, 0x74, 0x12, 0x32, 0x0a, 0x04, 0x73, 0x74, 0x61, 0x74, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, - 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x53, 0x74, - 0x61, 0x74, 0x52, 0x04, 0x73, 0x74, 0x61, 0x74, 0x22, 0x5f, 0x0a, 0x0c, 0x43, 0x61, 0x74, 0x65, - 0x67, 0x6f, 0x72, 0x79, 0x53, 0x74, 0x61, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x0d, - 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x6c, 0x79, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x0c, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x6c, 0x79, 0x4c, 0x69, 0x6d, 0x69, - 0x74, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x32, 0xf9, 0x0c, 0x0a, 0x07, 0x53, 0x6d, - 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x12, 0x47, 0x0a, 0x04, 0x50, 0x69, 0x6e, 0x67, 0x12, 0x17, 0x2e, - 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x50, - 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, - 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x73, 0x70, 0x22, - 0x0d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x07, 0x12, 0x05, 0x2f, 0x70, 0x69, 0x6e, 0x67, 0x12, 0x4e, - 0x0a, 0x07, 0x41, 0x64, 0x64, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1a, 0x2e, 0x63, 0x72, 0x61, 0x62, - 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x41, 0x64, 0x64, 0x55, 0x73, - 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, - 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x22, 0x11, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x0b, 0x3a, 0x01, 0x2a, 0x22, 0x06, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x12, 0x4a, - 0x0a, 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x18, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, - 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, - 0x71, 0x1a, 0x14, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, - 0x72, 0x65, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x22, 0x11, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0b, 0x3a, - 0x01, 0x2a, 0x22, 0x06, 0x2f, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x56, 0x0a, 0x09, 0x41, 0x64, - 0x64, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x12, 0x1c, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, - 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x41, 0x64, 0x64, 0x42, 0x75, 0x64, 0x67, - 0x65, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, - 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x22, 0x13, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x0d, 0x3a, 0x01, 0x2a, 0x22, 0x08, 0x2f, 0x62, 0x75, 0x64, 0x67, 0x65, - 0x74, 0x73, 0x12, 0x61, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x75, 0x64, 0x67, - 0x65, 0x74, 0x12, 0x1f, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, - 0x6f, 0x72, 0x65, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, - 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, - 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x22, 0x18, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x12, 0x3a, 0x01, 0x2a, 0x1a, 0x0d, 0x2f, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, 0x73, - 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x56, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x42, 0x75, 0x64, 0x67, - 0x65, 0x74, 0x73, 0x12, 0x1d, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, - 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x73, 0x52, - 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, - 0x6f, 0x72, 0x65, 0x2e, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x73, 0x22, 0x10, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x0a, 0x12, 0x08, 0x2f, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, 0x73, 0x12, 0x5e, 0x0a, - 0x0c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x12, 0x1f, 0x2e, - 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x44, - 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x16, - 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, - 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x22, 0x15, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0f, 0x2a, 0x0d, - 0x2f, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x70, 0x0a, - 0x0f, 0x41, 0x64, 0x64, 0x55, 0x73, 0x65, 0x72, 0x54, 0x6f, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, - 0x12, 0x22, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, - 0x65, 0x2e, 0x41, 0x64, 0x64, 0x55, 0x73, 0x65, 0x72, 0x54, 0x6f, 0x42, 0x75, 0x64, 0x67, 0x65, - 0x74, 0x52, 0x65, 0x71, 0x1a, 0x12, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, - 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x4f, 0x4b, 0x22, 0x25, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, - 0x3a, 0x01, 0x2a, 0x1a, 0x1a, 0x2f, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, 0x73, 0x2f, 0x7b, 0x62, - 0x75, 0x64, 0x67, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x12, - 0x67, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, - 0x73, 0x12, 0x21, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, - 0x72, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, - 0x73, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, - 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x73, 0x22, 0x1b, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x15, 0x12, 0x13, 0x2f, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, 0x73, 0x2f, 0x7b, 0x69, - 0x64, 0x7d, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x12, 0x85, 0x01, 0x0a, 0x14, 0x52, 0x65, 0x6d, + 0x23, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, + 0x73, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x02, 0x69, 0x64, 0x22, 0x33, 0x0a, 0x05, 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, 0x2a, 0x0a, + 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x63, + 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x55, 0x73, + 0x65, 0x72, 0x52, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x22, 0x4f, 0x0a, 0x17, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x55, 0x73, 0x65, 0x72, 0x46, 0x72, 0x6f, 0x6d, 0x42, 0x75, 0x64, 0x67, 0x65, - 0x74, 0x12, 0x27, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, - 0x72, 0x65, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x55, 0x73, 0x65, 0x72, 0x46, 0x72, 0x6f, - 0x6d, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x63, 0x72, 0x61, - 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x42, 0x75, 0x64, 0x67, - 0x65, 0x74, 0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x2a, 0x24, 0x2f, 0x62, 0x75, 0x64, - 0x67, 0x65, 0x74, 0x73, 0x2f, 0x7b, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x7d, - 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x7d, - 0x12, 0x5f, 0x0a, 0x0b, 0x41, 0x64, 0x64, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, - 0x1e, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, - 0x2e, 0x41, 0x64, 0x64, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x1a, - 0x18, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, - 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x22, 0x16, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x10, 0x3a, 0x01, 0x2a, 0x22, 0x0b, 0x2f, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, - 0x73, 0x12, 0x67, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x61, 0x74, 0x65, 0x67, - 0x6f, 0x72, 0x79, 0x12, 0x21, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, - 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x61, 0x74, 0x65, 0x67, - 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x18, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, - 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, - 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x12, 0x1a, 0x10, 0x2f, 0x63, 0x61, 0x74, 0x65, 0x67, - 0x6f, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x62, 0x0a, 0x0d, 0x47, 0x65, - 0x74, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x12, 0x20, 0x2e, 0x63, 0x72, - 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x47, 0x65, 0x74, - 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, - 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x43, - 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x22, 0x13, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x0d, 0x12, 0x0b, 0x2f, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x12, 0x6b, - 0x0a, 0x10, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, - 0x65, 0x73, 0x12, 0x23, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, - 0x6f, 0x72, 0x65, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, - 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x18, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, + 0x74, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1b, 0x0a, + 0x09, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x08, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, 0x49, 0x64, 0x22, 0x35, 0x0a, 0x16, 0x47, 0x65, + 0x74, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, + 0x73, 0x52, 0x65, 0x71, 0x12, 0x1b, 0x0a, 0x09, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, 0x5f, 0x69, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, 0x49, + 0x64, 0x22, 0x82, 0x01, 0x0a, 0x0e, 0x41, 0x64, 0x64, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, + 0x79, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x62, 0x75, 0x64, 0x67, + 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x62, 0x75, 0x64, + 0x67, 0x65, 0x74, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x66, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, + 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x6c, 0x79, 0x5f, 0x6c, 0x69, 0x6d, + 0x69, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x6c, + 0x79, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x8c, 0x01, 0x0a, 0x08, 0x43, 0x61, 0x74, 0x65, 0x67, + 0x6f, 0x72, 0x79, 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, 0x1b, 0x0a, 0x09, 0x62, 0x75, 0x64, 0x67, 0x65, + 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x62, 0x75, 0x64, 0x67, + 0x65, 0x74, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x66, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, + 0x12, 0x23, 0x0a, 0x0d, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x6c, 0x79, 0x5f, 0x6c, 0x69, 0x6d, 0x69, + 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x6c, 0x79, + 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x78, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, + 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 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, 0x1a, + 0x0a, 0x08, 0x66, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x08, 0x66, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x6d, 0x6f, + 0x6e, 0x74, 0x68, 0x6c, 0x79, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x0c, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x6c, 0x79, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x22, + 0x46, 0x0a, 0x0a, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x12, 0x38, 0x0a, + 0x0a, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x18, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, + 0x72, 0x65, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x0a, 0x63, 0x61, 0x74, + 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x22, 0x25, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x12, 0x0e, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, 0x70, + 0x0a, 0x0b, 0x41, 0x64, 0x64, 0x57, 0x61, 0x73, 0x74, 0x65, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, + 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, + 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x49, 0x64, + 0x22, 0x59, 0x0a, 0x05, 0x57, 0x61, 0x73, 0x74, 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, 0x14, 0x0a, + 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x70, 0x72, + 0x69, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x02, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x20, 0x0a, 0x0e, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x57, 0x61, 0x73, 0x74, 0x65, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, + 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, 0x28, 0x0a, + 0x14, 0x47, 0x65, 0x74, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x53, 0x74, + 0x61, 0x74, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x05, 0x52, 0x03, 0x69, 0x64, 0x73, 0x22, 0x44, 0x0a, 0x0e, 0x43, 0x61, 0x74, 0x65, 0x67, + 0x6f, 0x72, 0x69, 0x65, 0x73, 0x53, 0x74, 0x61, 0x74, 0x12, 0x32, 0x0a, 0x04, 0x73, 0x74, 0x61, + 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, - 0x79, 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x12, 0x2a, 0x10, 0x2f, 0x63, 0x61, 0x74, 0x65, - 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x52, 0x0a, 0x08, 0x41, - 0x64, 0x64, 0x57, 0x61, 0x73, 0x74, 0x65, 0x12, 0x1b, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, - 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x41, 0x64, 0x64, 0x57, 0x61, 0x73, 0x74, + 0x69, 0x65, 0x73, 0x53, 0x74, 0x61, 0x74, 0x52, 0x04, 0x73, 0x74, 0x61, 0x74, 0x22, 0x5f, 0x0a, + 0x0c, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x53, 0x74, 0x61, 0x74, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x6c, 0x79, 0x5f, 0x6c, 0x69, 0x6d, + 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x6c, + 0x79, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x32, 0x9a, + 0x0d, 0x0a, 0x07, 0x53, 0x6d, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x12, 0x47, 0x0a, 0x04, 0x50, 0x69, + 0x6e, 0x67, 0x12, 0x17, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, + 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x63, 0x72, + 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x69, 0x6e, + 0x67, 0x52, 0x73, 0x70, 0x22, 0x0d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x07, 0x12, 0x05, 0x2f, 0x70, + 0x69, 0x6e, 0x67, 0x12, 0x4e, 0x0a, 0x07, 0x41, 0x64, 0x64, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1a, + 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, + 0x41, 0x64, 0x64, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x63, 0x72, 0x61, + 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x55, 0x73, 0x65, 0x72, + 0x22, 0x11, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0b, 0x3a, 0x01, 0x2a, 0x22, 0x06, 0x2f, 0x75, 0x73, + 0x65, 0x72, 0x73, 0x12, 0x4a, 0x0a, 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x18, 0x2e, 0x63, + 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x4c, 0x6f, + 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, + 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x22, 0x11, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x0b, 0x3a, 0x01, 0x2a, 0x22, 0x06, 0x2f, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x12, + 0x56, 0x0a, 0x09, 0x41, 0x64, 0x64, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x12, 0x1c, 0x2e, 0x63, + 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x41, 0x64, + 0x64, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x63, 0x72, 0x61, + 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x42, 0x75, 0x64, 0x67, + 0x65, 0x74, 0x22, 0x13, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0d, 0x3a, 0x01, 0x2a, 0x22, 0x08, 0x2f, + 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, 0x73, 0x12, 0x61, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x12, 0x1f, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, + 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, + 0x75, 0x64, 0x67, 0x65, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, + 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, + 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x12, 0x3a, 0x01, 0x2a, 0x1a, 0x0d, 0x2f, 0x62, 0x75, + 0x64, 0x67, 0x65, 0x74, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x56, 0x0a, 0x0a, 0x47, 0x65, + 0x74, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x73, 0x12, 0x1d, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, + 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x75, 0x64, + 0x67, 0x65, 0x74, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, + 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x73, + 0x22, 0x10, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0a, 0x12, 0x08, 0x2f, 0x62, 0x75, 0x64, 0x67, 0x65, + 0x74, 0x73, 0x12, 0x5e, 0x0a, 0x0c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x75, 0x64, 0x67, + 0x65, 0x74, 0x12, 0x1f, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, + 0x6f, 0x72, 0x65, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, + 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, + 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x22, 0x15, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x0f, 0x2a, 0x0d, 0x2f, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, 0x73, 0x2f, 0x7b, 0x69, + 0x64, 0x7d, 0x12, 0x70, 0x0a, 0x0f, 0x41, 0x64, 0x64, 0x55, 0x73, 0x65, 0x72, 0x54, 0x6f, 0x42, + 0x75, 0x64, 0x67, 0x65, 0x74, 0x12, 0x22, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, + 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x41, 0x64, 0x64, 0x55, 0x73, 0x65, 0x72, 0x54, 0x6f, + 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x12, 0x2e, 0x63, 0x72, 0x61, 0x62, + 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x4f, 0x4b, 0x22, 0x25, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x3a, 0x01, 0x2a, 0x1a, 0x1a, 0x2f, 0x62, 0x75, 0x64, 0x67, 0x65, + 0x74, 0x73, 0x2f, 0x7b, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x75, + 0x73, 0x65, 0x72, 0x73, 0x12, 0x67, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x42, 0x75, 0x64, 0x67, 0x65, + 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, 0x21, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, + 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x75, 0x64, 0x67, 0x65, + 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x63, 0x72, 0x61, 0x62, + 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x73, + 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x12, 0x13, 0x2f, 0x62, 0x75, 0x64, 0x67, 0x65, + 0x74, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x12, 0x85, 0x01, + 0x0a, 0x14, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x55, 0x73, 0x65, 0x72, 0x46, 0x72, 0x6f, 0x6d, + 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x12, 0x27, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, + 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x55, 0x73, + 0x65, 0x72, 0x46, 0x72, 0x6f, 0x6d, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x52, 0x65, 0x71, 0x1a, + 0x16, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, + 0x2e, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x2a, + 0x24, 0x2f, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, 0x73, 0x2f, 0x7b, 0x62, 0x75, 0x64, 0x67, 0x65, + 0x74, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x75, 0x73, 0x65, + 0x72, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x82, 0x01, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x42, 0x75, 0x64, + 0x67, 0x65, 0x74, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x12, 0x26, 0x2e, + 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x47, + 0x65, 0x74, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, + 0x65, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, + 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, + 0x73, 0x22, 0x27, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x12, 0x1f, 0x2f, 0x62, 0x75, 0x64, 0x67, + 0x65, 0x74, 0x73, 0x2f, 0x7b, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x7d, 0x2f, + 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x12, 0x5f, 0x0a, 0x0b, 0x41, 0x64, + 0x64, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x1e, 0x2e, 0x63, 0x72, 0x61, 0x62, + 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x41, 0x64, 0x64, 0x43, 0x61, + 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x18, 0x2e, 0x63, 0x72, 0x61, 0x62, + 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, + 0x6f, 0x72, 0x79, 0x22, 0x16, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x10, 0x3a, 0x01, 0x2a, 0x22, 0x0b, + 0x2f, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x12, 0x67, 0x0a, 0x0e, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x21, 0x2e, + 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, + 0x1a, 0x18, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, + 0x65, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x12, 0x1a, 0x10, 0x2f, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x2f, + 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x6b, 0x0a, 0x10, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x61, + 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x12, 0x23, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, + 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x18, 0x2e, + 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x43, + 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x12, 0x2a, + 0x10, 0x2f, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x7b, 0x69, 0x64, + 0x7d, 0x12, 0x52, 0x0a, 0x08, 0x41, 0x64, 0x64, 0x57, 0x61, 0x73, 0x74, 0x65, 0x12, 0x1b, 0x2e, + 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x41, + 0x64, 0x64, 0x57, 0x61, 0x73, 0x74, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x63, 0x72, 0x61, + 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x57, 0x61, 0x73, 0x74, + 0x65, 0x22, 0x12, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0c, 0x3a, 0x01, 0x2a, 0x22, 0x07, 0x2f, 0x77, + 0x61, 0x73, 0x74, 0x65, 0x73, 0x12, 0x5a, 0x0a, 0x0b, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x57, + 0x61, 0x73, 0x74, 0x65, 0x12, 0x1e, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, + 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x57, 0x61, 0x73, 0x74, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, - 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x57, 0x61, 0x73, 0x74, 0x65, 0x22, 0x12, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x0c, 0x3a, 0x01, 0x2a, 0x22, 0x07, 0x2f, 0x77, 0x61, 0x73, 0x74, 0x65, 0x73, 0x12, - 0x5a, 0x0a, 0x0b, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x57, 0x61, 0x73, 0x74, 0x65, 0x12, 0x1e, - 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, - 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x57, 0x61, 0x73, 0x74, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x15, - 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, - 0x57, 0x61, 0x73, 0x74, 0x65, 0x22, 0x14, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0e, 0x2a, 0x0c, 0x2f, - 0x77, 0x61, 0x73, 0x74, 0x65, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x68, 0x0a, 0x11, 0x47, - 0x65, 0x74, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x53, 0x74, 0x61, 0x74, - 0x12, 0x24, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, - 0x65, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x53, - 0x74, 0x61, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1e, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, - 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, - 0x65, 0x73, 0x53, 0x74, 0x61, 0x74, 0x22, 0x0d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x07, 0x12, 0x05, - 0x2f, 0x73, 0x74, 0x61, 0x74, 0x42, 0x0e, 0x92, 0x41, 0x00, 0x5a, 0x09, 0x70, 0x6b, 0x67, 0x2f, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x57, 0x61, 0x73, 0x74, 0x65, 0x22, 0x14, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x0e, 0x2a, 0x0c, 0x2f, 0x77, 0x61, 0x73, 0x74, 0x65, 0x73, 0x2f, 0x7b, 0x69, 0x64, + 0x7d, 0x12, 0x68, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, + 0x65, 0x73, 0x53, 0x74, 0x61, 0x74, 0x12, 0x24, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, + 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x61, 0x74, 0x65, 0x67, + 0x6f, 0x72, 0x69, 0x65, 0x73, 0x53, 0x74, 0x61, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1e, 0x2e, 0x63, + 0x72, 0x61, 0x62, 0x73, 0x2e, 0x73, 0x6d, 0x6d, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x61, + 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x53, 0x74, 0x61, 0x74, 0x22, 0x0d, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x07, 0x12, 0x05, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x42, 0x0e, 0x92, 0x41, 0x00, + 0x5a, 0x09, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( @@ -1771,10 +1776,10 @@ var file_smm_core_proto_goTypes = []any{ (*GetBudgetUsersReq)(nil), // 13: crabs.smm_core.GetBudgetUsersReq (*Users)(nil), // 14: crabs.smm_core.Users (*RemoveUserFromBudgetReq)(nil), // 15: crabs.smm_core.RemoveUserFromBudgetReq - (*AddCategoryReq)(nil), // 16: crabs.smm_core.AddCategoryReq - (*Category)(nil), // 17: crabs.smm_core.Category - (*UpdateCategoryReq)(nil), // 18: crabs.smm_core.UpdateCategoryReq - (*GetCategoriesReq)(nil), // 19: crabs.smm_core.GetCategoriesReq + (*GetBudgetCategoriesReq)(nil), // 16: crabs.smm_core.GetBudgetCategoriesReq + (*AddCategoryReq)(nil), // 17: crabs.smm_core.AddCategoryReq + (*Category)(nil), // 18: crabs.smm_core.Category + (*UpdateCategoryReq)(nil), // 19: crabs.smm_core.UpdateCategoryReq (*Categories)(nil), // 20: crabs.smm_core.Categories (*DeleteCategoriesReq)(nil), // 21: crabs.smm_core.DeleteCategoriesReq (*AddWasteReq)(nil), // 22: crabs.smm_core.AddWasteReq @@ -1785,49 +1790,50 @@ var file_smm_core_proto_goTypes = []any{ (*CategoryStat)(nil), // 27: crabs.smm_core.CategoryStat } var file_smm_core_proto_depIdxs = []int32{ - 7, // 0: crabs.smm_core.Budgets.budgets:type_name -> crabs.smm_core.Budget - 4, // 1: crabs.smm_core.Users.users:type_name -> crabs.smm_core.User - 17, // 2: crabs.smm_core.Categories.categories:type_name -> crabs.smm_core.Category - 26, // 3: crabs.smm_core.CategoriesStat.stat:type_name -> crabs.smm_core.CategoriesStat - 0, // 4: crabs.smm_core.SmmCore.Ping:input_type -> crabs.smm_core.PingReq - 3, // 5: crabs.smm_core.SmmCore.AddUser:input_type -> crabs.smm_core.AddUserReq - 5, // 6: crabs.smm_core.SmmCore.Login:input_type -> crabs.smm_core.LoginReq - 6, // 7: crabs.smm_core.SmmCore.AddBudget:input_type -> crabs.smm_core.AddBudgetReq - 8, // 8: crabs.smm_core.SmmCore.UpdateBudget:input_type -> crabs.smm_core.UpdateBudgetReq - 9, // 9: crabs.smm_core.SmmCore.GetBudgets:input_type -> crabs.smm_core.GetBudgetsReq - 11, // 10: crabs.smm_core.SmmCore.DeleteBudget:input_type -> crabs.smm_core.DeleteBudgetReq - 12, // 11: crabs.smm_core.SmmCore.AddUserToBudget:input_type -> crabs.smm_core.AddUserToBudgetReq - 13, // 12: crabs.smm_core.SmmCore.GetBudgetUsers:input_type -> crabs.smm_core.GetBudgetUsersReq - 15, // 13: crabs.smm_core.SmmCore.RemoveUserFromBudget:input_type -> crabs.smm_core.RemoveUserFromBudgetReq - 16, // 14: crabs.smm_core.SmmCore.AddCategory:input_type -> crabs.smm_core.AddCategoryReq - 18, // 15: crabs.smm_core.SmmCore.UpdateCategory:input_type -> crabs.smm_core.UpdateCategoryReq - 19, // 16: crabs.smm_core.SmmCore.GetCategories:input_type -> crabs.smm_core.GetCategoriesReq - 21, // 17: crabs.smm_core.SmmCore.DeleteCategories:input_type -> crabs.smm_core.DeleteCategoriesReq - 22, // 18: crabs.smm_core.SmmCore.AddWaste:input_type -> crabs.smm_core.AddWasteReq - 24, // 19: crabs.smm_core.SmmCore.DeleteWaste:input_type -> crabs.smm_core.DeleteWasteReq - 25, // 20: crabs.smm_core.SmmCore.GetCategoriesStat:input_type -> crabs.smm_core.GetCategoriesStatReq - 1, // 21: crabs.smm_core.SmmCore.Ping:output_type -> crabs.smm_core.PingRsp - 4, // 22: crabs.smm_core.SmmCore.AddUser:output_type -> crabs.smm_core.User - 4, // 23: crabs.smm_core.SmmCore.Login:output_type -> crabs.smm_core.User - 7, // 24: crabs.smm_core.SmmCore.AddBudget:output_type -> crabs.smm_core.Budget - 7, // 25: crabs.smm_core.SmmCore.UpdateBudget:output_type -> crabs.smm_core.Budget - 10, // 26: crabs.smm_core.SmmCore.GetBudgets:output_type -> crabs.smm_core.Budgets - 7, // 27: crabs.smm_core.SmmCore.DeleteBudget:output_type -> crabs.smm_core.Budget - 2, // 28: crabs.smm_core.SmmCore.AddUserToBudget:output_type -> crabs.smm_core.OK - 14, // 29: crabs.smm_core.SmmCore.GetBudgetUsers:output_type -> crabs.smm_core.Users - 7, // 30: crabs.smm_core.SmmCore.RemoveUserFromBudget:output_type -> crabs.smm_core.Budget - 17, // 31: crabs.smm_core.SmmCore.AddCategory:output_type -> crabs.smm_core.Category - 17, // 32: crabs.smm_core.SmmCore.UpdateCategory:output_type -> crabs.smm_core.Category - 20, // 33: crabs.smm_core.SmmCore.GetCategories:output_type -> crabs.smm_core.Categories - 17, // 34: crabs.smm_core.SmmCore.DeleteCategories:output_type -> crabs.smm_core.Category - 23, // 35: crabs.smm_core.SmmCore.AddWaste:output_type -> crabs.smm_core.Waste - 23, // 36: crabs.smm_core.SmmCore.DeleteWaste:output_type -> crabs.smm_core.Waste - 26, // 37: crabs.smm_core.SmmCore.GetCategoriesStat:output_type -> crabs.smm_core.CategoriesStat - 21, // [21:38] is the sub-list for method output_type - 4, // [4:21] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name + 18, // 0: crabs.smm_core.Budget.categories:type_name -> crabs.smm_core.Category + 7, // 1: crabs.smm_core.Budgets.budgets:type_name -> crabs.smm_core.Budget + 4, // 2: crabs.smm_core.Users.users:type_name -> crabs.smm_core.User + 18, // 3: crabs.smm_core.Categories.categories:type_name -> crabs.smm_core.Category + 26, // 4: crabs.smm_core.CategoriesStat.stat:type_name -> crabs.smm_core.CategoriesStat + 0, // 5: crabs.smm_core.SmmCore.Ping:input_type -> crabs.smm_core.PingReq + 3, // 6: crabs.smm_core.SmmCore.AddUser:input_type -> crabs.smm_core.AddUserReq + 5, // 7: crabs.smm_core.SmmCore.Login:input_type -> crabs.smm_core.LoginReq + 6, // 8: crabs.smm_core.SmmCore.AddBudget:input_type -> crabs.smm_core.AddBudgetReq + 8, // 9: crabs.smm_core.SmmCore.UpdateBudget:input_type -> crabs.smm_core.UpdateBudgetReq + 9, // 10: crabs.smm_core.SmmCore.GetBudgets:input_type -> crabs.smm_core.GetBudgetsReq + 11, // 11: crabs.smm_core.SmmCore.DeleteBudget:input_type -> crabs.smm_core.DeleteBudgetReq + 12, // 12: crabs.smm_core.SmmCore.AddUserToBudget:input_type -> crabs.smm_core.AddUserToBudgetReq + 13, // 13: crabs.smm_core.SmmCore.GetBudgetUsers:input_type -> crabs.smm_core.GetBudgetUsersReq + 15, // 14: crabs.smm_core.SmmCore.RemoveUserFromBudget:input_type -> crabs.smm_core.RemoveUserFromBudgetReq + 16, // 15: crabs.smm_core.SmmCore.GetBudgetCategories:input_type -> crabs.smm_core.GetBudgetCategoriesReq + 17, // 16: crabs.smm_core.SmmCore.AddCategory:input_type -> crabs.smm_core.AddCategoryReq + 19, // 17: crabs.smm_core.SmmCore.UpdateCategory:input_type -> crabs.smm_core.UpdateCategoryReq + 21, // 18: crabs.smm_core.SmmCore.DeleteCategories:input_type -> crabs.smm_core.DeleteCategoriesReq + 22, // 19: crabs.smm_core.SmmCore.AddWaste:input_type -> crabs.smm_core.AddWasteReq + 24, // 20: crabs.smm_core.SmmCore.DeleteWaste:input_type -> crabs.smm_core.DeleteWasteReq + 25, // 21: crabs.smm_core.SmmCore.GetCategoriesStat:input_type -> crabs.smm_core.GetCategoriesStatReq + 1, // 22: crabs.smm_core.SmmCore.Ping:output_type -> crabs.smm_core.PingRsp + 4, // 23: crabs.smm_core.SmmCore.AddUser:output_type -> crabs.smm_core.User + 4, // 24: crabs.smm_core.SmmCore.Login:output_type -> crabs.smm_core.User + 7, // 25: crabs.smm_core.SmmCore.AddBudget:output_type -> crabs.smm_core.Budget + 7, // 26: crabs.smm_core.SmmCore.UpdateBudget:output_type -> crabs.smm_core.Budget + 10, // 27: crabs.smm_core.SmmCore.GetBudgets:output_type -> crabs.smm_core.Budgets + 7, // 28: crabs.smm_core.SmmCore.DeleteBudget:output_type -> crabs.smm_core.Budget + 2, // 29: crabs.smm_core.SmmCore.AddUserToBudget:output_type -> crabs.smm_core.OK + 14, // 30: crabs.smm_core.SmmCore.GetBudgetUsers:output_type -> crabs.smm_core.Users + 7, // 31: crabs.smm_core.SmmCore.RemoveUserFromBudget:output_type -> crabs.smm_core.Budget + 20, // 32: crabs.smm_core.SmmCore.GetBudgetCategories:output_type -> crabs.smm_core.Categories + 18, // 33: crabs.smm_core.SmmCore.AddCategory:output_type -> crabs.smm_core.Category + 18, // 34: crabs.smm_core.SmmCore.UpdateCategory:output_type -> crabs.smm_core.Category + 18, // 35: crabs.smm_core.SmmCore.DeleteCategories:output_type -> crabs.smm_core.Category + 23, // 36: crabs.smm_core.SmmCore.AddWaste:output_type -> crabs.smm_core.Waste + 23, // 37: crabs.smm_core.SmmCore.DeleteWaste:output_type -> crabs.smm_core.Waste + 26, // 38: crabs.smm_core.SmmCore.GetCategoriesStat:output_type -> crabs.smm_core.CategoriesStat + 22, // [22:39] is the sub-list for method output_type + 5, // [5:22] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name } func init() { file_smm_core_proto_init() } diff --git a/proto/smm_core.pb.gw.go b/proto/smm_core.pb.gw.go index 0c0d21a..41acd51 100644 --- a/proto/smm_core.pb.gw.go +++ b/proto/smm_core.pb.gw.go @@ -441,6 +441,58 @@ func local_request_SmmCore_RemoveUserFromBudget_0(ctx context.Context, marshaler } +func request_SmmCore_GetBudgetCategories_0(ctx context.Context, marshaler runtime.Marshaler, client SmmCoreClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetBudgetCategoriesReq + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["budget_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "budget_id") + } + + protoReq.BudgetId, err = runtime.Int32(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "budget_id", err) + } + + msg, err := client.GetBudgetCategories(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_SmmCore_GetBudgetCategories_0(ctx context.Context, marshaler runtime.Marshaler, server SmmCoreServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetBudgetCategoriesReq + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["budget_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "budget_id") + } + + protoReq.BudgetId, err = runtime.Int32(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "budget_id", err) + } + + msg, err := server.GetBudgetCategories(ctx, &protoReq) + return msg, metadata, err + +} + func request_SmmCore_AddCategory_0(ctx context.Context, marshaler runtime.Marshaler, client SmmCoreClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq AddCategoryReq var metadata runtime.ServerMetadata @@ -537,42 +589,6 @@ func local_request_SmmCore_UpdateCategory_0(ctx context.Context, marshaler runti } -var ( - filter_SmmCore_GetCategories_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_SmmCore_GetCategories_0(ctx context.Context, marshaler runtime.Marshaler, client SmmCoreClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetCategoriesReq - 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_SmmCore_GetCategories_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GetCategories(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_SmmCore_GetCategories_0(ctx context.Context, marshaler runtime.Marshaler, server SmmCoreServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetCategoriesReq - 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_SmmCore_GetCategories_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.GetCategories(ctx, &protoReq) - return msg, metadata, err - -} - func request_SmmCore_DeleteCategories_0(ctx context.Context, marshaler runtime.Marshaler, client SmmCoreClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq DeleteCategoriesReq var metadata runtime.ServerMetadata @@ -996,6 +1012,31 @@ func RegisterSmmCoreHandlerServer(ctx context.Context, mux *runtime.ServeMux, se }) + mux.Handle("GET", pattern_SmmCore_GetBudgetCategories_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, "/crabs.smm_core.SmmCore/GetBudgetCategories", runtime.WithHTTPPathPattern("/budgets/{budget_id}/categories")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_SmmCore_GetBudgetCategories_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_SmmCore_GetBudgetCategories_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("POST", pattern_SmmCore_AddCategory_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1046,31 +1087,6 @@ func RegisterSmmCoreHandlerServer(ctx context.Context, mux *runtime.ServeMux, se }) - mux.Handle("GET", pattern_SmmCore_GetCategories_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, "/crabs.smm_core.SmmCore/GetCategories", runtime.WithHTTPPathPattern("/categories")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_SmmCore_GetCategories_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_SmmCore_GetCategories_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - mux.Handle("DELETE", pattern_SmmCore_DeleteCategories_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1432,6 +1448,28 @@ func RegisterSmmCoreHandlerClient(ctx context.Context, mux *runtime.ServeMux, cl }) + mux.Handle("GET", pattern_SmmCore_GetBudgetCategories_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, "/crabs.smm_core.SmmCore/GetBudgetCategories", runtime.WithHTTPPathPattern("/budgets/{budget_id}/categories")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_SmmCore_GetBudgetCategories_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_SmmCore_GetBudgetCategories_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("POST", pattern_SmmCore_AddCategory_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1476,28 +1514,6 @@ func RegisterSmmCoreHandlerClient(ctx context.Context, mux *runtime.ServeMux, cl }) - mux.Handle("GET", pattern_SmmCore_GetCategories_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, "/crabs.smm_core.SmmCore/GetCategories", runtime.WithHTTPPathPattern("/categories")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_SmmCore_GetCategories_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_SmmCore_GetCategories_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - mux.Handle("DELETE", pattern_SmmCore_DeleteCategories_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1610,12 +1626,12 @@ var ( pattern_SmmCore_RemoveUserFromBudget_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"budgets", "budget_id", "users", "user_id"}, "")) + pattern_SmmCore_GetBudgetCategories_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1, 2, 2}, []string{"budgets", "budget_id", "categories"}, "")) + pattern_SmmCore_AddCategory_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"categories"}, "")) pattern_SmmCore_UpdateCategory_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1}, []string{"categories", "id"}, "")) - pattern_SmmCore_GetCategories_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"categories"}, "")) - pattern_SmmCore_DeleteCategories_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1}, []string{"categories", "id"}, "")) pattern_SmmCore_AddWaste_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"wastes"}, "")) @@ -1646,12 +1662,12 @@ var ( forward_SmmCore_RemoveUserFromBudget_0 = runtime.ForwardResponseMessage + forward_SmmCore_GetBudgetCategories_0 = runtime.ForwardResponseMessage + forward_SmmCore_AddCategory_0 = runtime.ForwardResponseMessage forward_SmmCore_UpdateCategory_0 = runtime.ForwardResponseMessage - forward_SmmCore_GetCategories_0 = runtime.ForwardResponseMessage - forward_SmmCore_DeleteCategories_0 = runtime.ForwardResponseMessage forward_SmmCore_AddWaste_0 = runtime.ForwardResponseMessage diff --git a/proto/smm_core_grpc.pb.go b/proto/smm_core_grpc.pb.go index d8435f7..7b2f990 100644 --- a/proto/smm_core_grpc.pb.go +++ b/proto/smm_core_grpc.pb.go @@ -29,9 +29,9 @@ const ( SmmCore_AddUserToBudget_FullMethodName = "/crabs.smm_core.SmmCore/AddUserToBudget" SmmCore_GetBudgetUsers_FullMethodName = "/crabs.smm_core.SmmCore/GetBudgetUsers" SmmCore_RemoveUserFromBudget_FullMethodName = "/crabs.smm_core.SmmCore/RemoveUserFromBudget" + SmmCore_GetBudgetCategories_FullMethodName = "/crabs.smm_core.SmmCore/GetBudgetCategories" SmmCore_AddCategory_FullMethodName = "/crabs.smm_core.SmmCore/AddCategory" SmmCore_UpdateCategory_FullMethodName = "/crabs.smm_core.SmmCore/UpdateCategory" - SmmCore_GetCategories_FullMethodName = "/crabs.smm_core.SmmCore/GetCategories" SmmCore_DeleteCategories_FullMethodName = "/crabs.smm_core.SmmCore/DeleteCategories" SmmCore_AddWaste_FullMethodName = "/crabs.smm_core.SmmCore/AddWaste" SmmCore_DeleteWaste_FullMethodName = "/crabs.smm_core.SmmCore/DeleteWaste" @@ -56,10 +56,10 @@ type SmmCoreClient interface { AddUserToBudget(ctx context.Context, in *AddUserToBudgetReq, opts ...grpc.CallOption) (*OK, error) GetBudgetUsers(ctx context.Context, in *GetBudgetUsersReq, opts ...grpc.CallOption) (*Users, error) RemoveUserFromBudget(ctx context.Context, in *RemoveUserFromBudgetReq, opts ...grpc.CallOption) (*Budget, error) + GetBudgetCategories(ctx context.Context, in *GetBudgetCategoriesReq, opts ...grpc.CallOption) (*Categories, error) // categories AddCategory(ctx context.Context, in *AddCategoryReq, opts ...grpc.CallOption) (*Category, error) UpdateCategory(ctx context.Context, in *UpdateCategoryReq, opts ...grpc.CallOption) (*Category, error) - GetCategories(ctx context.Context, in *GetCategoriesReq, opts ...grpc.CallOption) (*Categories, error) DeleteCategories(ctx context.Context, in *DeleteCategoriesReq, opts ...grpc.CallOption) (*Category, error) // wastes AddWaste(ctx context.Context, in *AddWasteReq, opts ...grpc.CallOption) (*Waste, error) @@ -176,6 +176,16 @@ func (c *smmCoreClient) RemoveUserFromBudget(ctx context.Context, in *RemoveUser return out, nil } +func (c *smmCoreClient) GetBudgetCategories(ctx context.Context, in *GetBudgetCategoriesReq, opts ...grpc.CallOption) (*Categories, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Categories) + err := c.cc.Invoke(ctx, SmmCore_GetBudgetCategories_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *smmCoreClient) AddCategory(ctx context.Context, in *AddCategoryReq, opts ...grpc.CallOption) (*Category, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Category) @@ -196,16 +206,6 @@ func (c *smmCoreClient) UpdateCategory(ctx context.Context, in *UpdateCategoryRe return out, nil } -func (c *smmCoreClient) GetCategories(ctx context.Context, in *GetCategoriesReq, opts ...grpc.CallOption) (*Categories, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(Categories) - err := c.cc.Invoke(ctx, SmmCore_GetCategories_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *smmCoreClient) DeleteCategories(ctx context.Context, in *DeleteCategoriesReq, opts ...grpc.CallOption) (*Category, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Category) @@ -264,10 +264,10 @@ type SmmCoreServer interface { AddUserToBudget(context.Context, *AddUserToBudgetReq) (*OK, error) GetBudgetUsers(context.Context, *GetBudgetUsersReq) (*Users, error) RemoveUserFromBudget(context.Context, *RemoveUserFromBudgetReq) (*Budget, error) + GetBudgetCategories(context.Context, *GetBudgetCategoriesReq) (*Categories, error) // categories AddCategory(context.Context, *AddCategoryReq) (*Category, error) UpdateCategory(context.Context, *UpdateCategoryReq) (*Category, error) - GetCategories(context.Context, *GetCategoriesReq) (*Categories, error) DeleteCategories(context.Context, *DeleteCategoriesReq) (*Category, error) // wastes AddWaste(context.Context, *AddWasteReq) (*Waste, error) @@ -314,15 +314,15 @@ func (UnimplementedSmmCoreServer) GetBudgetUsers(context.Context, *GetBudgetUser func (UnimplementedSmmCoreServer) RemoveUserFromBudget(context.Context, *RemoveUserFromBudgetReq) (*Budget, error) { return nil, status.Errorf(codes.Unimplemented, "method RemoveUserFromBudget not implemented") } +func (UnimplementedSmmCoreServer) GetBudgetCategories(context.Context, *GetBudgetCategoriesReq) (*Categories, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetBudgetCategories not implemented") +} func (UnimplementedSmmCoreServer) AddCategory(context.Context, *AddCategoryReq) (*Category, error) { return nil, status.Errorf(codes.Unimplemented, "method AddCategory not implemented") } func (UnimplementedSmmCoreServer) UpdateCategory(context.Context, *UpdateCategoryReq) (*Category, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateCategory not implemented") } -func (UnimplementedSmmCoreServer) GetCategories(context.Context, *GetCategoriesReq) (*Categories, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetCategories not implemented") -} func (UnimplementedSmmCoreServer) DeleteCategories(context.Context, *DeleteCategoriesReq) (*Category, error) { return nil, status.Errorf(codes.Unimplemented, "method DeleteCategories not implemented") } @@ -536,6 +536,24 @@ func _SmmCore_RemoveUserFromBudget_Handler(srv interface{}, ctx context.Context, return interceptor(ctx, in, info, handler) } +func _SmmCore_GetBudgetCategories_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetBudgetCategoriesReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SmmCoreServer).GetBudgetCategories(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: SmmCore_GetBudgetCategories_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SmmCoreServer).GetBudgetCategories(ctx, req.(*GetBudgetCategoriesReq)) + } + return interceptor(ctx, in, info, handler) +} + func _SmmCore_AddCategory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AddCategoryReq) if err := dec(in); err != nil { @@ -572,24 +590,6 @@ func _SmmCore_UpdateCategory_Handler(srv interface{}, ctx context.Context, dec f return interceptor(ctx, in, info, handler) } -func _SmmCore_GetCategories_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetCategoriesReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(SmmCoreServer).GetCategories(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: SmmCore_GetCategories_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SmmCoreServer).GetCategories(ctx, req.(*GetCategoriesReq)) - } - return interceptor(ctx, in, info, handler) -} - func _SmmCore_DeleteCategories_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(DeleteCategoriesReq) if err := dec(in); err != nil { @@ -709,6 +709,10 @@ var SmmCore_ServiceDesc = grpc.ServiceDesc{ MethodName: "RemoveUserFromBudget", Handler: _SmmCore_RemoveUserFromBudget_Handler, }, + { + MethodName: "GetBudgetCategories", + Handler: _SmmCore_GetBudgetCategories_Handler, + }, { MethodName: "AddCategory", Handler: _SmmCore_AddCategory_Handler, @@ -717,10 +721,6 @@ var SmmCore_ServiceDesc = grpc.ServiceDesc{ MethodName: "UpdateCategory", Handler: _SmmCore_UpdateCategory_Handler, }, - { - MethodName: "GetCategories", - Handler: _SmmCore_GetCategories_Handler, - }, { MethodName: "DeleteCategories", Handler: _SmmCore_DeleteCategories_Handler, diff --git a/resources/smm_core.swagger.json b/resources/smm_core.swagger.json index 8cc18e7..ef70744 100644 --- a/resources/smm_core.swagger.json +++ b/resources/smm_core.swagger.json @@ -69,6 +69,37 @@ ] } }, + "/budgets/{budgetId}/categories": { + "get": { + "operationId": "SmmCore_GetBudgetCategories", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/smm_coreCategories" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "budgetId", + "in": "path", + "required": true, + "type": "integer", + "format": "int32" + } + ], + "tags": [ + "SmmCore" + ] + } + }, "/budgets/{budgetId}/users": { "put": { "summary": "budget users", @@ -247,41 +278,6 @@ } }, "/categories": { - "get": { - "operationId": "SmmCore_GetCategories", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/smm_coreCategories" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "favorite", - "in": "query", - "required": false, - "type": "boolean" - }, - { - "name": "budgetId", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - } - ], - "tags": [ - "SmmCore" - ] - }, "post": { "summary": "categories", "operationId": "SmmCore_AddCategory", @@ -719,6 +715,13 @@ "monthlyLimit": { "type": "integer", "format": "int32" + }, + "categories": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/smm_coreCategory" + } } } },