Remove "accounts" service

This commit is contained in:
Ralf Haferkamp
2022-05-11 15:29:34 +02:00
committed by Ralf Haferkamp
parent 5ba1b8f2c1
commit d25aa7b20f
123 changed files with 80 additions and 28807 deletions
File diff suppressed because it is too large Load Diff
@@ -1,16 +0,0 @@
// Code generated by protoc-gen-micro. DO NOT EDIT.
// source: ocis/messages/accounts/v0/accounts.proto
package v0
import (
fmt "fmt"
proto "google.golang.org/protobuf/proto"
_ "google.golang.org/protobuf/types/known/timestamppb"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
@@ -1,191 +0,0 @@
// Code generated by protoc-gen-microweb. DO NOT EDIT.
// source: v0.proto
package v0
import (
"bytes"
"encoding/json"
"github.com/golang/protobuf/jsonpb"
)
// AccountJSONMarshaler describes the default jsonpb.Marshaler used by all
// instances of Account. This struct is safe to replace or modify but
// should not be done so concurrently.
var AccountJSONMarshaler = new(jsonpb.Marshaler)
// MarshalJSON satisfies the encoding/json Marshaler interface. This method
// uses the more correct jsonpb package to correctly marshal the message.
func (m *Account) MarshalJSON() ([]byte, error) {
if m == nil {
return json.Marshal(nil)
}
buf := &bytes.Buffer{}
if err := AccountJSONMarshaler.Marshal(buf, m); err != nil {
return nil, err
}
return buf.Bytes(), nil
}
var _ json.Marshaler = (*Account)(nil)
// AccountJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all
// instances of Account. This struct is safe to replace or modify but
// should not be done so concurrently.
var AccountJSONUnmarshaler = new(jsonpb.Unmarshaler)
// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method
// uses the more correct jsonpb package to correctly unmarshal the message.
func (m *Account) UnmarshalJSON(b []byte) error {
return AccountJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m)
}
var _ json.Unmarshaler = (*Account)(nil)
// IdentitiesJSONMarshaler describes the default jsonpb.Marshaler used by all
// instances of Identities. This struct is safe to replace or modify but
// should not be done so concurrently.
var IdentitiesJSONMarshaler = new(jsonpb.Marshaler)
// MarshalJSON satisfies the encoding/json Marshaler interface. This method
// uses the more correct jsonpb package to correctly marshal the message.
func (m *Identities) MarshalJSON() ([]byte, error) {
if m == nil {
return json.Marshal(nil)
}
buf := &bytes.Buffer{}
if err := IdentitiesJSONMarshaler.Marshal(buf, m); err != nil {
return nil, err
}
return buf.Bytes(), nil
}
var _ json.Marshaler = (*Identities)(nil)
// IdentitiesJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all
// instances of Identities. This struct is safe to replace or modify but
// should not be done so concurrently.
var IdentitiesJSONUnmarshaler = new(jsonpb.Unmarshaler)
// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method
// uses the more correct jsonpb package to correctly unmarshal the message.
func (m *Identities) UnmarshalJSON(b []byte) error {
return IdentitiesJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m)
}
var _ json.Unmarshaler = (*Identities)(nil)
// PasswordProfileJSONMarshaler describes the default jsonpb.Marshaler used by all
// instances of PasswordProfile. This struct is safe to replace or modify but
// should not be done so concurrently.
var PasswordProfileJSONMarshaler = new(jsonpb.Marshaler)
// MarshalJSON satisfies the encoding/json Marshaler interface. This method
// uses the more correct jsonpb package to correctly marshal the message.
func (m *PasswordProfile) MarshalJSON() ([]byte, error) {
if m == nil {
return json.Marshal(nil)
}
buf := &bytes.Buffer{}
if err := PasswordProfileJSONMarshaler.Marshal(buf, m); err != nil {
return nil, err
}
return buf.Bytes(), nil
}
var _ json.Marshaler = (*PasswordProfile)(nil)
// PasswordProfileJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all
// instances of PasswordProfile. This struct is safe to replace or modify but
// should not be done so concurrently.
var PasswordProfileJSONUnmarshaler = new(jsonpb.Unmarshaler)
// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method
// uses the more correct jsonpb package to correctly unmarshal the message.
func (m *PasswordProfile) UnmarshalJSON(b []byte) error {
return PasswordProfileJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m)
}
var _ json.Unmarshaler = (*PasswordProfile)(nil)
// GroupJSONMarshaler describes the default jsonpb.Marshaler used by all
// instances of Group. This struct is safe to replace or modify but
// should not be done so concurrently.
var GroupJSONMarshaler = new(jsonpb.Marshaler)
// MarshalJSON satisfies the encoding/json Marshaler interface. This method
// uses the more correct jsonpb package to correctly marshal the message.
func (m *Group) MarshalJSON() ([]byte, error) {
if m == nil {
return json.Marshal(nil)
}
buf := &bytes.Buffer{}
if err := GroupJSONMarshaler.Marshal(buf, m); err != nil {
return nil, err
}
return buf.Bytes(), nil
}
var _ json.Marshaler = (*Group)(nil)
// GroupJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all
// instances of Group. This struct is safe to replace or modify but
// should not be done so concurrently.
var GroupJSONUnmarshaler = new(jsonpb.Unmarshaler)
// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method
// uses the more correct jsonpb package to correctly unmarshal the message.
func (m *Group) UnmarshalJSON(b []byte) error {
return GroupJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m)
}
var _ json.Unmarshaler = (*Group)(nil)
// OnPremisesProvisioningErrorJSONMarshaler describes the default jsonpb.Marshaler used by all
// instances of OnPremisesProvisioningError. This struct is safe to replace or modify but
// should not be done so concurrently.
var OnPremisesProvisioningErrorJSONMarshaler = new(jsonpb.Marshaler)
// MarshalJSON satisfies the encoding/json Marshaler interface. This method
// uses the more correct jsonpb package to correctly marshal the message.
func (m *OnPremisesProvisioningError) MarshalJSON() ([]byte, error) {
if m == nil {
return json.Marshal(nil)
}
buf := &bytes.Buffer{}
if err := OnPremisesProvisioningErrorJSONMarshaler.Marshal(buf, m); err != nil {
return nil, err
}
return buf.Bytes(), nil
}
var _ json.Marshaler = (*OnPremisesProvisioningError)(nil)
// OnPremisesProvisioningErrorJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all
// instances of OnPremisesProvisioningError. This struct is safe to replace or modify but
// should not be done so concurrently.
var OnPremisesProvisioningErrorJSONUnmarshaler = new(jsonpb.Unmarshaler)
// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method
// uses the more correct jsonpb package to correctly unmarshal the message.
func (m *OnPremisesProvisioningError) UnmarshalJSON(b []byte) error {
return OnPremisesProvisioningErrorJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m)
}
var _ json.Unmarshaler = (*OnPremisesProvisioningError)(nil)
@@ -1,43 +0,0 @@
{
"swagger": "2.0",
"info": {
"title": "ocis/messages/accounts/v0/accounts.proto",
"version": "version not set"
},
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"paths": {},
"definitions": {
"protobufAny": {
"type": "object",
"properties": {
"@type": {
"type": "string"
}
},
"additionalProperties": {}
},
"rpcStatus": {
"type": "object",
"properties": {
"code": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"$ref": "#/definitions/protobufAny"
}
}
}
}
}
}
@@ -1,90 +0,0 @@
package v0
import (
context "context"
accountsmsg "github.com/owncloud/ocis/v2/protogen/gen/ocis/messages/accounts/v0"
client "go-micro.dev/v4/client"
empty "google.golang.org/protobuf/types/known/emptypb"
)
// MockAccountsService can be used to write tests
/*
To create a mock overwrite the functions of an instance like this:
```go
func mockAccSvc(retErr bool) proto.AccountsService {
if retErr {
return &proto.MockAccountsService{
ListFunc: func(ctx context.Context, in *proto.ListAccountsRequest, opts ...client.CallOption) (out *proto.ListAccountsResponse, err error) {
return nil, fmt.Errorf("error returned by mockAccountsService LIST")
},
}
}
return &proto.MockAccountsService{
ListFunc: func(ctx context.Context, in *proto.ListAccountsRequest, opts ...client.CallOption) (out *proto.ListAccountsResponse, err error) {
return &proto.ListAccountsResponse{
Accounts: []*proto.Account{
{
Id: "yay",
},
},
}, nil
},
}
}
```
*/
type MockAccountsService struct {
ListFunc func(ctx context.Context, in *ListAccountsRequest, opts ...client.CallOption) (*ListAccountsResponse, error)
GetFunc func(ctx context.Context, in *GetAccountRequest, opts ...client.CallOption) (*accountsmsg.Account, error)
CreateFunc func(ctx context.Context, in *CreateAccountRequest, opts ...client.CallOption) (*accountsmsg.Account, error)
UpdateFunc func(ctx context.Context, in *UpdateAccountRequest, opts ...client.CallOption) (*accountsmsg.Account, error)
DeleteFunc func(ctx context.Context, in *DeleteAccountRequest, opts ...client.CallOption) (*empty.Empty, error)
}
// ListAccounts will panic if the function has been called, but not mocked
func (m MockAccountsService) ListAccounts(ctx context.Context, in *ListAccountsRequest, opts ...client.CallOption) (*ListAccountsResponse, error) {
if m.ListFunc != nil {
return m.ListFunc(ctx, in, opts...)
}
panic("ListFunc was called in test but not mocked")
}
// GetAccount will panic if the function has been called, but not mocked
func (m MockAccountsService) GetAccount(ctx context.Context, in *GetAccountRequest, opts ...client.CallOption) (*accountsmsg.Account, error) {
if m.GetFunc != nil {
return m.GetFunc(ctx, in, opts...)
}
panic("GetFunc was called in test but not mocked")
}
// CreateAccount will panic if the function has been called, but not mocked
func (m MockAccountsService) CreateAccount(ctx context.Context, in *CreateAccountRequest, opts ...client.CallOption) (*accountsmsg.Account, error) {
if m.CreateFunc != nil {
return m.CreateFunc(ctx, in, opts...)
}
panic("CreateFunc was called in test but not mocked")
}
// UpdateAccount will panic if the function has been called, but not mocked
func (m MockAccountsService) UpdateAccount(ctx context.Context, in *UpdateAccountRequest, opts ...client.CallOption) (*accountsmsg.Account, error) {
if m.UpdateFunc != nil {
return m.UpdateFunc(ctx, in, opts...)
}
panic("UpdateFunc was called in test but not mocked")
}
// DeleteAccount will panic if the function has been called, but not mocked
func (m MockAccountsService) DeleteAccount(ctx context.Context, in *DeleteAccountRequest, opts ...client.CallOption) (*empty.Empty, error) {
if m.DeleteFunc != nil {
return m.DeleteFunc(ctx, in, opts...)
}
panic("DeleteFunc was called in test but not mocked")
}
File diff suppressed because it is too large Load Diff
@@ -1,622 +0,0 @@
// Code generated by protoc-gen-micro. DO NOT EDIT.
// source: ocis/services/accounts/v0/accounts.proto
package v0
import (
fmt "fmt"
_ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options"
v0 "github.com/owncloud/ocis/v2/protogen/gen/ocis/messages/accounts/v0"
_ "google.golang.org/genproto/googleapis/api/annotations"
proto "google.golang.org/protobuf/proto"
emptypb "google.golang.org/protobuf/types/known/emptypb"
_ "google.golang.org/protobuf/types/known/fieldmaskpb"
math "math"
)
import (
context "context"
api "go-micro.dev/v4/api"
client "go-micro.dev/v4/client"
server "go-micro.dev/v4/server"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// 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{
{
Name: "AccountsService.ListAccounts",
Path: []string{"/api/v0/accounts/accounts-list"},
Method: []string{"POST"},
Body: "*",
Handler: "rpc",
},
{
Name: "AccountsService.GetAccount",
Path: []string{"/api/v0/accounts/accounts-get"},
Method: []string{"POST"},
Body: "*",
Handler: "rpc",
},
{
Name: "AccountsService.CreateAccount",
Path: []string{"/api/v0/accounts/accounts-create"},
Method: []string{"POST"},
Body: "*",
Handler: "rpc",
},
{
Name: "AccountsService.UpdateAccount",
Path: []string{"/api/v0/accounts/accounts-update"},
Method: []string{"POST"},
Body: "*",
Handler: "rpc",
},
{
Name: "AccountsService.DeleteAccount",
Path: []string{"/api/v0/accounts/accounts-delete"},
Method: []string{"POST"},
Body: "*",
Handler: "rpc",
},
}
}
// Client API for AccountsService service
type AccountsService interface {
// Lists accounts
ListAccounts(ctx context.Context, in *ListAccountsRequest, opts ...client.CallOption) (*ListAccountsResponse, error)
// Gets an account
GetAccount(ctx context.Context, in *GetAccountRequest, opts ...client.CallOption) (*v0.Account, error)
// Creates an account
CreateAccount(ctx context.Context, in *CreateAccountRequest, opts ...client.CallOption) (*v0.Account, error)
// Updates an account
UpdateAccount(ctx context.Context, in *UpdateAccountRequest, opts ...client.CallOption) (*v0.Account, error)
// Deletes an account
DeleteAccount(ctx context.Context, in *DeleteAccountRequest, opts ...client.CallOption) (*emptypb.Empty, error)
}
type accountsService struct {
c client.Client
name string
}
func NewAccountsService(name string, c client.Client) AccountsService {
return &accountsService{
c: c,
name: name,
}
}
func (c *accountsService) ListAccounts(ctx context.Context, in *ListAccountsRequest, opts ...client.CallOption) (*ListAccountsResponse, error) {
req := c.c.NewRequest(c.name, "AccountsService.ListAccounts", in)
out := new(ListAccountsResponse)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *accountsService) GetAccount(ctx context.Context, in *GetAccountRequest, opts ...client.CallOption) (*v0.Account, error) {
req := c.c.NewRequest(c.name, "AccountsService.GetAccount", in)
out := new(v0.Account)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *accountsService) CreateAccount(ctx context.Context, in *CreateAccountRequest, opts ...client.CallOption) (*v0.Account, error) {
req := c.c.NewRequest(c.name, "AccountsService.CreateAccount", in)
out := new(v0.Account)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *accountsService) UpdateAccount(ctx context.Context, in *UpdateAccountRequest, opts ...client.CallOption) (*v0.Account, error) {
req := c.c.NewRequest(c.name, "AccountsService.UpdateAccount", in)
out := new(v0.Account)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *accountsService) DeleteAccount(ctx context.Context, in *DeleteAccountRequest, opts ...client.CallOption) (*emptypb.Empty, error) {
req := c.c.NewRequest(c.name, "AccountsService.DeleteAccount", in)
out := new(emptypb.Empty)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// Server API for AccountsService service
type AccountsServiceHandler interface {
// Lists accounts
ListAccounts(context.Context, *ListAccountsRequest, *ListAccountsResponse) error
// Gets an account
GetAccount(context.Context, *GetAccountRequest, *v0.Account) error
// Creates an account
CreateAccount(context.Context, *CreateAccountRequest, *v0.Account) error
// Updates an account
UpdateAccount(context.Context, *UpdateAccountRequest, *v0.Account) error
// Deletes an account
DeleteAccount(context.Context, *DeleteAccountRequest, *emptypb.Empty) error
}
func RegisterAccountsServiceHandler(s server.Server, hdlr AccountsServiceHandler, opts ...server.HandlerOption) error {
type accountsService interface {
ListAccounts(ctx context.Context, in *ListAccountsRequest, out *ListAccountsResponse) error
GetAccount(ctx context.Context, in *GetAccountRequest, out *v0.Account) error
CreateAccount(ctx context.Context, in *CreateAccountRequest, out *v0.Account) error
UpdateAccount(ctx context.Context, in *UpdateAccountRequest, out *v0.Account) error
DeleteAccount(ctx context.Context, in *DeleteAccountRequest, out *emptypb.Empty) error
}
type AccountsService struct {
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...))
}
type accountsServiceHandler struct {
AccountsServiceHandler
}
func (h *accountsServiceHandler) ListAccounts(ctx context.Context, in *ListAccountsRequest, out *ListAccountsResponse) error {
return h.AccountsServiceHandler.ListAccounts(ctx, in, out)
}
func (h *accountsServiceHandler) GetAccount(ctx context.Context, in *GetAccountRequest, out *v0.Account) error {
return h.AccountsServiceHandler.GetAccount(ctx, in, out)
}
func (h *accountsServiceHandler) CreateAccount(ctx context.Context, in *CreateAccountRequest, out *v0.Account) error {
return h.AccountsServiceHandler.CreateAccount(ctx, in, out)
}
func (h *accountsServiceHandler) UpdateAccount(ctx context.Context, in *UpdateAccountRequest, out *v0.Account) error {
return h.AccountsServiceHandler.UpdateAccount(ctx, in, out)
}
func (h *accountsServiceHandler) DeleteAccount(ctx context.Context, in *DeleteAccountRequest, out *emptypb.Empty) error {
return h.AccountsServiceHandler.DeleteAccount(ctx, in, out)
}
// Api Endpoints for GroupsService service
func NewGroupsServiceEndpoints() []*api.Endpoint {
return []*api.Endpoint{
{
Name: "GroupsService.ListGroups",
Path: []string{"/api/v0/accounts/groups-list"},
Method: []string{"POST"},
Body: "*",
Handler: "rpc",
},
{
Name: "GroupsService.GetGroup",
Path: []string{"/api/v0/accounts/groups-get"},
Method: []string{"POST"},
Body: "*",
Handler: "rpc",
},
{
Name: "GroupsService.CreateGroup",
Path: []string{"/api/v0/accounts/groups-create"},
Method: []string{"POST"},
Body: "*",
Handler: "rpc",
},
{
Name: "GroupsService.UpdateGroup",
Path: []string{"/api/v0/accounts/groups-update"},
Method: []string{"POST"},
Body: "*",
Handler: "rpc",
},
{
Name: "GroupsService.DeleteGroup",
Path: []string{"/api/v0/accounts/groups-delete"},
Method: []string{"POST"},
Body: "*",
Handler: "rpc",
},
{
Name: "GroupsService.AddMember",
Path: []string{"/api/v0/groups/{group_id=*}/members/$ref"},
Method: []string{"POST"},
Body: "*",
Handler: "rpc",
},
{
Name: "GroupsService.RemoveMember",
Path: []string{"/api/v0/groups/{group_id=*}/members/{account_id}/$ref"},
Method: []string{"POST"},
Body: "*",
Handler: "rpc",
},
{
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 {
// Lists groups
ListGroups(ctx context.Context, in *ListGroupsRequest, opts ...client.CallOption) (*ListGroupsResponse, error)
// Gets an groups
GetGroup(ctx context.Context, in *GetGroupRequest, opts ...client.CallOption) (*v0.Group, error)
// Creates a group
CreateGroup(ctx context.Context, in *CreateGroupRequest, opts ...client.CallOption) (*v0.Group, error)
// Updates a group
UpdateGroup(ctx context.Context, in *UpdateGroupRequest, opts ...client.CallOption) (*v0.Group, error)
// Deletes a group
DeleteGroup(ctx context.Context, in *DeleteGroupRequest, opts ...client.CallOption) (*emptypb.Empty, error)
// group:addmember https://docs.microsoft.com/en-us/graph/api/group-post-members?view=graph-rest-1.0&tabs=http
AddMember(ctx context.Context, in *AddMemberRequest, opts ...client.CallOption) (*v0.Group, error)
// group:removemember https://docs.microsoft.com/en-us/graph/api/group-delete-members?view=graph-rest-1.0
RemoveMember(ctx context.Context, in *RemoveMemberRequest, opts ...client.CallOption) (*v0.Group, error)
// group:listmembers https://docs.microsoft.com/en-us/graph/api/group-list-members?view=graph-rest-1.0
ListMembers(ctx context.Context, in *ListMembersRequest, opts ...client.CallOption) (*ListMembersResponse, error)
}
type groupsService struct {
c client.Client
name string
}
func NewGroupsService(name string, c client.Client) GroupsService {
return &groupsService{
c: c,
name: name,
}
}
func (c *groupsService) ListGroups(ctx context.Context, in *ListGroupsRequest, opts ...client.CallOption) (*ListGroupsResponse, error) {
req := c.c.NewRequest(c.name, "GroupsService.ListGroups", in)
out := new(ListGroupsResponse)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *groupsService) GetGroup(ctx context.Context, in *GetGroupRequest, opts ...client.CallOption) (*v0.Group, error) {
req := c.c.NewRequest(c.name, "GroupsService.GetGroup", in)
out := new(v0.Group)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *groupsService) CreateGroup(ctx context.Context, in *CreateGroupRequest, opts ...client.CallOption) (*v0.Group, error) {
req := c.c.NewRequest(c.name, "GroupsService.CreateGroup", in)
out := new(v0.Group)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *groupsService) UpdateGroup(ctx context.Context, in *UpdateGroupRequest, opts ...client.CallOption) (*v0.Group, error) {
req := c.c.NewRequest(c.name, "GroupsService.UpdateGroup", in)
out := new(v0.Group)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *groupsService) DeleteGroup(ctx context.Context, in *DeleteGroupRequest, opts ...client.CallOption) (*emptypb.Empty, error) {
req := c.c.NewRequest(c.name, "GroupsService.DeleteGroup", in)
out := new(emptypb.Empty)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *groupsService) AddMember(ctx context.Context, in *AddMemberRequest, opts ...client.CallOption) (*v0.Group, error) {
req := c.c.NewRequest(c.name, "GroupsService.AddMember", in)
out := new(v0.Group)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *groupsService) RemoveMember(ctx context.Context, in *RemoveMemberRequest, opts ...client.CallOption) (*v0.Group, error) {
req := c.c.NewRequest(c.name, "GroupsService.RemoveMember", in)
out := new(v0.Group)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *groupsService) ListMembers(ctx context.Context, in *ListMembersRequest, opts ...client.CallOption) (*ListMembersResponse, error) {
req := c.c.NewRequest(c.name, "GroupsService.ListMembers", in)
out := new(ListMembersResponse)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// Server API for GroupsService service
type GroupsServiceHandler interface {
// Lists groups
ListGroups(context.Context, *ListGroupsRequest, *ListGroupsResponse) error
// Gets an groups
GetGroup(context.Context, *GetGroupRequest, *v0.Group) error
// Creates a group
CreateGroup(context.Context, *CreateGroupRequest, *v0.Group) error
// Updates a group
UpdateGroup(context.Context, *UpdateGroupRequest, *v0.Group) error
// Deletes a group
DeleteGroup(context.Context, *DeleteGroupRequest, *emptypb.Empty) error
// group:addmember https://docs.microsoft.com/en-us/graph/api/group-post-members?view=graph-rest-1.0&tabs=http
AddMember(context.Context, *AddMemberRequest, *v0.Group) error
// group:removemember https://docs.microsoft.com/en-us/graph/api/group-delete-members?view=graph-rest-1.0
RemoveMember(context.Context, *RemoveMemberRequest, *v0.Group) error
// group:listmembers https://docs.microsoft.com/en-us/graph/api/group-list-members?view=graph-rest-1.0
ListMembers(context.Context, *ListMembersRequest, *ListMembersResponse) error
}
func RegisterGroupsServiceHandler(s server.Server, hdlr GroupsServiceHandler, opts ...server.HandlerOption) error {
type groupsService interface {
ListGroups(ctx context.Context, in *ListGroupsRequest, out *ListGroupsResponse) error
GetGroup(ctx context.Context, in *GetGroupRequest, out *v0.Group) error
CreateGroup(ctx context.Context, in *CreateGroupRequest, out *v0.Group) error
UpdateGroup(ctx context.Context, in *UpdateGroupRequest, out *v0.Group) error
DeleteGroup(ctx context.Context, in *DeleteGroupRequest, out *emptypb.Empty) error
AddMember(ctx context.Context, in *AddMemberRequest, out *v0.Group) error
RemoveMember(ctx context.Context, in *RemoveMemberRequest, out *v0.Group) error
ListMembers(ctx context.Context, in *ListMembersRequest, out *ListMembersResponse) error
}
type GroupsService struct {
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...))
}
type groupsServiceHandler struct {
GroupsServiceHandler
}
func (h *groupsServiceHandler) ListGroups(ctx context.Context, in *ListGroupsRequest, out *ListGroupsResponse) error {
return h.GroupsServiceHandler.ListGroups(ctx, in, out)
}
func (h *groupsServiceHandler) GetGroup(ctx context.Context, in *GetGroupRequest, out *v0.Group) error {
return h.GroupsServiceHandler.GetGroup(ctx, in, out)
}
func (h *groupsServiceHandler) CreateGroup(ctx context.Context, in *CreateGroupRequest, out *v0.Group) error {
return h.GroupsServiceHandler.CreateGroup(ctx, in, out)
}
func (h *groupsServiceHandler) UpdateGroup(ctx context.Context, in *UpdateGroupRequest, out *v0.Group) error {
return h.GroupsServiceHandler.UpdateGroup(ctx, in, out)
}
func (h *groupsServiceHandler) DeleteGroup(ctx context.Context, in *DeleteGroupRequest, out *emptypb.Empty) error {
return h.GroupsServiceHandler.DeleteGroup(ctx, in, out)
}
func (h *groupsServiceHandler) AddMember(ctx context.Context, in *AddMemberRequest, out *v0.Group) error {
return h.GroupsServiceHandler.AddMember(ctx, in, out)
}
func (h *groupsServiceHandler) RemoveMember(ctx context.Context, in *RemoveMemberRequest, out *v0.Group) error {
return h.GroupsServiceHandler.RemoveMember(ctx, in, out)
}
func (h *groupsServiceHandler) ListMembers(ctx context.Context, in *ListMembersRequest, out *ListMembersResponse) error {
return h.GroupsServiceHandler.ListMembers(ctx, in, out)
}
// Api Endpoints for IndexService service
func NewIndexServiceEndpoints() []*api.Endpoint {
return []*api.Endpoint{
{
Name: "IndexService.RebuildIndex",
Path: []string{"/api/v0/index/rebuild"},
Method: []string{"POST"},
Body: "*",
Handler: "rpc",
},
}
}
// Client API for IndexService service
type IndexService interface {
RebuildIndex(ctx context.Context, in *RebuildIndexRequest, opts ...client.CallOption) (*RebuildIndexResponse, error)
}
type indexService struct {
c client.Client
name string
}
func NewIndexService(name string, c client.Client) IndexService {
return &indexService{
c: c,
name: name,
}
}
func (c *indexService) RebuildIndex(ctx context.Context, in *RebuildIndexRequest, opts ...client.CallOption) (*RebuildIndexResponse, error) {
req := c.c.NewRequest(c.name, "IndexService.RebuildIndex", in)
out := new(RebuildIndexResponse)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// Server API for IndexService service
type IndexServiceHandler interface {
RebuildIndex(context.Context, *RebuildIndexRequest, *RebuildIndexResponse) error
}
func RegisterIndexServiceHandler(s server.Server, hdlr IndexServiceHandler, opts ...server.HandlerOption) error {
type indexService interface {
RebuildIndex(ctx context.Context, in *RebuildIndexRequest, out *RebuildIndexResponse) error
}
type IndexService struct {
indexService
}
h := &indexServiceHandler{hdlr}
opts = append(opts, api.WithEndpoint(&api.Endpoint{
Name: "IndexService.RebuildIndex",
Path: []string{"/api/v0/index/rebuild"},
Method: []string{"POST"},
Body: "*",
Handler: "rpc",
}))
return s.Handle(s.NewHandler(&IndexService{h}, opts...))
}
type indexServiceHandler struct {
IndexServiceHandler
}
func (h *indexServiceHandler) RebuildIndex(ctx context.Context, in *RebuildIndexRequest, out *RebuildIndexResponse) error {
return h.IndexServiceHandler.RebuildIndex(ctx, in, out)
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff