All URIs are relative to https://api.eduframe.nl/api/v1
| Method | HTTP request | Description |
|---|---|---|
| CreateMaterial | Post /materials | Create a material. |
| DeleteMaterialById | Delete /materials/{id} | Delete a material. |
| GetMaterials | Get /materials | Get all material records |
| UpdateMaterialById | Patch /materials/{id} | Update a material. |
MaterialWithIncludes CreateMaterial(ctx).CreateMaterialRequest(createMaterialRequest).Execute()
Create a material.
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
)
func main() {
createMaterialRequest := *openapiclient.NewCreateMaterialRequest("Name_example", int32(123)) // CreateMaterialRequest |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.MaterialsAPI.CreateMaterial(context.Background()).CreateMaterialRequest(createMaterialRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `MaterialsAPI.CreateMaterial``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateMaterial`: MaterialWithIncludes
fmt.Fprintf(os.Stdout, "Response from `MaterialsAPI.CreateMaterial`: %v\n", resp)
}Other parameters are passed through a pointer to a apiCreateMaterialRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| createMaterialRequest | CreateMaterialRequest |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeleteMaterialById(ctx, id).Execute()
Delete a material.
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
)
func main() {
id := int32(56) // int32 |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
r, err := apiClient.MaterialsAPI.DeleteMaterialById(context.Background(), id).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `MaterialsAPI.DeleteMaterialById``: %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. | |
| id | int32 |
Other parameters are passed through a pointer to a apiDeleteMaterialByIdRequest 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]
[]MaterialWithIncludes GetMaterials(ctx).Cursor(cursor).PerPage(perPage).Execute()
Get all material records
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
)
func main() {
cursor := "cursor_example" // string | **Note**: It's almost never necessary to use this parameter directly, the URL should be retrieved from the `Link` header. The cursor used to fetch the next result set. (optional)
perPage := int32(10) // int32 | The number of results to retrieve for this page. (optional) (default to 25)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.MaterialsAPI.GetMaterials(context.Background()).Cursor(cursor).PerPage(perPage).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `MaterialsAPI.GetMaterials``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetMaterials`: []MaterialWithIncludes
fmt.Fprintf(os.Stdout, "Response from `MaterialsAPI.GetMaterials`: %v\n", resp)
}Other parameters are passed through a pointer to a apiGetMaterialsRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| cursor | string | Note: It's almost never necessary to use this parameter directly, the URL should be retrieved from the `Link` header. The cursor used to fetch the next result set. | |
| perPage | int32 | The number of results to retrieve for this page. | [default to 25] |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
MaterialWithIncludes UpdateMaterialById(ctx, id).UpdateMaterialByIdRequest(updateMaterialByIdRequest).Execute()
Update a material.
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
)
func main() {
id := int32(56) // int32 |
updateMaterialByIdRequest := *openapiclient.NewUpdateMaterialByIdRequest() // UpdateMaterialByIdRequest |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.MaterialsAPI.UpdateMaterialById(context.Background(), id).UpdateMaterialByIdRequest(updateMaterialByIdRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `MaterialsAPI.UpdateMaterialById``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `UpdateMaterialById`: MaterialWithIncludes
fmt.Fprintf(os.Stdout, "Response from `MaterialsAPI.UpdateMaterialById`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| id | int32 |
Other parameters are passed through a pointer to a apiUpdateMaterialByIdRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
updateMaterialByIdRequest | UpdateMaterialByIdRequest | |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]