All URIs are relative to http://localhost:3000/api
| Method | HTTP request | Description |
|---|---|---|
| UserGet | Get /user/ | Fetch logged in user |
| UserTokensApiTokenIdDelete | Delete /user/tokens/{api_token_id} | Expires API token |
| UserTokensGet | Get /user/tokens | Fetch API tokens for user |
| UserTokensPost | Post /user/tokens | Create an API token |
| UsersGet | Get /users | Fetches all users |
| UsersPost | Post /users | Creates a user |
| UsersUserIdDelete | Delete /users/{user_id}/ | Deletes user |
| UsersUserIdGet | Get /users/{user_id}/ | Fetches a user profile |
| UsersUserIdPasswordPost | Post /users/{user_id}/password | Updates user password |
| UsersUserIdPut | Put /users/{user_id}/ | Updates user details |
User UserGet(ctx).Execute()
Fetch logged in user
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/client-api/semaphore-go"
)
func main() {
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.UserAPI.UserGet(context.Background()).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.UserGet``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `UserGet`: User
fmt.Fprintf(os.Stdout, "Response from `UserAPI.UserGet`: %v\n", resp)
}This endpoint does not need any parameter.
Other parameters are passed through a pointer to a apiUserGetRequest struct via the builder pattern
- Content-Type: Not defined
- Accept: application/json, text/plain; charset=utf-8
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UserTokensApiTokenIdDelete(ctx, apiTokenId).Execute()
Expires API token
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/client-api/semaphore-go"
)
func main() {
apiTokenId := "kwofd61g93-yuqvex8efmhjkgnbxlo8mp1tin6spyhu=" // string |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
r, err := apiClient.UserAPI.UserTokensApiTokenIdDelete(context.Background(), apiTokenId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.UserTokensApiTokenIdDelete``: %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. | |
| apiTokenId | string |
Other parameters are passed through a pointer to a apiUserTokensApiTokenIdDeleteRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
(empty response body)
- Content-Type: Not defined
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]APIToken UserTokensGet(ctx).Execute()
Fetch API tokens for user
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/client-api/semaphore-go"
)
func main() {
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.UserAPI.UserTokensGet(context.Background()).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.UserTokensGet``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `UserTokensGet`: []APIToken
fmt.Fprintf(os.Stdout, "Response from `UserAPI.UserTokensGet`: %v\n", resp)
}This endpoint does not need any parameter.
Other parameters are passed through a pointer to a apiUserTokensGetRequest struct via the builder pattern
- Content-Type: Not defined
- Accept: application/json, text/plain; charset=utf-8
[Back to top] [Back to API list] [Back to Model list] [Back to README]
APIToken UserTokensPost(ctx).Execute()
Create an API token
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/client-api/semaphore-go"
)
func main() {
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.UserAPI.UserTokensPost(context.Background()).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.UserTokensPost``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `UserTokensPost`: APIToken
fmt.Fprintf(os.Stdout, "Response from `UserAPI.UserTokensPost`: %v\n", resp)
}This endpoint does not need any parameter.
Other parameters are passed through a pointer to a apiUserTokensPostRequest struct via the builder pattern
- Content-Type: Not defined
- Accept: application/json, text/plain; charset=utf-8
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]User UsersGet(ctx).Execute()
Fetches all users
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/client-api/semaphore-go"
)
func main() {
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.UserAPI.UsersGet(context.Background()).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.UsersGet``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `UsersGet`: []User
fmt.Fprintf(os.Stdout, "Response from `UserAPI.UsersGet`: %v\n", resp)
}This endpoint does not need any parameter.
Other parameters are passed through a pointer to a apiUsersGetRequest struct via the builder pattern
- Content-Type: Not defined
- Accept: application/json, text/plain; charset=utf-8
[Back to top] [Back to API list] [Back to Model list] [Back to README]
User UsersPost(ctx).User(user).Execute()
Creates a user
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/client-api/semaphore-go"
)
func main() {
user := *openapiclient.NewUserRequest() // UserRequest |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.UserAPI.UsersPost(context.Background()).User(user).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.UsersPost``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `UsersPost`: User
fmt.Fprintf(os.Stdout, "Response from `UserAPI.UsersPost`: %v\n", resp)
}Other parameters are passed through a pointer to a apiUsersPostRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| user | UserRequest |
- Content-Type: application/json
- Accept: application/json, text/plain; charset=utf-8
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UsersUserIdDelete(ctx, userId).Execute()
Deletes user
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/client-api/semaphore-go"
)
func main() {
userId := int32(56) // int32 | User ID
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
r, err := apiClient.UserAPI.UsersUserIdDelete(context.Background(), userId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.UsersUserIdDelete``: %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. | |
| userId | int32 | User ID |
Other parameters are passed through a pointer to a apiUsersUserIdDeleteRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
(empty response body)
- Content-Type: Not defined
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
User UsersUserIdGet(ctx, userId).Execute()
Fetches a user profile
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/client-api/semaphore-go"
)
func main() {
userId := int32(56) // int32 | User ID
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.UserAPI.UsersUserIdGet(context.Background(), userId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.UsersUserIdGet``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `UsersUserIdGet`: User
fmt.Fprintf(os.Stdout, "Response from `UserAPI.UsersUserIdGet`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| userId | int32 | User ID |
Other parameters are passed through a pointer to a apiUsersUserIdGetRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
- Content-Type: Not defined
- Accept: application/json, text/plain; charset=utf-8
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UsersUserIdPasswordPost(ctx, userId).Password(password).Execute()
Updates user password
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/client-api/semaphore-go"
)
func main() {
userId := int32(56) // int32 | User ID
password := *openapiclient.NewUsersUserIdPasswordPostRequest() // UsersUserIdPasswordPostRequest |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
r, err := apiClient.UserAPI.UsersUserIdPasswordPost(context.Background(), userId).Password(password).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.UsersUserIdPasswordPost``: %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. | |
| userId | int32 | User ID |
Other parameters are passed through a pointer to a apiUsersUserIdPasswordPostRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
password | UsersUserIdPasswordPostRequest | |
(empty response body)
- Content-Type: application/json
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UsersUserIdPut(ctx, userId).User(user).Execute()
Updates user details
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/client-api/semaphore-go"
)
func main() {
userId := int32(56) // int32 | User ID
user := *openapiclient.NewUserPutRequest() // UserPutRequest |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
r, err := apiClient.UserAPI.UsersUserIdPut(context.Background(), userId).User(user).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.UsersUserIdPut``: %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. | |
| userId | int32 | User ID |
Other parameters are passed through a pointer to a apiUsersUserIdPutRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
user | UserPutRequest | |
(empty response body)
- Content-Type: application/json
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]