8.7 KiB
\UsersAPI
All URIs are relative to http://localhost
| Method | HTTP request | Description |
|---|---|---|
| CreateUserUsersPost | Post /users/ | Create User |
| DeleteUserUsersUserIdDelete | Delete /users/{user_id} | Delete User |
| ReadUserUsersUserIdGet | Get /users/{user_id} | Read User |
| ReadUsersUsersGet | Get /users/ | Read Users |
| UpdateUserUsersUserIdPatch | Patch /users/{user_id} | Update User |
CreateUserUsersPost
UserResponse CreateUserUsersPost(ctx).UserCreate(userCreate).Execute()
Create User
Example
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
)
func main() {
userCreate := *openapiclient.NewUserCreate("Name_example", "Password_example") // UserCreate |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.UsersAPI.CreateUserUsersPost(context.Background()).UserCreate(userCreate).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `UsersAPI.CreateUserUsersPost``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateUserUsersPost`: UserResponse
fmt.Fprintf(os.Stdout, "Response from `UsersAPI.CreateUserUsersPost`: %v\n", resp)
}
Path Parameters
Other Parameters
Other parameters are passed through a pointer to a apiCreateUserUsersPostRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| userCreate | UserCreate |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeleteUserUsersUserIdDelete
interface{} DeleteUserUsersUserIdDelete(ctx, userId).Execute()
Delete User
Example
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
)
func main() {
userId := int32(56) // int32 |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.UsersAPI.DeleteUserUsersUserIdDelete(context.Background(), userId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `UsersAPI.DeleteUserUsersUserIdDelete``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `DeleteUserUsersUserIdDelete`: interface{}
fmt.Fprintf(os.Stdout, "Response from `UsersAPI.DeleteUserUsersUserIdDelete`: %v\n", resp)
}
Path Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| userId | int32 |
Other Parameters
Other parameters are passed through a pointer to a apiDeleteUserUsersUserIdDeleteRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
Return type
interface{}
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ReadUserUsersUserIdGet
UserResponse ReadUserUsersUserIdGet(ctx, userId).Execute()
Read User
Example
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
)
func main() {
userId := int32(56) // int32 |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.UsersAPI.ReadUserUsersUserIdGet(context.Background(), userId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `UsersAPI.ReadUserUsersUserIdGet``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ReadUserUsersUserIdGet`: UserResponse
fmt.Fprintf(os.Stdout, "Response from `UsersAPI.ReadUserUsersUserIdGet`: %v\n", resp)
}
Path Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| userId | int32 |
Other Parameters
Other parameters are passed through a pointer to a apiReadUserUsersUserIdGetRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ReadUsersUsersGet
[]UserResponse ReadUsersUsersGet(ctx).Execute()
Read Users
Example
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
)
func main() {
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.UsersAPI.ReadUsersUsersGet(context.Background()).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `UsersAPI.ReadUsersUsersGet``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ReadUsersUsersGet`: []UserResponse
fmt.Fprintf(os.Stdout, "Response from `UsersAPI.ReadUsersUsersGet`: %v\n", resp)
}
Path Parameters
This endpoint does not need any parameter.
Other Parameters
Other parameters are passed through a pointer to a apiReadUsersUsersGetRequest struct via the builder pattern
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UpdateUserUsersUserIdPatch
UserResponse UpdateUserUsersUserIdPatch(ctx, userId).UserUpdate(userUpdate).Execute()
Update User
Example
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
)
func main() {
userId := int32(56) // int32 |
userUpdate := *openapiclient.NewUserUpdate() // UserUpdate |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.UsersAPI.UpdateUserUsersUserIdPatch(context.Background(), userId).UserUpdate(userUpdate).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `UsersAPI.UpdateUserUsersUserIdPatch``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `UpdateUserUsersUserIdPatch`: UserResponse
fmt.Fprintf(os.Stdout, "Response from `UsersAPI.UpdateUserUsersUserIdPatch`: %v\n", resp)
}
Path Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| userId | int32 |
Other Parameters
Other parameters are passed through a pointer to a apiUpdateUserUsersUserIdPatchRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
userUpdate | UserUpdate | |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]