Skip to content

Commit

Permalink
graph: Add stubs for education/classes endpoints
Browse files Browse the repository at this point in the history
The acutal backend implementations are still empty.
  • Loading branch information
rhafer committed Jan 9, 2023
1 parent 1a09211 commit 420d4fa
Show file tree
Hide file tree
Showing 10 changed files with 1,240 additions and 9 deletions.
11 changes: 11 additions & 0 deletions services/graph/pkg/identity/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,17 @@ type EducationBackend interface {
// RemoveUserFromEducationSchool removes a single member (by ID) from a school
RemoveUserFromEducationSchool(ctx context.Context, schoolID string, memberID string) error

// GetEducationClasses lists all classes
GetEducationClasses(ctx context.Context, queryParam url.Values) ([]*libregraph.EducationClass, error)
// GetEducationClasses reads a given class by id
GetEducationClass(ctx context.Context, namedOrID string, queryParam url.Values) (*libregraph.EducationClass, error)
// CreateEducationClass creates the supplied education class in the identity backend.
CreateEducationClass(ctx context.Context, class libregraph.EducationClass) (*libregraph.EducationClass, error)
// DeleteEducationClass deletes the supplied education class in the identity backend.
DeleteEducationClass(ctx context.Context, nameOrID string) error
// GetEducationClassMembers returns the EducationUser members for an EducationClass
GetEducationClassMembers(ctx context.Context, nameOrID string) ([]*libregraph.EducationUser, error)

// CreateEducationUser creates a given education user in the identity backend.
CreateEducationUser(ctx context.Context, user libregraph.EducationUser) (*libregraph.EducationUser, error)
// DeleteEducationUser deletes a given educationuser, identified by username or id, from the backend
Expand Down
25 changes: 25 additions & 0 deletions services/graph/pkg/identity/err_education.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,31 @@ func (i *ErrEducationBackend) RemoveUserFromEducationSchool(ctx context.Context,
return errNotImplemented
}

// GetEducationClasses implements the EducationBackend interface
func (i *ErrEducationBackend) GetEducationClasses(ctx context.Context, queryParam url.Values) ([]*libregraph.EducationClass, error) {
return nil, errNotImplemented
}

// GetEducationClass implements the EducationBackend interface
func (i *ErrEducationBackend) GetEducationClass(ctx context.Context, namedOrID string, queryParam url.Values) (*libregraph.EducationClass, error) {
return nil, errNotImplemented
}

// CreateEducationClass implements the EducationBackend interface
func (i *ErrEducationBackend) CreateEducationClass(ctx context.Context, class libregraph.EducationClass) (*libregraph.EducationClass, error) {
return nil, errNotImplemented
}

// DeleteEducationClass implements the EducationBackend interface
func (i *ErrEducationBackend) DeleteEducationClass(ctx context.Context, nameOrID string) error {
return errNotImplemented
}

// GetEducationClassMembers implements the EducationBackend interface
func (i *ErrEducationBackend) GetEducationClassMembers(ctx context.Context, nameOrID string) ([]*libregraph.EducationUser, error) {
return nil, errNotImplemented
}

// CreateEducationUser creates a given education user in the identity backend.
func (i *ErrEducationBackend) CreateEducationUser(ctx context.Context, user libregraph.EducationUser) (*libregraph.EducationUser, error) {
return nil, errNotImplemented
Expand Down
33 changes: 33 additions & 0 deletions services/graph/pkg/identity/ldap_education_class.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package identity

import (
"context"
"net/url"

libregraph "github.com/owncloud/libre-graph-api-go"
)

// GetEducationClasses implements the EducationBackend interface for the LDAP backend.
func (i *LDAP) GetEducationClasses(ctx context.Context, queryParam url.Values) ([]*libregraph.EducationClass, error) {
return nil, errNotImplemented
}

// CreateEducationClass implements the EducationBackend interface for the LDAP backend.
func (i *LDAP) CreateEducationClass(ctx context.Context, class libregraph.EducationClass) (*libregraph.EducationClass, error) {
return nil, errNotImplemented
}

// GetEducationClass implements the EducationBackend interface for the LDAP backend.
func (i *LDAP) GetEducationClass(ctx context.Context, namedOrID string, queryParam url.Values) (*libregraph.EducationClass, error) {
return nil, errNotImplemented
}

// DeleteEducationClass implements the EducationBackend interface for the LDAP backend.
func (i *LDAP) DeleteEducationClass(ctx context.Context, nameOrID string) error {
return errNotImplemented
}

// GetEducationClassMembers implements the EducationBackend interface for the LDAP backend.
func (i *LDAP) GetEducationClassMembers(ctx context.Context, nameOrID string) ([]*libregraph.EducationUser, error) {
return nil, errNotImplemented
}
106 changes: 106 additions & 0 deletions services/graph/pkg/identity/mocks/education_backend.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 420d4fa

Please sign in to comment.