Skip to content

Latest commit

 

History

History
654 lines (423 loc) · 15.6 KB

File metadata and controls

654 lines (423 loc) · 15.6 KB

\UserAPI

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

UserGet

User UserGet(ctx).Execute()

Fetch logged in user

Example

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)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

User

Authorization

cookie, bearer

HTTP request headers

  • 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

UserTokensApiTokenIdDelete(ctx, apiTokenId).Execute()

Expires API token

Example

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)
	}
}

Path Parameters

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

Other Parameters

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

Name Type Description Notes

Return type

(empty response body)

Authorization

cookie, bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

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

UserTokensGet

[]APIToken UserTokensGet(ctx).Execute()

Fetch API tokens for user

Example

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)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

[]APIToken

Authorization

cookie, bearer

HTTP request headers

  • 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]

UserTokensPost

APIToken UserTokensPost(ctx).Execute()

Create an API token

Example

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)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

APIToken

Authorization

cookie, bearer

HTTP request headers

  • 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]

UsersGet

[]User UsersGet(ctx).Execute()

Fetches all users

Example

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)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

[]User

Authorization

cookie, bearer

HTTP request headers

  • 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]

UsersPost

User UsersPost(ctx).User(user).Execute()

Creates a user

Example

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)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
user UserRequest

Return type

User

Authorization

cookie, bearer

HTTP request headers

  • 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

UsersUserIdDelete(ctx, userId).Execute()

Deletes user

Example

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)
	}
}

Path Parameters

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

Other Parameters

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

Name Type Description Notes

Return type

(empty response body)

Authorization

cookie, bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

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

UsersUserIdGet

User UsersUserIdGet(ctx, userId).Execute()

Fetches a user profile

Example

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)
}

Path Parameters

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

Other Parameters

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

Name Type Description Notes

Return type

User

Authorization

cookie, bearer

HTTP request headers

  • 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

UsersUserIdPasswordPost(ctx, userId).Password(password).Execute()

Updates user password

Example

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)
	}
}

Path Parameters

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

Other Parameters

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

Name Type Description Notes

password | UsersUserIdPasswordPostRequest | |

Return type

(empty response body)

Authorization

cookie, bearer

HTTP request headers

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

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

UsersUserIdPut

UsersUserIdPut(ctx, userId).User(user).Execute()

Updates user details

Example

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)
	}
}

Path Parameters

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

Other Parameters

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

Name Type Description Notes

user | UserPutRequest | |

Return type

(empty response body)

Authorization

cookie, bearer

HTTP request headers

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

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