Skip to content

Latest commit

 

History

History
288 lines (190 loc) · 8.25 KB

File metadata and controls

288 lines (190 loc) · 8.25 KB

\UsersAPI

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

Method HTTP request Description
CreateUser Post /users Create a user.
GetUserById Get /users/{id} Get an user record
GetUsers Get /users Get all user records
UpdateUserById Patch /users/{id} Update a user.

CreateUser

Error CreateUser(ctx).CreateUserRequest(createUserRequest).Execute()

Create a user.

Example

package main

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

func main() {
	createUserRequest := *openapiclient.NewCreateUserRequest("FirstName_example", "LastName_example", "Email_example") // CreateUserRequest | 

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

Path Parameters

Other Parameters

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

Name Type Description Notes
createUserRequest CreateUserRequest

Return type

Error

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]

GetUserById

UserWithIncludes GetUserById(ctx, id).Execute()

Get an user record

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

Name Type Description Notes

Return type

UserWithIncludes

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]

GetUsers

[]UserWithIncludes GetUsers(ctx).Role(role).Email(email).LabelId(labelId).Sort(sort).Cursor(cursor).PerPage(perPage).Execute()

Get all user records

Example

package main

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

func main() {
	role := "role_example" // string | Filter results on role (optional)
	email := "email_example" // string | Filter results on email (optional)
	labelId := []string{"Inner_example"} // []string | Filter results on label_id (optional)
	sort := []string{"Sort_example"} // []string | Sort the results. Can change order by using `<sort_by>:<direction>` where `<direction>` is either `asc` or `desc` (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.UsersAPI.GetUsers(context.Background()).Role(role).Email(email).LabelId(labelId).Sort(sort).Cursor(cursor).PerPage(perPage).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `UsersAPI.GetUsers``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetUsers`: []UserWithIncludes
	fmt.Fprintf(os.Stdout, "Response from `UsersAPI.GetUsers`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
role string Filter results on role
email string Filter results on email
labelId []string Filter results on label_id
sort []string Sort the results. Can change order by using `<sort_by>:<direction>` where `<direction>` is either `asc` or `desc`
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

[]UserWithIncludes

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]

UpdateUserById

UserWithIncludes UpdateUserById(ctx, id).UpdateUserByIdRequest(updateUserByIdRequest).Execute()

Update a user.

Example

package main

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

func main() {
	id := int32(56) // int32 | 
	updateUserByIdRequest := *openapiclient.NewUpdateUserByIdRequest() // UpdateUserByIdRequest | 

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

Name Type Description Notes

updateUserByIdRequest | UpdateUserByIdRequest | |

Return type

UserWithIncludes

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]