All URIs are relative to https://ocis.ocis.rolling.owncloud.works/graph
Method | HTTP request | Description |
---|---|---|
AddTeacherToClass | Post /v1.0/education/classes/{class-id}/teachers/$ref | Assign a teacher to a class |
DeleteTeacherFromClass | Delete /v1.0/education/classes/{class-id}/teachers/{user-id}/$ref | Unassign user as teacher of a class |
GetTeachers | Get /v1.0/education/classes/{class-id}/teachers | Get the teachers for a class |
AddTeacherToClass(ctx, classId).ClassTeacherReference(classTeacherReference).Execute()
Assign a teacher to a class
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/owncloud/libre-graph-api-go"
)
func main() {
classId := "86948e45-96a6-43df-b83d-46e92afd30de" // string | key: id or externalId of class
classTeacherReference := *openapiclient.NewClassTeacherReference() // ClassTeacherReference | educationUser to be added as teacher
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
r, err := apiClient.EducationClassTeachersApi.AddTeacherToClass(context.Background(), classId).ClassTeacherReference(classTeacherReference).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `EducationClassTeachersApi.AddTeacherToClass``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
classId | string | key: id or externalId of class |
Other parameters are passed through a pointer to a apiAddTeacherToClassRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
classTeacherReference | ClassTeacherReference | educationUser to be added as teacher |
(empty response body)
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeleteTeacherFromClass(ctx, classId, userId).Execute()
Unassign user as teacher of a class
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/owncloud/libre-graph-api-go"
)
func main() {
classId := "classId_example" // string | key: id or externalId of class
userId := "90eedea1-dea1-90ee-a1de-ee90a1deee90" // string | key: id or username of the user to unassign as teacher
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
r, err := apiClient.EducationClassTeachersApi.DeleteTeacherFromClass(context.Background(), classId, userId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `EducationClassTeachersApi.DeleteTeacherFromClass``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
classId | string | key: id or externalId of class | |
userId | string | key: id or username of the user to unassign as teacher |
Other parameters are passed through a pointer to a apiDeleteTeacherFromClassRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
(empty response body)
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CollectionOfEducationUser GetTeachers(ctx, classId).Execute()
Get the teachers for a class
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/owncloud/libre-graph-api-go"
)
func main() {
classId := "86948e45-96a6-43df-b83d-46e92afd30de" // string | key: id or externalId of class
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.EducationClassTeachersApi.GetTeachers(context.Background(), classId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `EducationClassTeachersApi.GetTeachers``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetTeachers`: CollectionOfEducationUser
fmt.Fprintf(os.Stdout, "Response from `EducationClassTeachersApi.GetTeachers`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
classId | string | key: id or externalId of class |
Other parameters are passed through a pointer to a apiGetTeachersRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]