Skip to content

Latest commit

 

History

History
359 lines (227 loc) · 9.82 KB

File metadata and controls

359 lines (227 loc) · 9.82 KB

\ProgramElementsAPI

All URIs are relative to https://api.eduframe.nl/api/v1

Method HTTP request Description
CreateProgramElement Post /program/elements Create a program element
DeleteProgramElementById Delete /program/elements/{id} Delete a element
GetProgramElementById Get /program/elements/{id} Get an element
GetProgramElements Get /program/elements Get all elements
UpdateProgramElementById Patch /program/elements/{id} Update an element

CreateProgramElement

Element CreateProgramElement(ctx).CreateProgramElementRequest(createProgramElementRequest).Execute()

Create a program element

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
)

func main() {
	createProgramElementRequest := *openapiclient.NewCreateProgramElementRequest(int32(123), int32(123)) // CreateProgramElementRequest | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.ProgramElementsAPI.CreateProgramElement(context.Background()).CreateProgramElementRequest(createProgramElementRequest).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ProgramElementsAPI.CreateProgramElement``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `CreateProgramElement`: Element
	fmt.Fprintf(os.Stdout, "Response from `ProgramElementsAPI.CreateProgramElement`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiCreateProgramElementRequest struct via the builder pattern

Name Type Description Notes
createProgramElementRequest CreateProgramElementRequest

Return type

Element

Authorization

Bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

DeleteProgramElementById

DeleteProgramElementById(ctx, id).Execute()

Delete a element

Example

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.ProgramElementsAPI.DeleteProgramElementById(context.Background(), id).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ProgramElementsAPI.DeleteProgramElementById``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id int32

Other Parameters

Other parameters are passed through a pointer to a apiDeleteProgramElementByIdRequest struct via the builder pattern

Name Type Description Notes

Return type

(empty response body)

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetProgramElementById

Element GetProgramElementById(ctx, id).Execute()

Get an element

Example

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)
	resp, r, err := apiClient.ProgramElementsAPI.GetProgramElementById(context.Background(), id).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ProgramElementsAPI.GetProgramElementById``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetProgramElementById`: Element
	fmt.Fprintf(os.Stdout, "Response from `ProgramElementsAPI.GetProgramElementById`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id int32

Other Parameters

Other parameters are passed through a pointer to a apiGetProgramElementByIdRequest struct via the builder pattern

Name Type Description Notes

Return type

Element

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetProgramElements

[]Element GetProgramElements(ctx).EditionId(editionId).Cursor(cursor).PerPage(perPage).Execute()

Get all elements

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
)

func main() {
	editionId := int32(56) // int32 | Filter results on edition_id (optional)
	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.ProgramElementsAPI.GetProgramElements(context.Background()).EditionId(editionId).Cursor(cursor).PerPage(perPage).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ProgramElementsAPI.GetProgramElements``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetProgramElements`: []Element
	fmt.Fprintf(os.Stdout, "Response from `ProgramElementsAPI.GetProgramElements`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiGetProgramElementsRequest struct via the builder pattern

Name Type Description Notes
editionId int32 Filter results on edition_id
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]

Return type

[]Element

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UpdateProgramElementById

Element UpdateProgramElementById(ctx, id).UpdateProgramElementByIdRequest(updateProgramElementByIdRequest).Execute()

Update an element

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
)

func main() {
	id := int32(56) // int32 | 
	updateProgramElementByIdRequest := *openapiclient.NewUpdateProgramElementByIdRequest() // UpdateProgramElementByIdRequest | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.ProgramElementsAPI.UpdateProgramElementById(context.Background(), id).UpdateProgramElementByIdRequest(updateProgramElementByIdRequest).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ProgramElementsAPI.UpdateProgramElementById``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `UpdateProgramElementById`: Element
	fmt.Fprintf(os.Stdout, "Response from `ProgramElementsAPI.UpdateProgramElementById`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id int32

Other Parameters

Other parameters are passed through a pointer to a apiUpdateProgramElementByIdRequest struct via the builder pattern

Name Type Description Notes

updateProgramElementByIdRequest | UpdateProgramElementByIdRequest | |

Return type

Element

Authorization

Bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]