Skip to content

Latest commit

 

History

History
357 lines (225 loc) · 9.44 KB

File metadata and controls

357 lines (225 loc) · 9.44 KB

\ProgramProgramsAPI

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

Method HTTP request Description
CreateProgram Post /program/programs Create a program
DeleteProgramById Delete /program/programs/{id} Delete a program
GetProgramById Get /program/programs/{id} Get a program
GetPrograms Get /program/programs Get all programs
UpdateProgramById Patch /program/programs/{id} Update a program

CreateProgram

ProgramWithIncludes CreateProgram(ctx).ProgramProgramPayload(programProgramPayload).Execute()

Create a program

Example

package main

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

func main() {
	programProgramPayload := *openapiclient.NewProgramProgramPayload("Name_example", int32(123), "CostScheme_example") // ProgramProgramPayload | 

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

Path Parameters

Other Parameters

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

Name Type Description Notes
programProgramPayload ProgramProgramPayload

Return type

ProgramWithIncludes

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]

DeleteProgramById

DeleteProgramById(ctx, id).Execute()

Delete a program

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.ProgramProgramsAPI.DeleteProgramById(context.Background(), id).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ProgramProgramsAPI.DeleteProgramById``: %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 apiDeleteProgramByIdRequest 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]

GetProgramById

ProgramWithIncludes GetProgramById(ctx, id).Execute()

Get a program

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.ProgramProgramsAPI.GetProgramById(context.Background(), id).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ProgramProgramsAPI.GetProgramById``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetProgramById`: ProgramWithIncludes
	fmt.Fprintf(os.Stdout, "Response from `ProgramProgramsAPI.GetProgramById`: %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 apiGetProgramByIdRequest struct via the builder pattern

Name Type Description Notes

Return type

ProgramWithIncludes

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]

GetPrograms

[]ProgramWithIncludes GetPrograms(ctx).Cursor(cursor).PerPage(perPage).Execute()

Get all programs

Example

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.ProgramProgramsAPI.GetPrograms(context.Background()).Cursor(cursor).PerPage(perPage).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ProgramProgramsAPI.GetPrograms``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetPrograms`: []ProgramWithIncludes
	fmt.Fprintf(os.Stdout, "Response from `ProgramProgramsAPI.GetPrograms`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiGetProgramsRequest 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]

Return type

[]ProgramWithIncludes

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]

UpdateProgramById

ProgramWithIncludes UpdateProgramById(ctx, id).ProgramProgramPatchPayload(programProgramPatchPayload).Execute()

Update a program

Example

package main

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

func main() {
	id := int32(56) // int32 | 
	programProgramPatchPayload := *openapiclient.NewProgramProgramPatchPayload() // ProgramProgramPatchPayload | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.ProgramProgramsAPI.UpdateProgramById(context.Background(), id).ProgramProgramPatchPayload(programProgramPatchPayload).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ProgramProgramsAPI.UpdateProgramById``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `UpdateProgramById`: ProgramWithIncludes
	fmt.Fprintf(os.Stdout, "Response from `ProgramProgramsAPI.UpdateProgramById`: %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 apiUpdateProgramByIdRequest struct via the builder pattern

Name Type Description Notes

programProgramPatchPayload | ProgramProgramPatchPayload | |

Return type

ProgramWithIncludes

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]