All URIs are relative to http://localhost/api/v1
Method | HTTP request | Description |
---|---|---|
DeleteUser | Delete /users/{username} | Delete a user |
GetUser | Get /users/{username} | Get a user |
GetUsers | Get /users | List users |
PatchUser | Patch /users/{username} | Update a user |
PostUser | Post /users | Create a user |
DeleteUser(ctx, username).Execute()
Delete a user
package main import ( "context" "fmt" "os" openapiclient "./openapi" ) func main() { username := "username_example" // string | The username of the user. *New in version 2.1.0* configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.UserApi.DeleteUser(context.Background(), username).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `UserApi.DeleteUser``: %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. | |
username | string | The username of the user. New in version 2.1.0 |
Other parameters are passed through a pointer to a apiDeleteUserRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
(empty response body)
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UserCollectionItem GetUser(ctx, username).Execute()
Get a user
package main import ( "context" "fmt" "os" openapiclient "./openapi" ) func main() { username := "username_example" // string | The username of the user. *New in version 2.1.0* configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.UserApi.GetUser(context.Background(), username).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `UserApi.GetUser``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } // response from `GetUser`: UserCollectionItem fmt.Fprintf(os.Stdout, "Response from `UserApi.GetUser`: %v\n", resp) }
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
username | string | The username of the user. New in version 2.1.0 |
Other parameters are passed through a pointer to a apiGetUserRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UserCollection GetUsers(ctx).Limit(limit).Offset(offset).OrderBy(orderBy).Execute()
List users
package main import ( "context" "fmt" "os" openapiclient "./openapi" ) func main() { limit := int32(56) // int32 | The numbers of items to return. (optional) (default to 100) offset := int32(56) // int32 | The number of items to skip before starting to collect the result set. (optional) orderBy := "orderBy_example" // string | The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.1.0* (optional) configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.UserApi.GetUsers(context.Background()).Limit(limit).Offset(offset).OrderBy(orderBy).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `UserApi.GetUsers``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } // response from `GetUsers`: UserCollection fmt.Fprintf(os.Stdout, "Response from `UserApi.GetUsers`: %v\n", resp) }
Other parameters are passed through a pointer to a apiGetUsersRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
limit | int32 | The numbers of items to return. | [default to 100] |
offset | int32 | The number of items to skip before starting to collect the result set. | |
orderBy | string | The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. New in version 2.1.0 |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Role PatchUser(ctx, username).User(user).UpdateMask(updateMask).Execute()
Update a user
package main import ( "context" "fmt" "os" openapiclient "./openapi" ) func main() { username := "username_example" // string | The username of the user. *New in version 2.1.0* user := *openapiclient.NewUser() // User | updateMask := []string{"Inner_example"} // []string | The fields to update on the resource. If absent or empty, all modifiable fields are updated. A comma-separated list of fully qualified names of fields. (optional) configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.UserApi.PatchUser(context.Background(), username).User(user).UpdateMask(updateMask).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `UserApi.PatchUser``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } // response from `PatchUser`: Role fmt.Fprintf(os.Stdout, "Response from `UserApi.PatchUser`: %v\n", resp) }
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
username | string | The username of the user. New in version 2.1.0 |
Other parameters are passed through a pointer to a apiPatchUserRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
user | User | | updateMask | []string | The fields to update on the resource. If absent or empty, all modifiable fields are updated. A comma-separated list of fully qualified names of fields. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
User PostUser(ctx).User(user).Execute()
Create a user
package main import ( "context" "fmt" "os" openapiclient "./openapi" ) func main() { user := *openapiclient.NewUser() // User | configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.UserApi.PostUser(context.Background()).User(user).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `UserApi.PostUser``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } // response from `PostUser`: User fmt.Fprintf(os.Stdout, "Response from `UserApi.PostUser`: %v\n", resp) }
Other parameters are passed through a pointer to a apiPostUserRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
user | User |
[Back to top] [Back to API list] [Back to Model list] [Back to README]