mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-04-27 22:41:10 -05:00
Regenerated protobuf
This commit is contained in:
@@ -912,6 +912,7 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxv
|
||||
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
|
||||
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
|
||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||
github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs=
|
||||
github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
|
||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/pty v1.1.3/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
@@ -1042,7 +1043,9 @@ github.com/micro/micro/v2 v2.0.1-0.20200210100719-f38a1d8d5348/go.mod h1:MQBt/cB
|
||||
github.com/micro/micro/v2 v2.5.1-0.20200418121137-24e9b206767c/go.mod h1:fqqaYbJGYzSBi7Ms2Adly7Xzw9+WIRBAucUjwGmYeFY=
|
||||
github.com/micro/micro/v2 v2.8.0 h1:AMqpnKsOBnuGHjU0jVmTL17BRdsOx0FbvI/Gkl2uLrA=
|
||||
github.com/micro/micro/v2 v2.8.0/go.mod h1:VTIGqEBLAMh22q72DnGd95iJSQY/3yvXd9GIIooQ69c=
|
||||
github.com/micro/protoc-gen-micro v1.0.0 h1:qKh5S3I1RfenhIs5mqDFJLwRlRDlgin7XWiUKZbpwLM=
|
||||
github.com/micro/protoc-gen-micro v1.0.0/go.mod h1:C8ij4DJhapBmypcT00AXdb0cZ675/3PqUO02buWWqbE=
|
||||
github.com/micro/protoc-gen-micro/v2 v2.3.0 h1:PBbGeNh4BOy1w4eRdeo4yWJJNWGLnaJX6/h55I74EXE=
|
||||
github.com/micro/protoc-gen-micro/v2 v2.3.0/go.mod h1:gcsUvKSTTTalq+pqdUbFS40OTsURpYgL5+yUguR1djk=
|
||||
github.com/microcosm-cc/bluemonday v1.0.1/go.mod h1:hsXNsILzKxV+sX77C5b8FSuKF00vh2OMYv+xgHpAMF4=
|
||||
github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc=
|
||||
@@ -1157,6 +1160,7 @@ github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W
|
||||
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/ginkgo v1.10.1 h1:q/mM8GF/n0shIN8SaAZ0V+jnLPzen6WIVZdiwrRlMlo=
|
||||
github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/ginkgo v1.10.3 h1:OoxbjfXVZyod1fmWYhI7SEyaD8B00ynP3T+D5GiyHOY=
|
||||
github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
|
||||
github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
|
||||
@@ -1164,6 +1168,7 @@ github.com/onsi/gomega v1.4.2/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1Cpa
|
||||
github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
|
||||
github.com/onsi/gomega v1.7.0 h1:XPnZz8VVBHjVsy1vzJmRwIcSwiUO+JFfrv/xGiigmME=
|
||||
github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
|
||||
github.com/onsi/gomega v1.7.1 h1:K0jcRCwNQM3vFGh1ppMtDh/+7ApJrjldlX8fA0jDTLQ=
|
||||
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
|
||||
github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk=
|
||||
github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
|
||||
@@ -1979,6 +1984,7 @@ google.golang.org/genproto v0.0.0-20200624020401-64a14ca9d1ad h1:uAwc13+y0Y8QZLT
|
||||
google.golang.org/genproto v0.0.0-20200624020401-64a14ca9d1ad/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/grpc v1.26.0 h1:2dTRdpdFEEhJYQD8EMLB61nnrzSCTbG38PhqdhvOltg=
|
||||
google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
|
||||
google.golang.org/grpc/examples v0.0.0-20200824180931-410880dd7d91 h1:eUaF7ghTaPu2Ivm9aqGW31Zr9aVB8k1KO1m3lo7lbj8=
|
||||
google.golang.org/grpc/examples v0.0.0-20200824180931-410880dd7d91/go.mod h1:wQWkdCkP0Pl3MzFPvfqTNUnXA2eIVY4eakDiKJvniKc=
|
||||
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
|
||||
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
|
||||
|
||||
+3
-3
File diff suppressed because one or more lines are too long
@@ -1813,9 +1813,9 @@ var fileDescriptor_e1e7723af4c007b7 = []byte{
|
||||
0x66, 0x1a, 0x3d, 0xa7, 0xca, 0x8b, 0x93, 0xfa, 0x44, 0x92, 0xdc, 0xb5, 0xb7, 0x0c, 0x89, 0x8a,
|
||||
0xbd, 0xfb, 0x8d, 0xd1, 0xda, 0x9f, 0xdd, 0xf9, 0x76, 0x57, 0xeb, 0xb5, 0xdd, 0x1b, 0x14, 0xf7,
|
||||
0x04, 0xdd, 0x77, 0x25, 0x98, 0xcf, 0x4a, 0xf4, 0xec, 0x7e, 0x36, 0x46, 0xba, 0x17, 0x59, 0x7f,
|
||||
0x23, 0x59, 0x1f, 0xdc, 0xb9, 0xff, 0x36, 0xac, 0xdf, 0xa4, 0xda, 0xfe, 0xdb, 0x24, 0x85, 0x21,
|
||||
0xd4, 0x33, 0x82, 0x18, 0xe5, 0x3a, 0x7d, 0x54, 0xe9, 0x37, 0xd7, 0x27, 0x58, 0xf5, 0x8b, 0x70,
|
||||
0x57, 0x66, 0x73, 0x0b, 0xd9, 0xf9, 0x6c, 0xc6, 0xce, 0xfe, 0x51, 0xe3, 0x8f, 0x28, 0x7a, 0xdd,
|
||||
0x57, 0xff, 0xc2, 0xd9, 0x3d, 0xfd, 0xf8, 0xa1, 0x5a, 0xb6, 0x59, 0xf9, 0xe7, 0x93, 0xff, 0x05,
|
||||
0x00, 0x00, 0xff, 0xff, 0xb0, 0x3a, 0x3d, 0xe4, 0x7a, 0x1a, 0x00, 0x00,
|
||||
0x23, 0x59, 0x1f, 0xd8, 0xf7, 0xdf, 0x86, 0xf5, 0x9b, 0x54, 0xdb, 0x7f, 0x9b, 0xa4, 0x30, 0x84,
|
||||
0x7a, 0x46, 0x10, 0xa3, 0x5c, 0xa7, 0x8f, 0x2a, 0xfd, 0xe6, 0xfa, 0x04, 0xab, 0x7e, 0x11, 0xee,
|
||||
0xca, 0x6c, 0x6e, 0xd9, 0x76, 0x3e, 0x9b, 0xb1, 0xb3, 0x7f, 0xd4, 0xf8, 0x23, 0x8a, 0x5e, 0xf7,
|
||||
0xd5, 0xbf, 0x70, 0x76, 0x4f, 0x3f, 0x7e, 0xa8, 0x96, 0x6d, 0x56, 0xfe, 0xf9, 0xe4, 0x7f, 0x01,
|
||||
0x00, 0x00, 0xff, 0xff, 0x52, 0x6c, 0xdb, 0xd1, 0x7a, 0x1a, 0x00, 0x00,
|
||||
}
|
||||
|
||||
@@ -15,8 +15,9 @@ import (
|
||||
|
||||
import (
|
||||
context "context"
|
||||
client "github.com/micro/go-micro/client"
|
||||
server "github.com/micro/go-micro/server"
|
||||
api "github.com/micro/go-micro/v2/api"
|
||||
client "github.com/micro/go-micro/v2/client"
|
||||
server "github.com/micro/go-micro/v2/server"
|
||||
)
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
@@ -31,10 +32,53 @@ var _ = math.Inf
|
||||
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ api.Endpoint
|
||||
var _ context.Context
|
||||
var _ client.Option
|
||||
var _ server.Option
|
||||
|
||||
// Api Endpoints for AccountsService service
|
||||
|
||||
func NewAccountsServiceEndpoints() []*api.Endpoint {
|
||||
return []*api.Endpoint{
|
||||
&api.Endpoint{
|
||||
Name: "AccountsService.ListAccounts",
|
||||
Path: []string{"/api/v0/accounts/accounts-list"},
|
||||
Method: []string{"POST"},
|
||||
Body: "*",
|
||||
Handler: "rpc",
|
||||
},
|
||||
&api.Endpoint{
|
||||
Name: "AccountsService.GetAccount",
|
||||
Path: []string{"/api/v0/accounts/accounts-get"},
|
||||
Method: []string{"POST"},
|
||||
Body: "*",
|
||||
Handler: "rpc",
|
||||
},
|
||||
&api.Endpoint{
|
||||
Name: "AccountsService.CreateAccount",
|
||||
Path: []string{"/api/v0/accounts/accounts-create"},
|
||||
Method: []string{"POST"},
|
||||
Body: "*",
|
||||
Handler: "rpc",
|
||||
},
|
||||
&api.Endpoint{
|
||||
Name: "AccountsService.UpdateAccount",
|
||||
Path: []string{"/api/v0/accounts/accounts-update"},
|
||||
Method: []string{"POST"},
|
||||
Body: "*",
|
||||
Handler: "rpc",
|
||||
},
|
||||
&api.Endpoint{
|
||||
Name: "AccountsService.DeleteAccount",
|
||||
Path: []string{"/api/v0/accounts/accounts-delete"},
|
||||
Method: []string{"POST"},
|
||||
Body: "*",
|
||||
Handler: "rpc",
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// Client API for AccountsService service
|
||||
|
||||
type AccountsService interface {
|
||||
@@ -56,12 +100,6 @@ type accountsService struct {
|
||||
}
|
||||
|
||||
func NewAccountsService(name string, c client.Client) AccountsService {
|
||||
if c == nil {
|
||||
c = client.NewClient()
|
||||
}
|
||||
if len(name) == 0 {
|
||||
name = "settings"
|
||||
}
|
||||
return &accountsService{
|
||||
c: c,
|
||||
name: name,
|
||||
@@ -145,6 +183,41 @@ func RegisterAccountsServiceHandler(s server.Server, hdlr AccountsServiceHandler
|
||||
accountsService
|
||||
}
|
||||
h := &accountsServiceHandler{hdlr}
|
||||
opts = append(opts, api.WithEndpoint(&api.Endpoint{
|
||||
Name: "AccountsService.ListAccounts",
|
||||
Path: []string{"/api/v0/accounts/accounts-list"},
|
||||
Method: []string{"POST"},
|
||||
Body: "*",
|
||||
Handler: "rpc",
|
||||
}))
|
||||
opts = append(opts, api.WithEndpoint(&api.Endpoint{
|
||||
Name: "AccountsService.GetAccount",
|
||||
Path: []string{"/api/v0/accounts/accounts-get"},
|
||||
Method: []string{"POST"},
|
||||
Body: "*",
|
||||
Handler: "rpc",
|
||||
}))
|
||||
opts = append(opts, api.WithEndpoint(&api.Endpoint{
|
||||
Name: "AccountsService.CreateAccount",
|
||||
Path: []string{"/api/v0/accounts/accounts-create"},
|
||||
Method: []string{"POST"},
|
||||
Body: "*",
|
||||
Handler: "rpc",
|
||||
}))
|
||||
opts = append(opts, api.WithEndpoint(&api.Endpoint{
|
||||
Name: "AccountsService.UpdateAccount",
|
||||
Path: []string{"/api/v0/accounts/accounts-update"},
|
||||
Method: []string{"POST"},
|
||||
Body: "*",
|
||||
Handler: "rpc",
|
||||
}))
|
||||
opts = append(opts, api.WithEndpoint(&api.Endpoint{
|
||||
Name: "AccountsService.DeleteAccount",
|
||||
Path: []string{"/api/v0/accounts/accounts-delete"},
|
||||
Method: []string{"POST"},
|
||||
Body: "*",
|
||||
Handler: "rpc",
|
||||
}))
|
||||
return s.Handle(s.NewHandler(&AccountsService{h}, opts...))
|
||||
}
|
||||
|
||||
@@ -172,6 +245,69 @@ func (h *accountsServiceHandler) DeleteAccount(ctx context.Context, in *DeleteAc
|
||||
return h.AccountsServiceHandler.DeleteAccount(ctx, in, out)
|
||||
}
|
||||
|
||||
// Api Endpoints for GroupsService service
|
||||
|
||||
func NewGroupsServiceEndpoints() []*api.Endpoint {
|
||||
return []*api.Endpoint{
|
||||
&api.Endpoint{
|
||||
Name: "GroupsService.ListGroups",
|
||||
Path: []string{"/api/v0/accounts/groups-list"},
|
||||
Method: []string{"POST"},
|
||||
Body: "*",
|
||||
Handler: "rpc",
|
||||
},
|
||||
&api.Endpoint{
|
||||
Name: "GroupsService.GetGroup",
|
||||
Path: []string{"/api/v0/accounts/groups-get"},
|
||||
Method: []string{"POST"},
|
||||
Body: "*",
|
||||
Handler: "rpc",
|
||||
},
|
||||
&api.Endpoint{
|
||||
Name: "GroupsService.CreateGroup",
|
||||
Path: []string{"/api/v0/accounts/groups-create"},
|
||||
Method: []string{"POST"},
|
||||
Body: "*",
|
||||
Handler: "rpc",
|
||||
},
|
||||
&api.Endpoint{
|
||||
Name: "GroupsService.UpdateGroup",
|
||||
Path: []string{"/api/v0/accounts/groups-update"},
|
||||
Method: []string{"POST"},
|
||||
Body: "*",
|
||||
Handler: "rpc",
|
||||
},
|
||||
&api.Endpoint{
|
||||
Name: "GroupsService.DeleteGroup",
|
||||
Path: []string{"/api/v0/accounts/groups-delete"},
|
||||
Method: []string{"POST"},
|
||||
Body: "*",
|
||||
Handler: "rpc",
|
||||
},
|
||||
&api.Endpoint{
|
||||
Name: "GroupsService.AddMember",
|
||||
Path: []string{"/api/v0/groups/{group_id=*}/members/$ref"},
|
||||
Method: []string{"POST"},
|
||||
Body: "*",
|
||||
Handler: "rpc",
|
||||
},
|
||||
&api.Endpoint{
|
||||
Name: "GroupsService.RemoveMember",
|
||||
Path: []string{"/api/v0/groups/{group_id=*}/members/{account_id}/$ref"},
|
||||
Method: []string{"POST"},
|
||||
Body: "*",
|
||||
Handler: "rpc",
|
||||
},
|
||||
&api.Endpoint{
|
||||
Name: "GroupsService.ListMembers",
|
||||
Path: []string{"/api/v0/groups/{id=*}/members/$ref"},
|
||||
Method: []string{"POST"},
|
||||
Body: "*",
|
||||
Handler: "rpc",
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// Client API for GroupsService service
|
||||
|
||||
type GroupsService interface {
|
||||
@@ -199,12 +335,6 @@ type groupsService struct {
|
||||
}
|
||||
|
||||
func NewGroupsService(name string, c client.Client) GroupsService {
|
||||
if c == nil {
|
||||
c = client.NewClient()
|
||||
}
|
||||
if len(name) == 0 {
|
||||
name = "settings"
|
||||
}
|
||||
return &groupsService{
|
||||
c: c,
|
||||
name: name,
|
||||
@@ -327,6 +457,62 @@ func RegisterGroupsServiceHandler(s server.Server, hdlr GroupsServiceHandler, op
|
||||
groupsService
|
||||
}
|
||||
h := &groupsServiceHandler{hdlr}
|
||||
opts = append(opts, api.WithEndpoint(&api.Endpoint{
|
||||
Name: "GroupsService.ListGroups",
|
||||
Path: []string{"/api/v0/accounts/groups-list"},
|
||||
Method: []string{"POST"},
|
||||
Body: "*",
|
||||
Handler: "rpc",
|
||||
}))
|
||||
opts = append(opts, api.WithEndpoint(&api.Endpoint{
|
||||
Name: "GroupsService.GetGroup",
|
||||
Path: []string{"/api/v0/accounts/groups-get"},
|
||||
Method: []string{"POST"},
|
||||
Body: "*",
|
||||
Handler: "rpc",
|
||||
}))
|
||||
opts = append(opts, api.WithEndpoint(&api.Endpoint{
|
||||
Name: "GroupsService.CreateGroup",
|
||||
Path: []string{"/api/v0/accounts/groups-create"},
|
||||
Method: []string{"POST"},
|
||||
Body: "*",
|
||||
Handler: "rpc",
|
||||
}))
|
||||
opts = append(opts, api.WithEndpoint(&api.Endpoint{
|
||||
Name: "GroupsService.UpdateGroup",
|
||||
Path: []string{"/api/v0/accounts/groups-update"},
|
||||
Method: []string{"POST"},
|
||||
Body: "*",
|
||||
Handler: "rpc",
|
||||
}))
|
||||
opts = append(opts, api.WithEndpoint(&api.Endpoint{
|
||||
Name: "GroupsService.DeleteGroup",
|
||||
Path: []string{"/api/v0/accounts/groups-delete"},
|
||||
Method: []string{"POST"},
|
||||
Body: "*",
|
||||
Handler: "rpc",
|
||||
}))
|
||||
opts = append(opts, api.WithEndpoint(&api.Endpoint{
|
||||
Name: "GroupsService.AddMember",
|
||||
Path: []string{"/api/v0/groups/{group_id=*}/members/$ref"},
|
||||
Method: []string{"POST"},
|
||||
Body: "*",
|
||||
Handler: "rpc",
|
||||
}))
|
||||
opts = append(opts, api.WithEndpoint(&api.Endpoint{
|
||||
Name: "GroupsService.RemoveMember",
|
||||
Path: []string{"/api/v0/groups/{group_id=*}/members/{account_id}/$ref"},
|
||||
Method: []string{"POST"},
|
||||
Body: "*",
|
||||
Handler: "rpc",
|
||||
}))
|
||||
opts = append(opts, api.WithEndpoint(&api.Endpoint{
|
||||
Name: "GroupsService.ListMembers",
|
||||
Path: []string{"/api/v0/groups/{id=*}/members/$ref"},
|
||||
Method: []string{"POST"},
|
||||
Body: "*",
|
||||
Handler: "rpc",
|
||||
}))
|
||||
return s.Handle(s.NewHandler(&GroupsService{h}, opts...))
|
||||
}
|
||||
|
||||
|
||||
@@ -5,13 +5,14 @@ package proto
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
|
||||
"github.com/go-chi/chi"
|
||||
"github.com/go-chi/render"
|
||||
"github.com/golang/protobuf/jsonpb"
|
||||
|
||||
"github.com/golang/protobuf/ptypes/empty"
|
||||
)
|
||||
|
||||
type webAccountsServiceHandler struct {
|
||||
@@ -24,7 +25,9 @@ func (h *webAccountsServiceHandler) ServeHTTP(w http.ResponseWriter, r *http.Req
|
||||
}
|
||||
|
||||
func (h *webAccountsServiceHandler) ListAccounts(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
req := &ListAccountsRequest{}
|
||||
|
||||
resp := &ListAccountsResponse{}
|
||||
|
||||
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
|
||||
@@ -33,7 +36,7 @@ func (h *webAccountsServiceHandler) ListAccounts(w http.ResponseWriter, r *http.
|
||||
}
|
||||
|
||||
if err := h.h.ListAccounts(
|
||||
context.Background(),
|
||||
r.Context(),
|
||||
req,
|
||||
resp,
|
||||
); err != nil {
|
||||
@@ -46,7 +49,9 @@ func (h *webAccountsServiceHandler) ListAccounts(w http.ResponseWriter, r *http.
|
||||
}
|
||||
|
||||
func (h *webAccountsServiceHandler) GetAccount(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
req := &GetAccountRequest{}
|
||||
|
||||
resp := &Account{}
|
||||
|
||||
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
|
||||
@@ -55,7 +60,7 @@ func (h *webAccountsServiceHandler) GetAccount(w http.ResponseWriter, r *http.Re
|
||||
}
|
||||
|
||||
if err := h.h.GetAccount(
|
||||
context.Background(),
|
||||
r.Context(),
|
||||
req,
|
||||
resp,
|
||||
); err != nil {
|
||||
@@ -68,7 +73,9 @@ func (h *webAccountsServiceHandler) GetAccount(w http.ResponseWriter, r *http.Re
|
||||
}
|
||||
|
||||
func (h *webAccountsServiceHandler) CreateAccount(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
req := &CreateAccountRequest{}
|
||||
|
||||
resp := &Account{}
|
||||
|
||||
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
|
||||
@@ -77,7 +84,7 @@ func (h *webAccountsServiceHandler) CreateAccount(w http.ResponseWriter, r *http
|
||||
}
|
||||
|
||||
if err := h.h.CreateAccount(
|
||||
context.Background(),
|
||||
r.Context(),
|
||||
req,
|
||||
resp,
|
||||
); err != nil {
|
||||
@@ -90,7 +97,9 @@ func (h *webAccountsServiceHandler) CreateAccount(w http.ResponseWriter, r *http
|
||||
}
|
||||
|
||||
func (h *webAccountsServiceHandler) UpdateAccount(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
req := &UpdateAccountRequest{}
|
||||
|
||||
resp := &Account{}
|
||||
|
||||
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
|
||||
@@ -99,7 +108,7 @@ func (h *webAccountsServiceHandler) UpdateAccount(w http.ResponseWriter, r *http
|
||||
}
|
||||
|
||||
if err := h.h.UpdateAccount(
|
||||
context.Background(),
|
||||
r.Context(),
|
||||
req,
|
||||
resp,
|
||||
); err != nil {
|
||||
@@ -112,7 +121,9 @@ func (h *webAccountsServiceHandler) UpdateAccount(w http.ResponseWriter, r *http
|
||||
}
|
||||
|
||||
func (h *webAccountsServiceHandler) DeleteAccount(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
req := &DeleteAccountRequest{}
|
||||
resp := &empty.Empty{}
|
||||
|
||||
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
|
||||
http.Error(w, err.Error(), http.StatusPreconditionFailed)
|
||||
@@ -120,8 +131,9 @@ func (h *webAccountsServiceHandler) DeleteAccount(w http.ResponseWriter, r *http
|
||||
}
|
||||
|
||||
if err := h.h.DeleteAccount(
|
||||
context.Background(),
|
||||
r.Context(),
|
||||
req,
|
||||
resp,
|
||||
); err != nil {
|
||||
http.Error(w, err.Error(), http.StatusBadRequest)
|
||||
return
|
||||
@@ -154,7 +166,9 @@ func (h *webGroupsServiceHandler) ServeHTTP(w http.ResponseWriter, r *http.Reque
|
||||
}
|
||||
|
||||
func (h *webGroupsServiceHandler) ListGroups(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
req := &ListGroupsRequest{}
|
||||
|
||||
resp := &ListGroupsResponse{}
|
||||
|
||||
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
|
||||
@@ -163,7 +177,7 @@ func (h *webGroupsServiceHandler) ListGroups(w http.ResponseWriter, r *http.Requ
|
||||
}
|
||||
|
||||
if err := h.h.ListGroups(
|
||||
context.Background(),
|
||||
r.Context(),
|
||||
req,
|
||||
resp,
|
||||
); err != nil {
|
||||
@@ -176,7 +190,9 @@ func (h *webGroupsServiceHandler) ListGroups(w http.ResponseWriter, r *http.Requ
|
||||
}
|
||||
|
||||
func (h *webGroupsServiceHandler) GetGroup(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
req := &GetGroupRequest{}
|
||||
|
||||
resp := &Group{}
|
||||
|
||||
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
|
||||
@@ -185,7 +201,7 @@ func (h *webGroupsServiceHandler) GetGroup(w http.ResponseWriter, r *http.Reques
|
||||
}
|
||||
|
||||
if err := h.h.GetGroup(
|
||||
context.Background(),
|
||||
r.Context(),
|
||||
req,
|
||||
resp,
|
||||
); err != nil {
|
||||
@@ -198,7 +214,9 @@ func (h *webGroupsServiceHandler) GetGroup(w http.ResponseWriter, r *http.Reques
|
||||
}
|
||||
|
||||
func (h *webGroupsServiceHandler) CreateGroup(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
req := &CreateGroupRequest{}
|
||||
|
||||
resp := &Group{}
|
||||
|
||||
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
|
||||
@@ -207,7 +225,7 @@ func (h *webGroupsServiceHandler) CreateGroup(w http.ResponseWriter, r *http.Req
|
||||
}
|
||||
|
||||
if err := h.h.CreateGroup(
|
||||
context.Background(),
|
||||
r.Context(),
|
||||
req,
|
||||
resp,
|
||||
); err != nil {
|
||||
@@ -220,7 +238,9 @@ func (h *webGroupsServiceHandler) CreateGroup(w http.ResponseWriter, r *http.Req
|
||||
}
|
||||
|
||||
func (h *webGroupsServiceHandler) UpdateGroup(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
req := &UpdateGroupRequest{}
|
||||
|
||||
resp := &Group{}
|
||||
|
||||
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
|
||||
@@ -229,7 +249,7 @@ func (h *webGroupsServiceHandler) UpdateGroup(w http.ResponseWriter, r *http.Req
|
||||
}
|
||||
|
||||
if err := h.h.UpdateGroup(
|
||||
context.Background(),
|
||||
r.Context(),
|
||||
req,
|
||||
resp,
|
||||
); err != nil {
|
||||
@@ -242,7 +262,9 @@ func (h *webGroupsServiceHandler) UpdateGroup(w http.ResponseWriter, r *http.Req
|
||||
}
|
||||
|
||||
func (h *webGroupsServiceHandler) DeleteGroup(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
req := &DeleteGroupRequest{}
|
||||
resp := &empty.Empty{}
|
||||
|
||||
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
|
||||
http.Error(w, err.Error(), http.StatusPreconditionFailed)
|
||||
@@ -250,8 +272,9 @@ func (h *webGroupsServiceHandler) DeleteGroup(w http.ResponseWriter, r *http.Req
|
||||
}
|
||||
|
||||
if err := h.h.DeleteGroup(
|
||||
context.Background(),
|
||||
r.Context(),
|
||||
req,
|
||||
resp,
|
||||
); err != nil {
|
||||
http.Error(w, err.Error(), http.StatusBadRequest)
|
||||
return
|
||||
@@ -262,7 +285,9 @@ func (h *webGroupsServiceHandler) DeleteGroup(w http.ResponseWriter, r *http.Req
|
||||
}
|
||||
|
||||
func (h *webGroupsServiceHandler) AddMember(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
req := &AddMemberRequest{}
|
||||
|
||||
resp := &Group{}
|
||||
|
||||
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
|
||||
@@ -271,7 +296,7 @@ func (h *webGroupsServiceHandler) AddMember(w http.ResponseWriter, r *http.Reque
|
||||
}
|
||||
|
||||
if err := h.h.AddMember(
|
||||
context.Background(),
|
||||
r.Context(),
|
||||
req,
|
||||
resp,
|
||||
); err != nil {
|
||||
@@ -284,7 +309,9 @@ func (h *webGroupsServiceHandler) AddMember(w http.ResponseWriter, r *http.Reque
|
||||
}
|
||||
|
||||
func (h *webGroupsServiceHandler) RemoveMember(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
req := &RemoveMemberRequest{}
|
||||
|
||||
resp := &Group{}
|
||||
|
||||
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
|
||||
@@ -293,7 +320,7 @@ func (h *webGroupsServiceHandler) RemoveMember(w http.ResponseWriter, r *http.Re
|
||||
}
|
||||
|
||||
if err := h.h.RemoveMember(
|
||||
context.Background(),
|
||||
r.Context(),
|
||||
req,
|
||||
resp,
|
||||
); err != nil {
|
||||
@@ -301,12 +328,14 @@ func (h *webGroupsServiceHandler) RemoveMember(w http.ResponseWriter, r *http.Re
|
||||
return
|
||||
}
|
||||
|
||||
render.Status(r, http.StatusOK)
|
||||
render.Status(r, http.StatusCreated)
|
||||
render.JSON(w, r, resp)
|
||||
}
|
||||
|
||||
func (h *webGroupsServiceHandler) ListMembers(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
req := &ListMembersRequest{}
|
||||
|
||||
resp := &ListMembersResponse{}
|
||||
|
||||
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
|
||||
@@ -315,7 +344,7 @@ func (h *webGroupsServiceHandler) ListMembers(w http.ResponseWriter, r *http.Req
|
||||
}
|
||||
|
||||
if err := h.h.ListMembers(
|
||||
context.Background(),
|
||||
r.Context(),
|
||||
req,
|
||||
resp,
|
||||
); err != nil {
|
||||
@@ -323,7 +352,7 @@ func (h *webGroupsServiceHandler) ListMembers(w http.ResponseWriter, r *http.Req
|
||||
return
|
||||
}
|
||||
|
||||
render.Status(r, http.StatusOK)
|
||||
render.Status(r, http.StatusCreated)
|
||||
render.JSON(w, r, resp)
|
||||
}
|
||||
|
||||
@@ -339,8 +368,8 @@ func RegisterGroupsServiceWeb(r chi.Router, i GroupsServiceHandler, middlewares
|
||||
r.MethodFunc("POST", "/api/v0/accounts/groups-update", handler.UpdateGroup)
|
||||
r.MethodFunc("POST", "/api/v0/accounts/groups-delete", handler.DeleteGroup)
|
||||
r.MethodFunc("POST", "/api/v0/groups/{group_id=*}/members/$ref", handler.AddMember)
|
||||
r.MethodFunc("DELETE", "/api/v0/groups/{group_id=*}/members/{account_id}/$ref", handler.RemoveMember)
|
||||
r.MethodFunc("GET", "/api/v0/groups/{id=*}/members/$ref", handler.ListMembers)
|
||||
r.MethodFunc("POST", "/api/v0/groups/{group_id=*}/members/{account_id}/$ref", handler.RemoveMember)
|
||||
r.MethodFunc("POST", "/api/v0/groups/{id=*}/members/$ref", handler.ListMembers)
|
||||
}
|
||||
|
||||
// ListAccountsRequestJSONMarshaler describes the default jsonpb.Marshaler used by all
|
||||
|
||||
@@ -119,7 +119,8 @@ service GroupsService {
|
||||
rpc RemoveMember(RemoveMemberRequest) returns (Group) {
|
||||
// All request parameters go into body.
|
||||
option (google.api.http) = {
|
||||
delete: "/api/v0/groups/{group_id=*}/members/{account_id}/$ref"
|
||||
// URLs are broken
|
||||
post: "/api/v0/groups/{group_id=*}/members/{account_id}/$ref"
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
@@ -127,7 +128,8 @@ service GroupsService {
|
||||
rpc ListMembers(ListMembersRequest) returns (ListMembersResponse) {
|
||||
// All request parameters go into body.
|
||||
option (google.api.http) = {
|
||||
get: "/api/v0/groups/{id=*}/members/$ref"
|
||||
// URLs are broken
|
||||
post: "/api/v0/groups/{id=*}/members/$ref"
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"/api/v0/groups/groups-create": {
|
||||
"/api/v0/accounts/groups-create": {
|
||||
"post": {
|
||||
"summary": "Creates an account",
|
||||
"operationId": "CreateGroup",
|
||||
@@ -173,7 +173,7 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"/api/v0/groups/groups-delete": {
|
||||
"/api/v0/accounts/groups-delete": {
|
||||
"post": {
|
||||
"summary": "Deletes an account",
|
||||
"operationId": "DeleteGroup",
|
||||
@@ -200,7 +200,7 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"/api/v0/groups/groups-get": {
|
||||
"/api/v0/accounts/groups-get": {
|
||||
"post": {
|
||||
"summary": "Gets an account",
|
||||
"operationId": "GetGroup",
|
||||
@@ -227,7 +227,7 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"/api/v0/groups/groups-list": {
|
||||
"/api/v0/accounts/groups-list": {
|
||||
"post": {
|
||||
"summary": "Lists accounts",
|
||||
"operationId": "ListGroups",
|
||||
@@ -254,7 +254,7 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"/api/v0/groups/groups-update": {
|
||||
"/api/v0/accounts/groups-update": {
|
||||
"post": {
|
||||
"summary": "Updates an account",
|
||||
"operationId": "UpdateGroup",
|
||||
@@ -281,7 +281,7 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"/v0/groups/{group_id}/members/$ref": {
|
||||
"/api/v0/groups/{group_id}/members/$ref": {
|
||||
"post": {
|
||||
"summary": "group:addmember https://docs.microsoft.com/en-us/graph/api/group-post-members?view=graph-rest-1.0\u0026tabs=http",
|
||||
"operationId": "AddMember",
|
||||
@@ -315,8 +315,8 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"/v0/groups/{group_id}/members/{account_id}/$ref": {
|
||||
"delete": {
|
||||
"/api/v0/groups/{group_id}/members/{account_id}/$ref": {
|
||||
"post": {
|
||||
"summary": "group:removemember https://docs.microsoft.com/en-us/graph/api/group-delete-members?view=graph-rest-1.0",
|
||||
"operationId": "RemoveMember",
|
||||
"responses": {
|
||||
@@ -341,6 +341,14 @@
|
||||
"in": "path",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "body",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/settingsRemoveMemberRequest"
|
||||
}
|
||||
}
|
||||
],
|
||||
"tags": [
|
||||
@@ -348,8 +356,8 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"/v0/groups/{id}/members/$ref": {
|
||||
"get": {
|
||||
"/api/v0/groups/{id}/members/$ref": {
|
||||
"post": {
|
||||
"summary": "group:listmembers https://docs.microsoft.com/en-us/graph/api/group-list-members?view=graph-rest-1.0",
|
||||
"operationId": "ListMembers",
|
||||
"responses": {
|
||||
@@ -369,36 +377,12 @@
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "page_size",
|
||||
"in": "query",
|
||||
"required": false,
|
||||
"type": "integer",
|
||||
"format": "int32"
|
||||
},
|
||||
{
|
||||
"name": "page_token",
|
||||
"description": "Optional. A pagination token returned from a previous call to `Get`\nthat indicates from where search should continue.",
|
||||
"in": "query",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "field_mask.paths",
|
||||
"description": "The set of field mask paths.",
|
||||
"in": "query",
|
||||
"required": false,
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"collectionFormat": "multi"
|
||||
},
|
||||
{
|
||||
"name": "query",
|
||||
"description": "Optional. Search criteria used to select the groups to return.\nIf no search criteria is specified then all groups will be\nreturned. TODO update query language\nQuery expressions can be used to restrict results based upon\nthe account properties where the operators `=`, `NOT`, `AND` and `OR`\ncan be used along with the suffix wildcard symbol `*`.\n\nThe string properties in a query expression should use escaped quotes\nfor values that include whitespace to prevent unexpected behavior.\n\nSome example queries are:\n\n* Query `display_name=Th*` returns accounts whose display_name\nstarts with \"Th\"\n* Query `display_name=\\\\\"Test String\\\\\"` returns groups with\ndisplay names that include both \"Test\" and \"String\"",
|
||||
"in": "query",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
"name": "body",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/settingsListMembersRequest"
|
||||
}
|
||||
}
|
||||
],
|
||||
"tags": [
|
||||
@@ -819,6 +803,32 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"settingsListMembersRequest": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"page_size": {
|
||||
"type": "integer",
|
||||
"format": "int32"
|
||||
},
|
||||
"page_token": {
|
||||
"type": "string",
|
||||
"title": "Optional. A pagination token returned from a previous call to `Get`\nthat indicates from where search should continue"
|
||||
},
|
||||
"field_mask": {
|
||||
"$ref": "#/definitions/protobufFieldMask",
|
||||
"description": "Optional. Used to specify a subset of fields that should be\nreturned by a get operation or modified by an update operation."
|
||||
},
|
||||
"query": {
|
||||
"type": "string",
|
||||
"description": "TODO update query language\nQuery expressions can be used to restrict results based upon\nthe account properties where the operators `=`, `NOT`, `AND` and `OR`\ncan be used along with the suffix wildcard symbol `*`.\n\nThe string properties in a query expression should use escaped quotes\nfor values that include whitespace to prevent unexpected behavior.\n\nSome example queries are:\n\n* Query `display_name=Th*` returns accounts whose display_name\nstarts with \"Th\"\n* Query `display_name=\\\\\"Test String\\\\\"` returns groups with\ndisplay names that include both \"Test\" and \"String\"",
|
||||
"title": "Optional. Search criteria used to select the groups to return.\nIf no search criteria is specified then all groups will be\nreturned"
|
||||
},
|
||||
"id": {
|
||||
"type": "string",
|
||||
"title": "The id of the group to list members from"
|
||||
}
|
||||
}
|
||||
},
|
||||
"settingsListMembersResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -888,6 +898,19 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"settingsRemoveMemberRequest": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"group_id": {
|
||||
"type": "string",
|
||||
"title": "The id of the group to remove a member from"
|
||||
},
|
||||
"account_id": {
|
||||
"type": "string",
|
||||
"title": "The account id to remove"
|
||||
}
|
||||
}
|
||||
},
|
||||
"settingsUpdateAccountRequest": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
||||
Reference in New Issue
Block a user