Initial commit

This commit is contained in:
kolaente 2019-10-19 22:53:41 +02:00
commit d1bd0237ad
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
98 changed files with 15378 additions and 0 deletions

24
.gitignore vendored Normal file
View File

@ -0,0 +1,24 @@
# Compiled Object files, Static and Dynamic libs (Shared Objects)
*.o
*.a
*.so
# Folders
_obj
_test
# Architecture specific extensions/prefixes
*.[568vq]
[568vq].out
*.cgo1.go
*.cgo2.c
_cgo_defun.c
_cgo_gotypes.go
_cgo_export.*
_testmain.go
*.exe
*.test
*.prof

23
.swagger-codegen-ignore Normal file
View File

@ -0,0 +1,23 @@
# Swagger Codegen Ignore
# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen
# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.
# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line:
#ApiClient.cs
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md

1
.swagger-codegen/VERSION Normal file
View File

@ -0,0 +1 @@
2.3.1

8
.travis.yml Normal file
View File

@ -0,0 +1,8 @@
language: go
install:
- go get -d -v .
script:
- go build -v ./

166
README.md Normal file
View File

@ -0,0 +1,166 @@
# Go API client for swagger
This is the documentation for the [Vikunja](http://vikunja.io) API. Vikunja is a cross-plattform Todo-application with a lot of features, such as sharing lists with users or teams. <!-- ReDoc-Inject: <security-definitions> --> # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer <jwt-token>`-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. <!-- ReDoc-Inject: <security-definitions> -->
## Overview
This API client was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the [swagger-spec](https://github.com/swagger-api/swagger-spec) from a remote server, you can easily generate an API client.
- API version: 0.8+21-854fde1e4c
- Package version: 1.0.0
- Build package: io.swagger.codegen.languages.GoClientCodegen
For more information, please visit [http://vikunja.io/en/contact/](http://vikunja.io/en/contact/)
## Installation
Put the package under your project folder and add the following in import:
```
"./swagger"
```
## Documentation for API Endpoints
All URIs are relative to *https://localhost/api/v1*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*AssigneesApi* | [**TasksTaskIDAssigneesBulkPost**](docs/AssigneesApi.md#taskstaskidassigneesbulkpost) | **Post** /tasks/{taskID}/assignees/bulk | Add multiple new assignees to a task
*AssigneesApi* | [**TasksTaskIDAssigneesGet**](docs/AssigneesApi.md#taskstaskidassigneesget) | **Get** /tasks/{taskID}/assignees | Get all assignees for a task
*AssigneesApi* | [**TasksTaskIDAssigneesPut**](docs/AssigneesApi.md#taskstaskidassigneesput) | **Put** /tasks/{taskID}/assignees | Add a new assignee to a task
*AssigneesApi* | [**TasksTaskIDAssigneesUserIDDelete**](docs/AssigneesApi.md#taskstaskidassigneesuseriddelete) | **Delete** /tasks/{taskID}/assignees/{userID} | Delete an assignee
*LabelsApi* | [**LabelsGet**](docs/LabelsApi.md#labelsget) | **Get** /labels | Get all labels a user has access to
*LabelsApi* | [**LabelsIdDelete**](docs/LabelsApi.md#labelsiddelete) | **Delete** /labels/{id} | Delete a label
*LabelsApi* | [**LabelsIdGet**](docs/LabelsApi.md#labelsidget) | **Get** /labels/{id} | Gets one label
*LabelsApi* | [**LabelsIdPut**](docs/LabelsApi.md#labelsidput) | **Put** /labels/{id} | Update a label
*LabelsApi* | [**LabelsPut**](docs/LabelsApi.md#labelsput) | **Put** /labels | Create a label
*LabelsApi* | [**TasksTaskIDLabelsBulkPost**](docs/LabelsApi.md#taskstaskidlabelsbulkpost) | **Post** /tasks/{taskID}/labels/bulk | Update all labels on a task.
*LabelsApi* | [**TasksTaskLabelsGet**](docs/LabelsApi.md#taskstasklabelsget) | **Get** /tasks/{task}/labels | Get all labels on a task
*LabelsApi* | [**TasksTaskLabelsLabelDelete**](docs/LabelsApi.md#taskstasklabelslabeldelete) | **Delete** /tasks/{task}/labels/{label} | Remove a label from a task
*LabelsApi* | [**TasksTaskLabelsPut**](docs/LabelsApi.md#taskstasklabelsput) | **Put** /tasks/{task}/labels | Add a label to a task
*ListApi* | [**ListsGet**](docs/ListApi.md#listsget) | **Get** /lists | Get all lists a user has access to
*ListApi* | [**ListsIdDelete**](docs/ListApi.md#listsiddelete) | **Delete** /lists/{id} | Deletes a list
*ListApi* | [**ListsIdGet**](docs/ListApi.md#listsidget) | **Get** /lists/{id} | Gets one list
*ListApi* | [**ListsIdListusersGet**](docs/ListApi.md#listsidlistusersget) | **Get** /lists/{id}/listusers | Get users
*ListApi* | [**ListsIdPost**](docs/ListApi.md#listsidpost) | **Post** /lists/{id} | Updates a list
*ListApi* | [**NamespacesNamespaceIDListsPut**](docs/ListApi.md#namespacesnamespaceidlistsput) | **Put** /namespaces/{namespaceID}/lists | Creates a new list
*NamespaceApi* | [**NamespaceIdPost**](docs/NamespaceApi.md#namespaceidpost) | **Post** /namespace/{id} | Updates a namespace
*NamespaceApi* | [**NamespacesGet**](docs/NamespaceApi.md#namespacesget) | **Get** /namespaces | Get all namespaces a user has access to
*NamespaceApi* | [**NamespacesIdDelete**](docs/NamespaceApi.md#namespacesiddelete) | **Delete** /namespaces/{id} | Deletes a namespace
*NamespaceApi* | [**NamespacesIdGet**](docs/NamespaceApi.md#namespacesidget) | **Get** /namespaces/{id} | Gets one namespace
*NamespaceApi* | [**NamespacesIdListsGet**](docs/NamespaceApi.md#namespacesidlistsget) | **Get** /namespaces/{id}/lists | Get all lists in a namespace
*NamespaceApi* | [**NamespacesPut**](docs/NamespaceApi.md#namespacesput) | **Put** /namespaces | Creates a new namespace
*ServiceApi* | [**InfoGet**](docs/ServiceApi.md#infoget) | **Get** /info | Info
*SharingApi* | [**ListsIdTeamsGet**](docs/SharingApi.md#listsidteamsget) | **Get** /lists/{id}/teams | Get teams on a list
*SharingApi* | [**ListsIdTeamsPut**](docs/SharingApi.md#listsidteamsput) | **Put** /lists/{id}/teams | Add a team to a list
*SharingApi* | [**ListsIdUsersGet**](docs/SharingApi.md#listsidusersget) | **Get** /lists/{id}/users | Get users on a list
*SharingApi* | [**ListsIdUsersPut**](docs/SharingApi.md#listsidusersput) | **Put** /lists/{id}/users | Add a user to a list
*SharingApi* | [**ListsListIDTeamsTeamIDDelete**](docs/SharingApi.md#listslistidteamsteamiddelete) | **Delete** /lists/{listID}/teams/{teamID} | Delete a team from a list
*SharingApi* | [**ListsListIDTeamsTeamIDPost**](docs/SharingApi.md#listslistidteamsteamidpost) | **Post** /lists/{listID}/teams/{teamID} | Update a team &lt;-&gt; list relation
*SharingApi* | [**ListsListIDUsersUserIDDelete**](docs/SharingApi.md#listslistidusersuseriddelete) | **Delete** /lists/{listID}/users/{userID} | Delete a user from a list
*SharingApi* | [**ListsListIDUsersUserIDPost**](docs/SharingApi.md#listslistidusersuseridpost) | **Post** /lists/{listID}/users/{userID} | Update a user &lt;-&gt; list relation
*SharingApi* | [**ListsListSharesGet**](docs/SharingApi.md#listslistsharesget) | **Get** /lists/{list}/shares | Get all link shares for a list
*SharingApi* | [**ListsListSharesPut**](docs/SharingApi.md#listslistsharesput) | **Put** /lists/{list}/shares | Share a list via link
*SharingApi* | [**ListsListSharesShareDelete**](docs/SharingApi.md#listslistsharessharedelete) | **Delete** /lists/{list}/shares/{share} | Remove a link share
*SharingApi* | [**ListsListSharesShareGet**](docs/SharingApi.md#listslistsharesshareget) | **Get** /lists/{list}/shares/{share} | Get one link shares for a list
*SharingApi* | [**NamespacesIdTeamsGet**](docs/SharingApi.md#namespacesidteamsget) | **Get** /namespaces/{id}/teams | Get teams on a namespace
*SharingApi* | [**NamespacesIdTeamsPut**](docs/SharingApi.md#namespacesidteamsput) | **Put** /namespaces/{id}/teams | Add a team to a namespace
*SharingApi* | [**NamespacesIdUsersGet**](docs/SharingApi.md#namespacesidusersget) | **Get** /namespaces/{id}/users | Get users on a namespace
*SharingApi* | [**NamespacesIdUsersPut**](docs/SharingApi.md#namespacesidusersput) | **Put** /namespaces/{id}/users | Add a user to a namespace
*SharingApi* | [**NamespacesNamespaceIDTeamsTeamIDDelete**](docs/SharingApi.md#namespacesnamespaceidteamsteamiddelete) | **Delete** /namespaces/{namespaceID}/teams/{teamID} | Delete a team from a namespace
*SharingApi* | [**NamespacesNamespaceIDTeamsTeamIDPost**](docs/SharingApi.md#namespacesnamespaceidteamsteamidpost) | **Post** /namespaces/{namespaceID}/teams/{teamID} | Update a team &lt;-&gt; namespace relation
*SharingApi* | [**NamespacesNamespaceIDUsersUserIDDelete**](docs/SharingApi.md#namespacesnamespaceidusersuseriddelete) | **Delete** /namespaces/{namespaceID}/users/{userID} | Delete a user from a namespace
*SharingApi* | [**NamespacesNamespaceIDUsersUserIDPost**](docs/SharingApi.md#namespacesnamespaceidusersuseridpost) | **Post** /namespaces/{namespaceID}/users/{userID} | Update a user &lt;-&gt; namespace relation
*SharingApi* | [**SharesShareAuthPost**](docs/SharingApi.md#sharesshareauthpost) | **Post** /shares/{share}/auth | Get an auth token for a share
*TaskApi* | [**ListsIdPut**](docs/TaskApi.md#listsidput) | **Put** /lists/{id} | Create a task
*TaskApi* | [**TasksAllGet**](docs/TaskApi.md#tasksallget) | **Get** /tasks/all | Get tasks
*TaskApi* | [**TasksBulkPost**](docs/TaskApi.md#tasksbulkpost) | **Post** /tasks/bulk | Update a bunch of tasks at once
*TaskApi* | [**TasksIdAttachmentsAttachmentIDDelete**](docs/TaskApi.md#tasksidattachmentsattachmentiddelete) | **Delete** /tasks/{id}/attachments/{attachmentID} | Delete an attachment
*TaskApi* | [**TasksIdAttachmentsAttachmentIDGet**](docs/TaskApi.md#tasksidattachmentsattachmentidget) | **Get** /tasks/{id}/attachments/{attachmentID} | Get one attachment.
*TaskApi* | [**TasksIdAttachmentsGet**](docs/TaskApi.md#tasksidattachmentsget) | **Get** /tasks/{id}/attachments | Get all attachments for one task.
*TaskApi* | [**TasksIdAttachmentsPut**](docs/TaskApi.md#tasksidattachmentsput) | **Put** /tasks/{id}/attachments | Upload a task attachment
*TaskApi* | [**TasksIdDelete**](docs/TaskApi.md#tasksiddelete) | **Delete** /tasks/{id} | Delete a task
*TaskApi* | [**TasksIdPost**](docs/TaskApi.md#tasksidpost) | **Post** /tasks/{id} | Update a task
*TaskApi* | [**TasksTaskIDRelationsDelete**](docs/TaskApi.md#taskstaskidrelationsdelete) | **Delete** /tasks/{taskID}/relations | Remove a task relation
*TaskApi* | [**TasksTaskIDRelationsPut**](docs/TaskApi.md#taskstaskidrelationsput) | **Put** /tasks/{taskID}/relations | Create a new relation between two tasks
*TeamApi* | [**TeamsGet**](docs/TeamApi.md#teamsget) | **Get** /teams | Get teams
*TeamApi* | [**TeamsIdDelete**](docs/TeamApi.md#teamsiddelete) | **Delete** /teams/{id} | Deletes a team
*TeamApi* | [**TeamsIdMembersPut**](docs/TeamApi.md#teamsidmembersput) | **Put** /teams/{id}/members | Add a user to a team
*TeamApi* | [**TeamsIdMembersUserIDDelete**](docs/TeamApi.md#teamsidmembersuseriddelete) | **Delete** /teams/{id}/members/{userID} | Remove a user from a team
*TeamApi* | [**TeamsIdPost**](docs/TeamApi.md#teamsidpost) | **Post** /teams/{id} | Updates a team
*TeamApi* | [**TeamsPut**](docs/TeamApi.md#teamsput) | **Put** /teams | Creates a new team
*UserApi* | [**LoginPost**](docs/UserApi.md#loginpost) | **Post** /login | Login
*UserApi* | [**RegisterPost**](docs/UserApi.md#registerpost) | **Post** /register | Register
*UserApi* | [**UserConfirmPost**](docs/UserApi.md#userconfirmpost) | **Post** /user/confirm | Confirm the email of a new user
*UserApi* | [**UserGet**](docs/UserApi.md#userget) | **Get** /user | Get user information
*UserApi* | [**UserPasswordPost**](docs/UserApi.md#userpasswordpost) | **Post** /user/password | Change password
*UserApi* | [**UserPasswordResetPost**](docs/UserApi.md#userpasswordresetpost) | **Post** /user/password/reset | Resets a password
*UserApi* | [**UserPasswordTokenPost**](docs/UserApi.md#userpasswordtokenpost) | **Post** /user/password/token | Request password reset token
*UserApi* | [**UsersGet**](docs/UserApi.md#usersget) | **Get** /users | Get users
## Documentation For Models
- [CodeVikunjaIoWebHttpError](docs/CodeVikunjaIoWebHttpError.md)
- [FilesFile](docs/FilesFile.md)
- [ModelsApiUserPassword](docs/ModelsApiUserPassword.md)
- [ModelsBulkAssignees](docs/ModelsBulkAssignees.md)
- [ModelsBulkTask](docs/ModelsBulkTask.md)
- [ModelsEmailConfirm](docs/ModelsEmailConfirm.md)
- [ModelsLabel](docs/ModelsLabel.md)
- [ModelsLabelTask](docs/ModelsLabelTask.md)
- [ModelsLabelTaskBulk](docs/ModelsLabelTaskBulk.md)
- [ModelsLinkSharing](docs/ModelsLinkSharing.md)
- [ModelsList](docs/ModelsList.md)
- [ModelsListUser](docs/ModelsListUser.md)
- [ModelsMessage](docs/ModelsMessage.md)
- [ModelsNamespace](docs/ModelsNamespace.md)
- [ModelsNamespaceUser](docs/ModelsNamespaceUser.md)
- [ModelsNamespaceWithLists](docs/ModelsNamespaceWithLists.md)
- [ModelsPasswordReset](docs/ModelsPasswordReset.md)
- [ModelsPasswordTokenRequest](docs/ModelsPasswordTokenRequest.md)
- [ModelsRelatedTaskMap](docs/ModelsRelatedTaskMap.md)
- [ModelsTask](docs/ModelsTask.md)
- [ModelsTaskAssginee](docs/ModelsTaskAssginee.md)
- [ModelsTaskAttachment](docs/ModelsTaskAttachment.md)
- [ModelsTaskRelation](docs/ModelsTaskRelation.md)
- [ModelsTeam](docs/ModelsTeam.md)
- [ModelsTeamList](docs/ModelsTeamList.md)
- [ModelsTeamMember](docs/ModelsTeamMember.md)
- [ModelsTeamNamespace](docs/ModelsTeamNamespace.md)
- [ModelsTeamUser](docs/ModelsTeamUser.md)
- [ModelsTeamWithRight](docs/ModelsTeamWithRight.md)
- [ModelsUser](docs/ModelsUser.md)
- [ModelsUserLogin](docs/ModelsUserLogin.md)
- [ModelsUserWithRight](docs/ModelsUserWithRight.md)
- [V1Token](docs/V1Token.md)
- [V1UserPassword](docs/V1UserPassword.md)
- [V1VikunjaInfos](docs/V1VikunjaInfos.md)
## Documentation For Authorization
## BasicAuth
- **Type**: HTTP basic authentication
Example
```
auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{
UserName: "username",
Password: "password",
})
r, err := client.Service.Operation(auth, args)
```
## JWTKeyAuth
- **Type**: API key
Example
```
auth := context.WithValue(context.Background(), sw.ContextAPIKey, sw.APIKey{
Key: "APIKEY",
Prefix: "Bearer", // Omit if not necessary.
})
r, err := client.Service.Operation(auth, args)
```
## Author
hello@vikunja.io

4700
api/swagger.yaml Normal file

File diff suppressed because it is too large Load Diff

445
api_client.go Normal file
View File

@ -0,0 +1,445 @@
/*
* Vikunja API
*
* This is the documentation for the [Vikunja](http://vikunja.io) API. Vikunja is a cross-plattform Todo-application with a lot of features, such as sharing lists with users or teams. <!-- ReDoc-Inject: <security-definitions> --> # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer <jwt-token>`-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. <!-- ReDoc-Inject: <security-definitions> -->
*
* API version: 0.8+21-854fde1e4c
* Contact: hello@vikunja.io
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package swagger
import (
"bytes"
"encoding/json"
"encoding/xml"
"fmt"
"errors"
"io"
"mime/multipart"
"golang.org/x/oauth2"
"golang.org/x/net/context"
"net/http"
"net/url"
"time"
"os"
"path/filepath"
"reflect"
"regexp"
"strings"
"unicode/utf8"
"strconv"
)
var (
jsonCheck = regexp.MustCompile("(?i:[application|text]/json)")
xmlCheck = regexp.MustCompile("(?i:[application|text]/xml)")
)
// APIClient manages communication with the Vikunja API API v0.8+21-854fde1e4c
// In most cases there should be only one, shared, APIClient.
type APIClient struct {
cfg *Configuration
common service // Reuse a single struct instead of allocating one for each service on the heap.
// API Services
AssigneesApi *AssigneesApiService
LabelsApi *LabelsApiService
ListApi *ListApiService
NamespaceApi *NamespaceApiService
ServiceApi *ServiceApiService
SharingApi *SharingApiService
TaskApi *TaskApiService
TeamApi *TeamApiService
UserApi *UserApiService
}
type service struct {
client *APIClient
}
// NewAPIClient creates a new API client. Requires a userAgent string describing your application.
// optionally a custom http.Client to allow for advanced features such as caching.
func NewAPIClient(cfg *Configuration) *APIClient {
if cfg.HTTPClient == nil {
cfg.HTTPClient = http.DefaultClient
}
c := &APIClient{}
c.cfg = cfg
c.common.client = c
// API Services
c.AssigneesApi = (*AssigneesApiService)(&c.common)
c.LabelsApi = (*LabelsApiService)(&c.common)
c.ListApi = (*ListApiService)(&c.common)
c.NamespaceApi = (*NamespaceApiService)(&c.common)
c.ServiceApi = (*ServiceApiService)(&c.common)
c.SharingApi = (*SharingApiService)(&c.common)
c.TaskApi = (*TaskApiService)(&c.common)
c.TeamApi = (*TeamApiService)(&c.common)
c.UserApi = (*UserApiService)(&c.common)
return c
}
func atoi(in string) (int, error) {
return strconv.Atoi(in)
}
// selectHeaderContentType select a content type from the available list.
func selectHeaderContentType(contentTypes []string) string {
if len(contentTypes) == 0 {
return ""
}
if contains(contentTypes, "application/json") {
return "application/json"
}
return contentTypes[0] // use the first content type specified in 'consumes'
}
// selectHeaderAccept join all accept types and return
func selectHeaderAccept(accepts []string) string {
if len(accepts) == 0 {
return ""
}
if contains(accepts, "application/json") {
return "application/json"
}
return strings.Join(accepts, ",")
}
// contains is a case insenstive match, finding needle in a haystack
func contains(haystack []string, needle string) bool {
for _, a := range haystack {
if strings.ToLower(a) == strings.ToLower(needle) {
return true
}
}
return false
}
// Verify optional parameters are of the correct type.
func typeCheckParameter(obj interface{}, expected string, name string) error {
// Make sure there is an object.
if obj == nil {
return nil
}
// Check the type is as expected.
if reflect.TypeOf(obj).String() != expected {
return fmt.Errorf("Expected %s to be of type %s but received %s.", name, expected, reflect.TypeOf(obj).String())
}
return nil
}
// parameterToString convert interface{} parameters to string, using a delimiter if format is provided.
func parameterToString(obj interface{}, collectionFormat string) string {
var delimiter string
switch collectionFormat {
case "pipes":
delimiter = "|"
case "ssv":
delimiter = " "
case "tsv":
delimiter = "\t"
case "csv":
delimiter = ","
}
if reflect.TypeOf(obj).Kind() == reflect.Slice {
return strings.Trim(strings.Replace(fmt.Sprint(obj), " ", delimiter, -1), "[]")
}
return fmt.Sprintf("%v", obj)
}
// callAPI do the request.
func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) {
return c.cfg.HTTPClient.Do(request)
}
// Change base path to allow switching to mocks
func (c *APIClient) ChangeBasePath (path string) {
c.cfg.BasePath = path
}
// prepareRequest build the request
func (c *APIClient) prepareRequest (
ctx context.Context,
path string, method string,
postBody interface{},
headerParams map[string]string,
queryParams url.Values,
formParams url.Values,
fileName string,
fileBytes []byte) (localVarRequest *http.Request, err error) {
var body *bytes.Buffer
// Detect postBody type and post.
if postBody != nil {
contentType := headerParams["Content-Type"]
if contentType == "" {
contentType = detectContentType(postBody)
headerParams["Content-Type"] = contentType
}
body, err = setBody(postBody, contentType)
if err != nil {
return nil, err
}
}
// add form parameters and file if available.
if len(formParams) > 0 || (len(fileBytes) > 0 && fileName != "") {
if body != nil {
return nil, errors.New("Cannot specify postBody and multipart form at the same time.")
}
body = &bytes.Buffer{}
w := multipart.NewWriter(body)
for k, v := range formParams {
for _, iv := range v {
if strings.HasPrefix(k, "@") { // file
err = addFile(w, k[1:], iv)
if err != nil {
return nil, err
}
} else { // form value
w.WriteField(k, iv)
}
}
}
if len(fileBytes) > 0 && fileName != "" {
w.Boundary()
//_, fileNm := filepath.Split(fileName)
part, err := w.CreateFormFile("file", filepath.Base(fileName))
if err != nil {
return nil, err
}
_, err = part.Write(fileBytes)
if err != nil {
return nil, err
}
// Set the Boundary in the Content-Type
headerParams["Content-Type"] = w.FormDataContentType()
}
// Set Content-Length
headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len())
w.Close()
}
// Setup path and query parameters
url, err := url.Parse(path)
if err != nil {
return nil, err
}
// Adding Query Param
query := url.Query()
for k, v := range queryParams {
for _, iv := range v {
query.Add(k, iv)
}
}
// Encode the parameters.
url.RawQuery = query.Encode()
// Generate a new request
if body != nil {
localVarRequest, err = http.NewRequest(method, url.String(), body)
} else {
localVarRequest, err = http.NewRequest(method, url.String(), nil)
}
if err != nil {
return nil, err
}
// add header parameters, if any
if len(headerParams) > 0 {
headers := http.Header{}
for h, v := range headerParams {
headers.Set(h, v)
}
localVarRequest.Header = headers
}
// Override request host, if applicable
if c.cfg.Host != "" {
localVarRequest.Host = c.cfg.Host
}
// Add the user agent to the request.
localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent)
if ctx != nil {
// add context to the request
localVarRequest = localVarRequest.WithContext(ctx)
// Walk through any authentication.
// OAuth2 authentication
if tok, ok := ctx.Value(ContextOAuth2).(oauth2.TokenSource); ok {
// We were able to grab an oauth2 token from the context
var latestToken *oauth2.Token
if latestToken, err = tok.Token(); err != nil {
return nil, err
}
latestToken.SetAuthHeader(localVarRequest)
}
// Basic HTTP Authentication
if auth, ok := ctx.Value(ContextBasicAuth).(BasicAuth); ok {
localVarRequest.SetBasicAuth(auth.UserName, auth.Password)
}
// AccessToken Authentication
if auth, ok := ctx.Value(ContextAccessToken).(string); ok {
localVarRequest.Header.Add("Authorization", "Bearer " + auth)
}
}
for header, value := range c.cfg.DefaultHeader {
localVarRequest.Header.Add(header, value)
}
return localVarRequest, nil
}
// Add a file to the multipart request
func addFile(w *multipart.Writer, fieldName, path string) error {
file, err := os.Open(path)
if err != nil {
return err
}
defer file.Close()
part, err := w.CreateFormFile(fieldName, filepath.Base(path))
if err != nil {
return err
}
_, err = io.Copy(part, file)
return err
}
// Prevent trying to import "fmt"
func reportError(format string, a ...interface{}) (error) {
return fmt.Errorf(format, a...)
}
// Set request body from an interface{}
func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) {
if bodyBuf == nil {
bodyBuf = &bytes.Buffer{}
}
if reader, ok := body.(io.Reader); ok {
_, err = bodyBuf.ReadFrom(reader)
} else if b, ok := body.([]byte); ok {
_, err = bodyBuf.Write(b)
} else if s, ok := body.(string); ok {
_, err = bodyBuf.WriteString(s)
} else if jsonCheck.MatchString(contentType) {
err = json.NewEncoder(bodyBuf).Encode(body)
} else if xmlCheck.MatchString(contentType) {
xml.NewEncoder(bodyBuf).Encode(body)
}
if err != nil {
return nil, err
}
if bodyBuf.Len() == 0 {
err = fmt.Errorf("Invalid body type %s\n", contentType)
return nil, err
}
return bodyBuf, nil
}
// detectContentType method is used to figure out `Request.Body` content type for request header
func detectContentType(body interface{}) string {
contentType := "text/plain; charset=utf-8"
kind := reflect.TypeOf(body).Kind()
switch kind {
case reflect.Struct, reflect.Map, reflect.Ptr:
contentType = "application/json; charset=utf-8"
case reflect.String:
contentType = "text/plain; charset=utf-8"
default:
if b, ok := body.([]byte); ok {
contentType = http.DetectContentType(b)
} else if kind == reflect.Slice {
contentType = "application/json; charset=utf-8"
}
}
return contentType
}
// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go
type cacheControl map[string]string
func parseCacheControl(headers http.Header) cacheControl {
cc := cacheControl{}
ccHeader := headers.Get("Cache-Control")
for _, part := range strings.Split(ccHeader, ",") {
part = strings.Trim(part, " ")
if part == "" {
continue
}
if strings.ContainsRune(part, '=') {
keyval := strings.Split(part, "=")
cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",")
} else {
cc[part] = ""
}
}
return cc
}
// CacheExpires helper function to determine remaining time before repeating a request.
func CacheExpires(r *http.Response) (time.Time) {
// Figure out when the cache expires.
var expires time.Time
now, err := time.Parse(time.RFC1123, r.Header.Get("date"))
if err != nil {
return time.Now()
}
respCacheControl := parseCacheControl(r.Header)
if maxAge, ok := respCacheControl["max-age"]; ok {
lifetime, err := time.ParseDuration(maxAge + "s")
if err != nil {
expires = now
}
expires = now.Add(lifetime)
} else {
expiresHeader := r.Header.Get("Expires")
if expiresHeader != "" {
expires, err = time.Parse(time.RFC1123, expiresHeader)
if err != nil {
expires = now
}
}
}
return expires
}
func strlen(s string) (int) {
return utf8.RuneCountInString(s)
}

44
api_response.go Normal file
View File

@ -0,0 +1,44 @@
/*
* Vikunja API
*
* This is the documentation for the [Vikunja](http://vikunja.io) API. Vikunja is a cross-plattform Todo-application with a lot of features, such as sharing lists with users or teams. <!-- ReDoc-Inject: <security-definitions> --> # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer <jwt-token>`-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. <!-- ReDoc-Inject: <security-definitions> -->
*
* API version: 0.8+21-854fde1e4c
* Contact: hello@vikunja.io
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package swagger
import (
"net/http"
)
type APIResponse struct {
*http.Response `json:"-"`
Message string `json:"message,omitempty"`
// Operation is the name of the swagger operation.
Operation string `json:"operation,omitempty"`
// RequestURL is the request URL. This value is always available, even if the
// embedded *http.Response is nil.
RequestURL string `json:"url,omitempty"`
// Method is the HTTP method used for the request. This value is always
// available, even if the embedded *http.Response is nil.
Method string `json:"method,omitempty"`
// Payload holds the contents of the response body (which may be nil or empty).
// This is provided here as the raw response.Body() reader will have already
// been drained.
Payload []byte `json:"-"`
}
func NewAPIResponse(r *http.Response) *APIResponse {
response := &APIResponse{Response: r}
return response
}
func NewAPIResponseWithError(errorMessage string) *APIResponse {
response := &APIResponse{Message: errorMessage}
return response
}

361
assignees_api.go Normal file
View File

@ -0,0 +1,361 @@
/*
* Vikunja API
*
* This is the documentation for the [Vikunja](http://vikunja.io) API. Vikunja is a cross-plattform Todo-application with a lot of features, such as sharing lists with users or teams. <!-- ReDoc-Inject: <security-definitions> --> # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer <jwt-token>`-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. <!-- ReDoc-Inject: <security-definitions> -->
*
* API version: 0.8+21-854fde1e4c
* Contact: hello@vikunja.io
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package swagger
import (
"io/ioutil"
"net/url"
"net/http"
"strings"
"golang.org/x/net/context"
"encoding/json"
"fmt"
)
// Linger please
var (
_ context.Context
)
type AssigneesApiService service
/* AssigneesApiService Add multiple new assignees to a task
Adds multiple new assignees to a task. The assignee needs to have access to the list, the doer must be able to edit this task. Every user not in the list will be unassigned from the task, pass an empty array to unassign everyone.
* @param ctx context.Context for authentication, logging, tracing, etc.
@param assignee The array of assignees
@param taskID Task ID
@return ModelsTaskAssginee*/
func (a *AssigneesApiService) TasksTaskIDAssigneesBulkPost(ctx context.Context, assignee ModelsBulkAssignees, taskID int32) (ModelsTaskAssginee, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Post")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload ModelsTaskAssginee
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/tasks/{taskID}/assignees/bulk"
localVarPath = strings.Replace(localVarPath, "{"+"taskID"+"}", fmt.Sprintf("%v", taskID), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &assignee
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["Authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* AssigneesApiService Get all assignees for a task
Returns an array with all assignees for this task.
* @param ctx context.Context for authentication, logging, tracing, etc.
@param taskID Task ID
@param optional (nil or map[string]interface{}) with one or more of:
@param "p" (int32) The page number. Used for pagination. If not provided, the first page of results is returned.
@param "s" (string) Search assignees by their username.
@return []ModelsUser*/
func (a *AssigneesApiService) TasksTaskIDAssigneesGet(ctx context.Context, taskID int32, localVarOptionals map[string]interface{}) ([]ModelsUser, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload []ModelsUser
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/tasks/{taskID}/assignees"
localVarPath = strings.Replace(localVarPath, "{"+"taskID"+"}", fmt.Sprintf("%v", taskID), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["p"], "int32", "p"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["s"], "string", "s"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["p"].(int32); localVarOk {
localVarQueryParams.Add("p", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["s"].(string); localVarOk {
localVarQueryParams.Add("s", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["Authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* AssigneesApiService Add a new assignee to a task
Adds a new assignee to a task. The assignee needs to have access to the list, the doer must be able to edit this task.
* @param ctx context.Context for authentication, logging, tracing, etc.
@param assignee The assingee object
@param taskID Task ID
@return ModelsTaskAssginee*/
func (a *AssigneesApiService) TasksTaskIDAssigneesPut(ctx context.Context, assignee ModelsTaskAssginee, taskID int32) (ModelsTaskAssginee, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Put")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload ModelsTaskAssginee
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/tasks/{taskID}/assignees"
localVarPath = strings.Replace(localVarPath, "{"+"taskID"+"}", fmt.Sprintf("%v", taskID), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &assignee
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["Authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* AssigneesApiService Delete an assignee
Un-assign a user from a task.
* @param ctx context.Context for authentication, logging, tracing, etc.
@param taskID Task ID
@param userID Assignee user ID
@return ModelsMessage*/
func (a *AssigneesApiService) TasksTaskIDAssigneesUserIDDelete(ctx context.Context, taskID int32, userID int32) (ModelsMessage, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Delete")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload ModelsMessage
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/tasks/{taskID}/assignees/{userID}"
localVarPath = strings.Replace(localVarPath, "{"+"taskID"+"}", fmt.Sprintf("%v", taskID), -1)
localVarPath = strings.Replace(localVarPath, "{"+"userID"+"}", fmt.Sprintf("%v", userID), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["Authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}

View File

@ -0,0 +1,18 @@
/*
* Vikunja API
*
* This is the documentation for the [Vikunja](http://vikunja.io) API. Vikunja is a cross-plattform Todo-application with a lot of features, such as sharing lists with users or teams. <!-- ReDoc-Inject: <security-definitions> --> # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer <jwt-token>`-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. <!-- ReDoc-Inject: <security-definitions> -->
*
* API version: 0.8+21-854fde1e4c
* Contact: hello@vikunja.io
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package swagger
type CodeVikunjaIoWebHttpError struct {
Code int32 `json:"code,omitempty"`
Message string `json:"message,omitempty"`
}

73
configuration.go Normal file
View File

@ -0,0 +1,73 @@
/*
* Vikunja API
*
* This is the documentation for the [Vikunja](http://vikunja.io) API. Vikunja is a cross-plattform Todo-application with a lot of features, such as sharing lists with users or teams. <!-- ReDoc-Inject: <security-definitions> --> # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer <jwt-token>`-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. <!-- ReDoc-Inject: <security-definitions> -->
*
* API version: 0.8+21-854fde1e4c
* Contact: hello@vikunja.io
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package swagger
import (
"net/http"
)
// contextKeys are used to identify the type of value in the context.
// Since these are string, it is possible to get a short description of the
// context key for logging and debugging using key.String().
type contextKey string
func (c contextKey) String() string {
return "auth " + string(c)
}
var (
// ContextOAuth2 takes a oauth2.TokenSource as authentication for the request.
ContextOAuth2 = contextKey("token")
// ContextBasicAuth takes BasicAuth as authentication for the request.
ContextBasicAuth = contextKey("basic")
// ContextAccessToken takes a string oauth2 access token as authentication for the request.
ContextAccessToken = contextKey("accesstoken")
// ContextAPIKey takes an APIKey as authentication for the request
ContextAPIKey = contextKey("apikey")
)
// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth
type BasicAuth struct {
UserName string `json:"userName,omitempty"`
Password string `json:"password,omitempty"`
}
// APIKey provides API key based authentication to a request passed via context using ContextAPIKey
type APIKey struct {
Key string
Prefix string
}
type Configuration struct {
BasePath string `json:"basePath,omitempty"`
Host string `json:"host,omitempty"`
Scheme string `json:"scheme,omitempty"`
DefaultHeader map[string]string `json:"defaultHeader,omitempty"`
UserAgent string `json:"userAgent,omitempty"`
HTTPClient *http.Client
}
func NewConfiguration() *Configuration {
cfg := &Configuration{
BasePath: "https://localhost/api/v1",
DefaultHeader: make(map[string]string),
UserAgent: "Swagger-Codegen/1.0.0/go",
}
return cfg
}
func (c *Configuration) AddDefaultHeader(key string, value string) {
c.DefaultHeader[key] = value
}

137
docs/AssigneesApi.md Normal file
View File

@ -0,0 +1,137 @@
# \AssigneesApi
All URIs are relative to *https://localhost/api/v1*
Method | HTTP request | Description
------------- | ------------- | -------------
[**TasksTaskIDAssigneesBulkPost**](AssigneesApi.md#TasksTaskIDAssigneesBulkPost) | **Post** /tasks/{taskID}/assignees/bulk | Add multiple new assignees to a task
[**TasksTaskIDAssigneesGet**](AssigneesApi.md#TasksTaskIDAssigneesGet) | **Get** /tasks/{taskID}/assignees | Get all assignees for a task
[**TasksTaskIDAssigneesPut**](AssigneesApi.md#TasksTaskIDAssigneesPut) | **Put** /tasks/{taskID}/assignees | Add a new assignee to a task
[**TasksTaskIDAssigneesUserIDDelete**](AssigneesApi.md#TasksTaskIDAssigneesUserIDDelete) | **Delete** /tasks/{taskID}/assignees/{userID} | Delete an assignee
# **TasksTaskIDAssigneesBulkPost**
> ModelsTaskAssginee TasksTaskIDAssigneesBulkPost(ctx, assignee, taskID)
Add multiple new assignees to a task
Adds multiple new assignees to a task. The assignee needs to have access to the list, the doer must be able to edit this task. Every user not in the list will be unassigned from the task, pass an empty array to unassign everyone.
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**assignee** | [**ModelsBulkAssignees**](ModelsBulkAssignees.md)| The array of assignees |
**taskID** | **int32**| Task ID |
### Return type
[**ModelsTaskAssginee**](models.TaskAssginee.md)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **TasksTaskIDAssigneesGet**
> []ModelsUser TasksTaskIDAssigneesGet(ctx, taskID, optional)
Get all assignees for a task
Returns an array with all assignees for this task.
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**taskID** | **int32**| Task ID |
**optional** | **map[string]interface{}** | optional parameters | nil if no parameters
### Optional Parameters
Optional parameters are passed through a map[string]interface{}.
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**taskID** | **int32**| Task ID |
**p** | **int32**| The page number. Used for pagination. If not provided, the first page of results is returned. |
**s** | **string**| Search assignees by their username. |
### Return type
[**[]ModelsUser**](models.User.md)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **TasksTaskIDAssigneesPut**
> ModelsTaskAssginee TasksTaskIDAssigneesPut(ctx, assignee, taskID)
Add a new assignee to a task
Adds a new assignee to a task. The assignee needs to have access to the list, the doer must be able to edit this task.
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**assignee** | [**ModelsTaskAssginee**](ModelsTaskAssginee.md)| The assingee object |
**taskID** | **int32**| Task ID |
### Return type
[**ModelsTaskAssginee**](models.TaskAssginee.md)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **TasksTaskIDAssigneesUserIDDelete**
> ModelsMessage TasksTaskIDAssigneesUserIDDelete(ctx, taskID, userID)
Delete an assignee
Un-assign a user from a task.
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**taskID** | **int32**| Task ID |
**userID** | **int32**| Assignee user ID |
### Return type
[**ModelsMessage**](models.Message.md)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

View File

@ -0,0 +1,11 @@
# CodeVikunjaIoWebHttpError
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Code** | **int32** | | [optional] [default to null]
**Message** | **string** | | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

14
docs/FilesFile.md Normal file
View File

@ -0,0 +1,14 @@
# FilesFile
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Created** | **string** | | [optional] [default to null]
**Id** | **int32** | | [optional] [default to null]
**Mime** | **string** | | [optional] [default to null]
**Name** | **string** | | [optional] [default to null]
**Size** | **int32** | | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

291
docs/LabelsApi.md Normal file
View File

@ -0,0 +1,291 @@
# \LabelsApi
All URIs are relative to *https://localhost/api/v1*
Method | HTTP request | Description
------------- | ------------- | -------------
[**LabelsGet**](LabelsApi.md#LabelsGet) | **Get** /labels | Get all labels a user has access to
[**LabelsIdDelete**](LabelsApi.md#LabelsIdDelete) | **Delete** /labels/{id} | Delete a label
[**LabelsIdGet**](LabelsApi.md#LabelsIdGet) | **Get** /labels/{id} | Gets one label
[**LabelsIdPut**](LabelsApi.md#LabelsIdPut) | **Put** /labels/{id} | Update a label
[**LabelsPut**](LabelsApi.md#LabelsPut) | **Put** /labels | Create a label
[**TasksTaskIDLabelsBulkPost**](LabelsApi.md#TasksTaskIDLabelsBulkPost) | **Post** /tasks/{taskID}/labels/bulk | Update all labels on a task.
[**TasksTaskLabelsGet**](LabelsApi.md#TasksTaskLabelsGet) | **Get** /tasks/{task}/labels | Get all labels on a task
[**TasksTaskLabelsLabelDelete**](LabelsApi.md#TasksTaskLabelsLabelDelete) | **Delete** /tasks/{task}/labels/{label} | Remove a label from a task
[**TasksTaskLabelsPut**](LabelsApi.md#TasksTaskLabelsPut) | **Put** /tasks/{task}/labels | Add a label to a task
# **LabelsGet**
> []ModelsLabel LabelsGet(ctx, optional)
Get all labels a user has access to
Returns all labels which are either created by the user or associated with a task the user has at least read-access to.
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**optional** | **map[string]interface{}** | optional parameters | nil if no parameters
### Optional Parameters
Optional parameters are passed through a map[string]interface{}.
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**p** | **int32**| The page number. Used for pagination. If not provided, the first page of results is returned. |
**s** | **string**| Search labels by label text. |
### Return type
[**[]ModelsLabel**](models.Label.md)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **LabelsIdDelete**
> ModelsLabel LabelsIdDelete(ctx, id)
Delete a label
Delete an existing label. The user needs to be the creator of the label to be able to do this.
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**id** | **int32**| Label ID |
### Return type
[**ModelsLabel**](models.Label.md)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **LabelsIdGet**
> ModelsLabel LabelsIdGet(ctx, id)
Gets one label
Returns one label by its ID.
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**id** | **int32**| Label ID |
### Return type
[**ModelsLabel**](models.Label.md)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **LabelsIdPut**
> ModelsLabel LabelsIdPut(ctx, id, label)
Update a label
Update an existing label. The user needs to be the creator of the label to be able to do this.
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**id** | **int32**| Label ID |
**label** | [**ModelsLabel**](ModelsLabel.md)| The label object |
### Return type
[**ModelsLabel**](models.Label.md)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **LabelsPut**
> ModelsLabel LabelsPut(ctx, label)
Create a label
Creates a new label.
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**label** | [**ModelsLabel**](ModelsLabel.md)| The label object |
### Return type
[**ModelsLabel**](models.Label.md)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **TasksTaskIDLabelsBulkPost**
> ModelsLabelTaskBulk TasksTaskIDLabelsBulkPost(ctx, label, taskID)
Update all labels on a task.
Updates all labels on a task. Every label which is not passed but exists on the task will be deleted. Every label which does not exist on the task will be added. All labels which are passed and already exist on the task won't be touched.
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**label** | [**ModelsLabelTaskBulk**](ModelsLabelTaskBulk.md)| The array of labels |
**taskID** | **int32**| Task ID |
### Return type
[**ModelsLabelTaskBulk**](models.LabelTaskBulk.md)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **TasksTaskLabelsGet**
> []ModelsLabel TasksTaskLabelsGet(ctx, task, optional)
Get all labels on a task
Returns all labels which are assicociated with a given task.
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**task** | **int32**| Task ID |
**optional** | **map[string]interface{}** | optional parameters | nil if no parameters
### Optional Parameters
Optional parameters are passed through a map[string]interface{}.
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**task** | **int32**| Task ID |
**p** | **int32**| The page number. Used for pagination. If not provided, the first page of results is returned. |
**s** | **string**| Search labels by label text. |
### Return type
[**[]ModelsLabel**](models.Label.md)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **TasksTaskLabelsLabelDelete**
> ModelsMessage TasksTaskLabelsLabelDelete(ctx, task, label)
Remove a label from a task
Remove a label from a task. The user needs to have write-access to the list to be able do this.
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**task** | **int32**| Task ID |
**label** | **int32**| Label ID |
### Return type
[**ModelsMessage**](models.Message.md)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **TasksTaskLabelsPut**
> ModelsLabelTask TasksTaskLabelsPut(ctx, task, label)
Add a label to a task
Add a label to a task. The user needs to have write-access to the list to be able do this.
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**task** | **int32**| Task ID |
**label** | [**ModelsLabelTask**](ModelsLabelTask.md)| The label object |
### Return type
[**ModelsLabelTask**](models.LabelTask.md)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

201
docs/ListApi.md Normal file
View File

@ -0,0 +1,201 @@
# \ListApi
All URIs are relative to *https://localhost/api/v1*
Method | HTTP request | Description
------------- | ------------- | -------------
[**ListsGet**](ListApi.md#ListsGet) | **Get** /lists | Get all lists a user has access to
[**ListsIdDelete**](ListApi.md#ListsIdDelete) | **Delete** /lists/{id} | Deletes a list
[**ListsIdGet**](ListApi.md#ListsIdGet) | **Get** /lists/{id} | Gets one list
[**ListsIdListusersGet**](ListApi.md#ListsIdListusersGet) | **Get** /lists/{id}/listusers | Get users
[**ListsIdPost**](ListApi.md#ListsIdPost) | **Post** /lists/{id} | Updates a list
[**NamespacesNamespaceIDListsPut**](ListApi.md#NamespacesNamespaceIDListsPut) | **Put** /namespaces/{namespaceID}/lists | Creates a new list
# **ListsGet**
> []ModelsList ListsGet(ctx, optional)
Get all lists a user has access to
Returns all lists a user has access to.
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**optional** | **map[string]interface{}** | optional parameters | nil if no parameters
### Optional Parameters
Optional parameters are passed through a map[string]interface{}.
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**p** | **int32**| The page number. Used for pagination. If not provided, the first page of results is returned. |
**s** | **string**| Search lists by title. |
### Return type
[**[]ModelsList**](models.List.md)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **ListsIdDelete**
> ModelsMessage ListsIdDelete(ctx, id)
Deletes a list
Delets a list
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**id** | **int32**| List ID |
### Return type
[**ModelsMessage**](models.Message.md)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **ListsIdGet**
> ModelsList ListsIdGet(ctx, id)
Gets one list
Returns a list by its ID.
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**id** | **int32**| List ID |
### Return type
[**ModelsList**](models.List.md)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **ListsIdListusersGet**
> []ModelsUser ListsIdListusersGet(ctx, id, optional)
Get users
Lists all users (without emailadresses). Also possible to search for a specific user.
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**id** | **int32**| List ID |
**optional** | **map[string]interface{}** | optional parameters | nil if no parameters
### Optional Parameters
Optional parameters are passed through a map[string]interface{}.
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **int32**| List ID |
**s** | **string**| Search for a user by its name. |
### Return type
[**[]ModelsUser**](models.User.md)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **ListsIdPost**
> ModelsList ListsIdPost(ctx, id, list)
Updates a list
Updates a list. This does not include adding a task (see below).
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**id** | **int32**| List ID |
**list** | [**ModelsList**](ModelsList.md)| The list with updated values you want to update. |
### Return type
[**ModelsList**](models.List.md)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **NamespacesNamespaceIDListsPut**
> ModelsList NamespacesNamespaceIDListsPut(ctx, namespaceID, list)
Creates a new list
Creates a new list in a given namespace. The user needs write-access to the namespace.
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**namespaceID** | **int32**| Namespace ID |
**list** | [**ModelsList**](ModelsList.md)| The list you want to create. |
### Return type
[**ModelsList**](models.List.md)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

View File

@ -0,0 +1,13 @@
# ModelsApiUserPassword
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Email** | **string** | The user&#39;s email address | [optional] [default to null]
**Id** | **int32** | The unique, numeric id of this user. | [optional] [default to null]
**Password** | **string** | The user&#39;s password in clear text. Only used when registering the user. | [optional] [default to null]
**Username** | **string** | The username of the username. Is always unique. | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -0,0 +1,10 @@
# ModelsBulkAssignees
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Assignees** | [**[]ModelsUser**](models.User.md) | A list with all assignees | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

31
docs/ModelsBulkTask.md Normal file
View File

@ -0,0 +1,31 @@
# ModelsBulkTask
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Assignees** | [**[]ModelsUser**](models.User.md) | An array of users who are assigned to this task | [optional] [default to null]
**Attachments** | [**[]ModelsTaskAttachment**](models.TaskAttachment.md) | All attachments this task has | [optional] [default to null]
**Created** | **int32** | A unix timestamp when this task was created. You cannot change this value. | [optional] [default to null]
**CreatedBy** | [***ModelsUser**](models.User.md) | The user who initially created the task. | [optional] [default to null]
**Description** | **string** | The task description. | [optional] [default to null]
**Done** | **bool** | Whether a task is done or not. | [optional] [default to null]
**DoneAt** | **int32** | The unix timestamp when a task was marked as done. | [optional] [default to null]
**DueDate** | **int32** | A unix timestamp when the task is due. | [optional] [default to null]
**EndDate** | **int32** | When this task ends. | [optional] [default to null]
**HexColor** | **string** | The task color in hex | [optional] [default to null]
**Id** | **int32** | The unique, numeric id of this task. | [optional] [default to null]
**Labels** | [**[]ModelsLabel**](models.Label.md) | An array of labels which are associated with this task. | [optional] [default to null]
**ListID** | **int32** | The list this task belongs to. | [optional] [default to null]
**PercentDone** | **float32** | Determines how far a task is left from being done | [optional] [default to null]
**Priority** | **int32** | The task priority. Can be anything you want, it is possible to sort by this later. | [optional] [default to null]
**RelatedTasks** | [***ModelsRelatedTaskMap**](models.RelatedTaskMap.md) | All related tasks, grouped by their relation kind | [optional] [default to null]
**ReminderDates** | **[]int32** | An array of unix timestamps when the user wants to be reminded of the task. | [optional] [default to null]
**RepeatAfter** | **int32** | An amount in seconds this task repeats itself. If this is set, when marking the task as done, it will mark itself as \&quot;undone\&quot; and then increase all remindes and the due date by its amount. | [optional] [default to null]
**StartDate** | **int32** | When this task starts. | [optional] [default to null]
**TaskIds** | **[]int32** | A list of task ids to update | [optional] [default to null]
**Text** | **string** | The task text. This is what you&#39;ll see in the list. | [optional] [default to null]
**Updated** | **int32** | A unix timestamp when this task was last updated. You cannot change this value. | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -0,0 +1,10 @@
# ModelsEmailConfirm
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Token** | **string** | The email confirm token sent via email. | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

16
docs/ModelsLabel.md Normal file
View File

@ -0,0 +1,16 @@
# ModelsLabel
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Created** | **int32** | A unix timestamp when this label was created. You cannot change this value. | [optional] [default to null]
**CreatedBy** | [***ModelsUser**](models.User.md) | The user who created this label | [optional] [default to null]
**Description** | **string** | The label description. | [optional] [default to null]
**HexColor** | **string** | The color this label has | [optional] [default to null]
**Id** | **int32** | The unique, numeric id of this label. | [optional] [default to null]
**Title** | **string** | The title of the lable. You&#39;ll see this one on tasks associated with it. | [optional] [default to null]
**Updated** | **int32** | A unix timestamp when this label was last updated. You cannot change this value. | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

11
docs/ModelsLabelTask.md Normal file
View File

@ -0,0 +1,11 @@
# ModelsLabelTask
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Created** | **int32** | A unix timestamp when this task was created. You cannot change this value. | [optional] [default to null]
**LabelId** | **int32** | The label id you want to associate with a task. | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -0,0 +1,10 @@
# ModelsLabelTaskBulk
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Labels** | [**[]ModelsLabel**](models.Label.md) | All labels you want to update at once. | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

16
docs/ModelsLinkSharing.md Normal file
View File

@ -0,0 +1,16 @@
# ModelsLinkSharing
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Created** | **int32** | A unix timestamp when this list was shared. You cannot change this value. | [optional] [default to null]
**Hash** | **string** | The public id to get this shared list | [optional] [default to null]
**Id** | **int32** | The ID of the shared thing | [optional] [default to null]
**Right** | **int32** | The right this list is shared with. 0 &#x3D; Read only, 1 &#x3D; Read &amp; Write, 2 &#x3D; Admin. See the docs for more details. | [optional] [default to null]
**SharedBy** | [***ModelsUser**](models.User.md) | The user who shared this list | [optional] [default to null]
**SharingType** | **int32** | The kind of this link. 0 &#x3D; undefined, 1 &#x3D; without password, 2 &#x3D; with password (currently not implemented). | [optional] [default to null]
**Updated** | **int32** | A unix timestamp when this share was last updated. You cannot change this value. | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

16
docs/ModelsList.md Normal file
View File

@ -0,0 +1,16 @@
# ModelsList
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Created** | **int32** | A unix timestamp when this list was created. You cannot change this value. | [optional] [default to null]
**Description** | **string** | The description of the list. | [optional] [default to null]
**Id** | **int32** | The unique, numeric id of this list. | [optional] [default to null]
**Owner** | [***ModelsUser**](models.User.md) | The user who created this list. | [optional] [default to null]
**Tasks** | [**[]ModelsTask**](models.Task.md) | An array of tasks which belong to the list. | [optional] [default to null]
**Title** | **string** | The title of the list. You&#39;ll see this in the namespace overview. | [optional] [default to null]
**Updated** | **int32** | A unix timestamp when this list was last updated. You cannot change this value. | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

14
docs/ModelsListUser.md Normal file
View File

@ -0,0 +1,14 @@
# ModelsListUser
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Created** | **int32** | A unix timestamp when this relation was created. You cannot change this value. | [optional] [default to null]
**Id** | **int32** | The unique, numeric id of this list &lt;-&gt; user relation. | [optional] [default to null]
**Right** | **int32** | The right this user has. 0 &#x3D; Read only, 1 &#x3D; Read &amp; Write, 2 &#x3D; Admin. See the docs for more details. | [optional] [default to null]
**Updated** | **int32** | A unix timestamp when this relation was last updated. You cannot change this value. | [optional] [default to null]
**UserID** | **string** | The username. | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

10
docs/ModelsMessage.md Normal file
View File

@ -0,0 +1,10 @@
# ModelsMessage
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Message** | **string** | A standard message. | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

15
docs/ModelsNamespace.md Normal file
View File

@ -0,0 +1,15 @@
# ModelsNamespace
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Created** | **int32** | A unix timestamp when this namespace was created. You cannot change this value. | [optional] [default to null]
**Description** | **string** | The description of the namespace | [optional] [default to null]
**Id** | **int32** | The unique, numeric id of this namespace. | [optional] [default to null]
**Name** | **string** | The name of this namespace. | [optional] [default to null]
**Owner** | [***ModelsUser**](models.User.md) | The user who owns this namespace | [optional] [default to null]
**Updated** | **int32** | A unix timestamp when this namespace was last updated. You cannot change this value. | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -0,0 +1,14 @@
# ModelsNamespaceUser
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Created** | **int32** | A unix timestamp when this relation was created. You cannot change this value. | [optional] [default to null]
**Id** | **int32** | The unique, numeric id of this namespace &lt;-&gt; user relation. | [optional] [default to null]
**Right** | **int32** | The right this user has. 0 &#x3D; Read only, 1 &#x3D; Read &amp; Write, 2 &#x3D; Admin. See the docs for more details. | [optional] [default to null]
**Updated** | **int32** | A unix timestamp when this relation was last updated. You cannot change this value. | [optional] [default to null]
**UserID** | **string** | The username. | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -0,0 +1,16 @@
# ModelsNamespaceWithLists
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Created** | **int32** | A unix timestamp when this namespace was created. You cannot change this value. | [optional] [default to null]
**Description** | **string** | The description of the namespace | [optional] [default to null]
**Id** | **int32** | The unique, numeric id of this namespace. | [optional] [default to null]
**Lists** | [**[]ModelsList**](models.List.md) | | [optional] [default to null]
**Name** | **string** | The name of this namespace. | [optional] [default to null]
**Owner** | [***ModelsUser**](models.User.md) | The user who owns this namespace | [optional] [default to null]
**Updated** | **int32** | A unix timestamp when this namespace was last updated. You cannot change this value. | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -0,0 +1,11 @@
# ModelsPasswordReset
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**NewPassword** | **string** | The new password for this user. | [optional] [default to null]
**Token** | **string** | The previously issued reset token. | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -0,0 +1,10 @@
# ModelsPasswordTokenRequest
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Email** | **string** | | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -0,0 +1,9 @@
# ModelsRelatedTaskMap
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

30
docs/ModelsTask.md Normal file
View File

@ -0,0 +1,30 @@
# ModelsTask
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Assignees** | [**[]ModelsUser**](models.User.md) | An array of users who are assigned to this task | [optional] [default to null]
**Attachments** | [**[]ModelsTaskAttachment**](models.TaskAttachment.md) | All attachments this task has | [optional] [default to null]
**Created** | **int32** | A unix timestamp when this task was created. You cannot change this value. | [optional] [default to null]
**CreatedBy** | [***ModelsUser**](models.User.md) | The user who initially created the task. | [optional] [default to null]
**Description** | **string** | The task description. | [optional] [default to null]
**Done** | **bool** | Whether a task is done or not. | [optional] [default to null]
**DoneAt** | **int32** | The unix timestamp when a task was marked as done. | [optional] [default to null]
**DueDate** | **int32** | A unix timestamp when the task is due. | [optional] [default to null]
**EndDate** | **int32** | When this task ends. | [optional] [default to null]
**HexColor** | **string** | The task color in hex | [optional] [default to null]
**Id** | **int32** | The unique, numeric id of this task. | [optional] [default to null]
**Labels** | [**[]ModelsLabel**](models.Label.md) | An array of labels which are associated with this task. | [optional] [default to null]
**ListID** | **int32** | The list this task belongs to. | [optional] [default to null]
**PercentDone** | **float32** | Determines how far a task is left from being done | [optional] [default to null]
**Priority** | **int32** | The task priority. Can be anything you want, it is possible to sort by this later. | [optional] [default to null]
**RelatedTasks** | [***ModelsRelatedTaskMap**](models.RelatedTaskMap.md) | All related tasks, grouped by their relation kind | [optional] [default to null]
**ReminderDates** | **[]int32** | An array of unix timestamps when the user wants to be reminded of the task. | [optional] [default to null]
**RepeatAfter** | **int32** | An amount in seconds this task repeats itself. If this is set, when marking the task as done, it will mark itself as \&quot;undone\&quot; and then increase all remindes and the due date by its amount. | [optional] [default to null]
**StartDate** | **int32** | When this task starts. | [optional] [default to null]
**Text** | **string** | The task text. This is what you&#39;ll see in the list. | [optional] [default to null]
**Updated** | **int32** | A unix timestamp when this task was last updated. You cannot change this value. | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -0,0 +1,11 @@
# ModelsTaskAssginee
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Created** | **int32** | | [optional] [default to null]
**UserId** | **int32** | | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -0,0 +1,14 @@
# ModelsTaskAttachment
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Created** | **int32** | | [optional] [default to null]
**CreatedBy** | [***ModelsUser**](models.User.md) | | [optional] [default to null]
**File** | [***FilesFile**](files.File.md) | | [optional] [default to null]
**Id** | **int32** | | [optional] [default to null]
**TaskId** | **int32** | | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -0,0 +1,14 @@
# ModelsTaskRelation
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Created** | **int32** | A unix timestamp when this label was created. You cannot change this value. | [optional] [default to null]
**CreatedBy** | [***ModelsUser**](models.User.md) | The user who created this relation | [optional] [default to null]
**OtherTaskId** | **int32** | The ID of the other task, the task which is being related. | [optional] [default to null]
**RelationKind** | **string** | The kind of the relation. | [optional] [default to null]
**TaskId** | **int32** | The ID of the \&quot;base\&quot; task, the task which has a relation to another. | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

16
docs/ModelsTeam.md Normal file
View File

@ -0,0 +1,16 @@
# ModelsTeam
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Created** | **int32** | A unix timestamp when this relation was created. You cannot change this value. | [optional] [default to null]
**CreatedBy** | [***ModelsUser**](models.User.md) | The user who created this team. | [optional] [default to null]
**Description** | **string** | The team&#39;s description. | [optional] [default to null]
**Id** | **int32** | The unique, numeric id of this team. | [optional] [default to null]
**Members** | [**[]ModelsTeamUser**](models.TeamUser.md) | An array of all members in this team. | [optional] [default to null]
**Name** | **string** | The name of this team. | [optional] [default to null]
**Updated** | **int32** | A unix timestamp when this relation was last updated. You cannot change this value. | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

14
docs/ModelsTeamList.md Normal file
View File

@ -0,0 +1,14 @@
# ModelsTeamList
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Created** | **int32** | A unix timestamp when this relation was created. You cannot change this value. | [optional] [default to null]
**Id** | **int32** | The unique, numeric id of this list &lt;-&gt; team relation. | [optional] [default to null]
**Right** | **int32** | The right this team has. 0 &#x3D; Read only, 1 &#x3D; Read &amp; Write, 2 &#x3D; Admin. See the docs for more details. | [optional] [default to null]
**TeamID** | **int32** | The team id. | [optional] [default to null]
**Updated** | **int32** | A unix timestamp when this relation was last updated. You cannot change this value. | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

13
docs/ModelsTeamMember.md Normal file
View File

@ -0,0 +1,13 @@
# ModelsTeamMember
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Admin** | **bool** | Whether or not the member is an admin of the team. See the docs for more about what a team admin can do | [optional] [default to null]
**Created** | **int32** | A unix timestamp when this relation was created. You cannot change this value. | [optional] [default to null]
**Id** | **int32** | The unique, numeric id of this team member relation. | [optional] [default to null]
**Username** | **string** | The username of the member. We use this to prevent automated user id entering. | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -0,0 +1,14 @@
# ModelsTeamNamespace
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Created** | **int32** | A unix timestamp when this relation was created. You cannot change this value. | [optional] [default to null]
**Id** | **int32** | The unique, numeric id of this namespace &lt;-&gt; team relation. | [optional] [default to null]
**Right** | **int32** | The right this team has. 0 &#x3D; Read only, 1 &#x3D; Read &amp; Write, 2 &#x3D; Admin. See the docs for more details. | [optional] [default to null]
**TeamID** | **int32** | The team id. | [optional] [default to null]
**Updated** | **int32** | A unix timestamp when this relation was last updated. You cannot change this value. | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

16
docs/ModelsTeamUser.md Normal file
View File

@ -0,0 +1,16 @@
# ModelsTeamUser
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Admin** | **bool** | Whether or not the member is an admin of the team. See the docs for more about what a team admin can do | [optional] [default to null]
**AvatarUrl** | **string** | The users md5-hashed email address, used to get the avatar from gravatar and the likes. | [optional] [default to null]
**Created** | **int32** | A unix timestamp when this task was created. You cannot change this value. | [optional] [default to null]
**Email** | **string** | The user&#39;s email address. | [optional] [default to null]
**Id** | **int32** | The unique, numeric id of this user. | [optional] [default to null]
**Updated** | **int32** | A unix timestamp when this task was last updated. You cannot change this value. | [optional] [default to null]
**Username** | **string** | The username of the user. Is always unique. | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -0,0 +1,17 @@
# ModelsTeamWithRight
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Created** | **int32** | A unix timestamp when this relation was created. You cannot change this value. | [optional] [default to null]
**CreatedBy** | [***ModelsUser**](models.User.md) | The user who created this team. | [optional] [default to null]
**Description** | **string** | The team&#39;s description. | [optional] [default to null]
**Id** | **int32** | The unique, numeric id of this team. | [optional] [default to null]
**Members** | [**[]ModelsTeamUser**](models.TeamUser.md) | An array of all members in this team. | [optional] [default to null]
**Name** | **string** | The name of this team. | [optional] [default to null]
**Right** | **int32** | | [optional] [default to null]
**Updated** | **int32** | A unix timestamp when this relation was last updated. You cannot change this value. | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

15
docs/ModelsUser.md Normal file
View File

@ -0,0 +1,15 @@
# ModelsUser
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**AvatarUrl** | **string** | The users md5-hashed email address, used to get the avatar from gravatar and the likes. | [optional] [default to null]
**Created** | **int32** | A unix timestamp when this task was created. You cannot change this value. | [optional] [default to null]
**Email** | **string** | The user&#39;s email address. | [optional] [default to null]
**Id** | **int32** | The unique, numeric id of this user. | [optional] [default to null]
**Updated** | **int32** | A unix timestamp when this task was last updated. You cannot change this value. | [optional] [default to null]
**Username** | **string** | The username of the user. Is always unique. | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

11
docs/ModelsUserLogin.md Normal file
View File

@ -0,0 +1,11 @@
# ModelsUserLogin
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Password** | **string** | The password for the user. | [optional] [default to null]
**Username** | **string** | The username used to log in. | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -0,0 +1,16 @@
# ModelsUserWithRight
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**AvatarUrl** | **string** | The users md5-hashed email address, used to get the avatar from gravatar and the likes. | [optional] [default to null]
**Created** | **int32** | A unix timestamp when this task was created. You cannot change this value. | [optional] [default to null]
**Email** | **string** | The user&#39;s email address. | [optional] [default to null]
**Id** | **int32** | The unique, numeric id of this user. | [optional] [default to null]
**Right** | **int32** | | [optional] [default to null]
**Updated** | **int32** | A unix timestamp when this task was last updated. You cannot change this value. | [optional] [default to null]
**Username** | **string** | The username of the user. Is always unique. | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

191
docs/NamespaceApi.md Normal file
View File

@ -0,0 +1,191 @@
# \NamespaceApi
All URIs are relative to *https://localhost/api/v1*
Method | HTTP request | Description
------------- | ------------- | -------------
[**NamespaceIdPost**](NamespaceApi.md#NamespaceIdPost) | **Post** /namespace/{id} | Updates a namespace
[**NamespacesGet**](NamespaceApi.md#NamespacesGet) | **Get** /namespaces | Get all namespaces a user has access to
[**NamespacesIdDelete**](NamespaceApi.md#NamespacesIdDelete) | **Delete** /namespaces/{id} | Deletes a namespace
[**NamespacesIdGet**](NamespaceApi.md#NamespacesIdGet) | **Get** /namespaces/{id} | Gets one namespace
[**NamespacesIdListsGet**](NamespaceApi.md#NamespacesIdListsGet) | **Get** /namespaces/{id}/lists | Get all lists in a namespace
[**NamespacesPut**](NamespaceApi.md#NamespacesPut) | **Put** /namespaces | Creates a new namespace
# **NamespaceIdPost**
> ModelsNamespace NamespaceIdPost(ctx, id, namespace)
Updates a namespace
Updates a namespace.
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**id** | **int32**| Namespace ID |
**namespace** | [**ModelsNamespace**](ModelsNamespace.md)| The namespace with updated values you want to update. |
### Return type
[**ModelsNamespace**](models.Namespace.md)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **NamespacesGet**
> []ModelsNamespaceWithLists NamespacesGet(ctx, optional)
Get all namespaces a user has access to
Returns all namespaces a user has access to.
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**optional** | **map[string]interface{}** | optional parameters | nil if no parameters
### Optional Parameters
Optional parameters are passed through a map[string]interface{}.
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**p** | **int32**| The page number. Used for pagination. If not provided, the first page of results is returned. |
**s** | **string**| Search namespaces by name. |
### Return type
[**[]ModelsNamespaceWithLists**](models.NamespaceWithLists.md)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **NamespacesIdDelete**
> ModelsMessage NamespacesIdDelete(ctx, id)
Deletes a namespace
Delets a namespace
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**id** | **int32**| Namespace ID |
### Return type
[**ModelsMessage**](models.Message.md)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **NamespacesIdGet**
> ModelsNamespace NamespacesIdGet(ctx, id)
Gets one namespace
Returns a namespace by its ID.
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**id** | **int32**| Namespace ID |
### Return type
[**ModelsNamespace**](models.Namespace.md)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **NamespacesIdListsGet**
> []ModelsList NamespacesIdListsGet(ctx, id)
Get all lists in a namespace
Returns all lists inside of a namespace.
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**id** | **int32**| Namespace ID |
### Return type
[**[]ModelsList**](models.List.md)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **NamespacesPut**
> ModelsNamespace NamespacesPut(ctx, namespace)
Creates a new namespace
Creates a new namespace.
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**namespace** | [**ModelsNamespace**](ModelsNamespace.md)| The namespace you want to create. |
### Return type
[**ModelsNamespace**](models.Namespace.md)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

33
docs/ServiceApi.md Normal file
View File

@ -0,0 +1,33 @@
# \ServiceApi
All URIs are relative to *https://localhost/api/v1*
Method | HTTP request | Description
------------- | ------------- | -------------
[**InfoGet**](ServiceApi.md#InfoGet) | **Get** /info | Info
# **InfoGet**
> V1VikunjaInfos InfoGet(ctx, )
Info
Returns the version, frontendurl, motd and various settings of Vikunja
### Required Parameters
This endpoint does not need any parameter.
### Return type
[**V1VikunjaInfos**](v1.vikunjaInfos.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

686
docs/SharingApi.md Normal file
View File

@ -0,0 +1,686 @@
# \SharingApi
All URIs are relative to *https://localhost/api/v1*
Method | HTTP request | Description
------------- | ------------- | -------------
[**ListsIdTeamsGet**](SharingApi.md#ListsIdTeamsGet) | **Get** /lists/{id}/teams | Get teams on a list
[**ListsIdTeamsPut**](SharingApi.md#ListsIdTeamsPut) | **Put** /lists/{id}/teams | Add a team to a list
[**ListsIdUsersGet**](SharingApi.md#ListsIdUsersGet) | **Get** /lists/{id}/users | Get users on a list
[**ListsIdUsersPut**](SharingApi.md#ListsIdUsersPut) | **Put** /lists/{id}/users | Add a user to a list
[**ListsListIDTeamsTeamIDDelete**](SharingApi.md#ListsListIDTeamsTeamIDDelete) | **Delete** /lists/{listID}/teams/{teamID} | Delete a team from a list
[**ListsListIDTeamsTeamIDPost**](SharingApi.md#ListsListIDTeamsTeamIDPost) | **Post** /lists/{listID}/teams/{teamID} | Update a team &lt;-&gt; list relation
[**ListsListIDUsersUserIDDelete**](SharingApi.md#ListsListIDUsersUserIDDelete) | **Delete** /lists/{listID}/users/{userID} | Delete a user from a list
[**ListsListIDUsersUserIDPost**](SharingApi.md#ListsListIDUsersUserIDPost) | **Post** /lists/{listID}/users/{userID} | Update a user &lt;-&gt; list relation
[**ListsListSharesGet**](SharingApi.md#ListsListSharesGet) | **Get** /lists/{list}/shares | Get all link shares for a list
[**ListsListSharesPut**](SharingApi.md#ListsListSharesPut) | **Put** /lists/{list}/shares | Share a list via link
[**ListsListSharesShareDelete**](SharingApi.md#ListsListSharesShareDelete) | **Delete** /lists/{list}/shares/{share} | Remove a link share
[**ListsListSharesShareGet**](SharingApi.md#ListsListSharesShareGet) | **Get** /lists/{list}/shares/{share} | Get one link shares for a list
[**NamespacesIdTeamsGet**](SharingApi.md#NamespacesIdTeamsGet) | **Get** /namespaces/{id}/teams | Get teams on a namespace
[**NamespacesIdTeamsPut**](SharingApi.md#NamespacesIdTeamsPut) | **Put** /namespaces/{id}/teams | Add a team to a namespace
[**NamespacesIdUsersGet**](SharingApi.md#NamespacesIdUsersGet) | **Get** /namespaces/{id}/users | Get users on a namespace
[**NamespacesIdUsersPut**](SharingApi.md#NamespacesIdUsersPut) | **Put** /namespaces/{id}/users | Add a user to a namespace
[**NamespacesNamespaceIDTeamsTeamIDDelete**](SharingApi.md#NamespacesNamespaceIDTeamsTeamIDDelete) | **Delete** /namespaces/{namespaceID}/teams/{teamID} | Delete a team from a namespace
[**NamespacesNamespaceIDTeamsTeamIDPost**](SharingApi.md#NamespacesNamespaceIDTeamsTeamIDPost) | **Post** /namespaces/{namespaceID}/teams/{teamID} | Update a team &lt;-&gt; namespace relation
[**NamespacesNamespaceIDUsersUserIDDelete**](SharingApi.md#NamespacesNamespaceIDUsersUserIDDelete) | **Delete** /namespaces/{namespaceID}/users/{userID} | Delete a user from a namespace
[**NamespacesNamespaceIDUsersUserIDPost**](SharingApi.md#NamespacesNamespaceIDUsersUserIDPost) | **Post** /namespaces/{namespaceID}/users/{userID} | Update a user &lt;-&gt; namespace relation
[**SharesShareAuthPost**](SharingApi.md#SharesShareAuthPost) | **Post** /shares/{share}/auth | Get an auth token for a share
# **ListsIdTeamsGet**
> []ModelsTeamWithRight ListsIdTeamsGet(ctx, id, optional)
Get teams on a list
Returns a list with all teams which have access on a given list.
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**id** | **int32**| List ID |
**optional** | **map[string]interface{}** | optional parameters | nil if no parameters
### Optional Parameters
Optional parameters are passed through a map[string]interface{}.
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **int32**| List ID |
**p** | **int32**| The page number. Used for pagination. If not provided, the first page of results is returned. |
**s** | **string**| Search teams by its name. |
### Return type
[**[]ModelsTeamWithRight**](models.TeamWithRight.md)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **ListsIdTeamsPut**
> ModelsTeamList ListsIdTeamsPut(ctx, id, list)
Add a team to a list
Gives a team access to a list.
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**id** | **int32**| List ID |
**list** | [**ModelsTeamList**](ModelsTeamList.md)| The team you want to add to the list. |
### Return type
[**ModelsTeamList**](models.TeamList.md)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **ListsIdUsersGet**
> []ModelsUserWithRight ListsIdUsersGet(ctx, id, optional)
Get users on a list
Returns a list with all users which have access on a given list.
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**id** | **int32**| List ID |
**optional** | **map[string]interface{}** | optional parameters | nil if no parameters
### Optional Parameters
Optional parameters are passed through a map[string]interface{}.
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **int32**| List ID |
**p** | **int32**| The page number. Used for pagination. If not provided, the first page of results is returned. |
**s** | **string**| Search users by its name. |
### Return type
[**[]ModelsUserWithRight**](models.UserWithRight.md)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **ListsIdUsersPut**
> ModelsListUser ListsIdUsersPut(ctx, id, list)
Add a user to a list
Gives a user access to a list.
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**id** | **int32**| List ID |
**list** | [**ModelsListUser**](ModelsListUser.md)| The user you want to add to the list. |
### Return type
[**ModelsListUser**](models.ListUser.md)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **ListsListIDTeamsTeamIDDelete**
> ModelsMessage ListsListIDTeamsTeamIDDelete(ctx, listID, teamID)
Delete a team from a list
Delets a team from a list. The team won't have access to the list anymore.
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**listID** | **int32**| List ID |
**teamID** | **int32**| Team ID |
### Return type
[**ModelsMessage**](models.Message.md)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **ListsListIDTeamsTeamIDPost**
> ModelsTeamList ListsListIDTeamsTeamIDPost(ctx, listID, teamID, list)
Update a team <-> list relation
Update a team <-> list relation. Mostly used to update the right that team has.
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**listID** | **int32**| List ID |
**teamID** | **int32**| Team ID |
**list** | [**ModelsTeamList**](ModelsTeamList.md)| The team you want to update. |
### Return type
[**ModelsTeamList**](models.TeamList.md)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **ListsListIDUsersUserIDDelete**
> ModelsMessage ListsListIDUsersUserIDDelete(ctx, listID, userID)
Delete a user from a list
Delets a user from a list. The user won't have access to the list anymore.
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**listID** | **int32**| List ID |
**userID** | **int32**| User ID |
### Return type
[**ModelsMessage**](models.Message.md)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **ListsListIDUsersUserIDPost**
> ModelsListUser ListsListIDUsersUserIDPost(ctx, listID, userID, list)
Update a user <-> list relation
Update a user <-> list relation. Mostly used to update the right that user has.
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**listID** | **int32**| List ID |
**userID** | **int32**| User ID |
**list** | [**ModelsListUser**](ModelsListUser.md)| The user you want to update. |
### Return type
[**ModelsListUser**](models.ListUser.md)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **ListsListSharesGet**
> []ModelsLinkSharing ListsListSharesGet(ctx, list, optional)
Get all link shares for a list
Returns all link shares which exist for a given list
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**list** | **int32**| List ID |
**optional** | **map[string]interface{}** | optional parameters | nil if no parameters
### Optional Parameters
Optional parameters are passed through a map[string]interface{}.
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**list** | **int32**| List ID |
**p** | **int32**| The page number. Used for pagination. If not provided, the first page of results is returned. |
**s** | **string**| Search shares by hash. |
### Return type
[**[]ModelsLinkSharing**](models.LinkSharing.md)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **ListsListSharesPut**
> ModelsLinkSharing ListsListSharesPut(ctx, list, label)
Share a list via link
Share a list via link. The user needs to have write-access to the list to be able do this.
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**list** | **int32**| List ID |
**label** | [**ModelsLinkSharing**](ModelsLinkSharing.md)| The new link share object |
### Return type
[**ModelsLinkSharing**](models.LinkSharing.md)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **ListsListSharesShareDelete**
> ModelsMessage ListsListSharesShareDelete(ctx, list, share)
Remove a link share
Remove a link share. The user needs to have write-access to the list to be able do this.
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**list** | **int32**| List ID |
**share** | **int32**| Share Link ID |
### Return type
[**ModelsMessage**](models.Message.md)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **ListsListSharesShareGet**
> ModelsLinkSharing ListsListSharesShareGet(ctx, list, share)
Get one link shares for a list
Returns one link share by its ID.
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**list** | **int32**| List ID |
**share** | **int32**| Share ID |
### Return type
[**ModelsLinkSharing**](models.LinkSharing.md)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **NamespacesIdTeamsGet**
> []ModelsTeamWithRight NamespacesIdTeamsGet(ctx, id, optional)
Get teams on a namespace
Returns a namespace with all teams which have access on a given namespace.
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**id** | **int32**| Namespace ID |
**optional** | **map[string]interface{}** | optional parameters | nil if no parameters
### Optional Parameters
Optional parameters are passed through a map[string]interface{}.
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **int32**| Namespace ID |
**p** | **int32**| The page number. Used for pagination. If not provided, the first page of results is returned. |
**s** | **string**| Search teams by its name. |
### Return type
[**[]ModelsTeamWithRight**](models.TeamWithRight.md)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **NamespacesIdTeamsPut**
> ModelsTeamNamespace NamespacesIdTeamsPut(ctx, id, namespace)
Add a team to a namespace
Gives a team access to a namespace.
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**id** | **int32**| Namespace ID |
**namespace** | [**ModelsTeamNamespace**](ModelsTeamNamespace.md)| The team you want to add to the namespace. |
### Return type
[**ModelsTeamNamespace**](models.TeamNamespace.md)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **NamespacesIdUsersGet**
> []ModelsUserWithRight NamespacesIdUsersGet(ctx, id, optional)
Get users on a namespace
Returns a namespace with all users which have access on a given namespace.
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**id** | **int32**| Namespace ID |
**optional** | **map[string]interface{}** | optional parameters | nil if no parameters
### Optional Parameters
Optional parameters are passed through a map[string]interface{}.
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **int32**| Namespace ID |
**p** | **int32**| The page number. Used for pagination. If not provided, the first page of results is returned. |
**s** | **string**| Search users by its name. |
### Return type
[**[]ModelsUserWithRight**](models.UserWithRight.md)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **NamespacesIdUsersPut**
> ModelsNamespaceUser NamespacesIdUsersPut(ctx, id, namespace)
Add a user to a namespace
Gives a user access to a namespace.
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**id** | **int32**| Namespace ID |
**namespace** | [**ModelsNamespaceUser**](ModelsNamespaceUser.md)| The user you want to add to the namespace. |
### Return type
[**ModelsNamespaceUser**](models.NamespaceUser.md)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **NamespacesNamespaceIDTeamsTeamIDDelete**
> ModelsMessage NamespacesNamespaceIDTeamsTeamIDDelete(ctx, namespaceID, teamID)
Delete a team from a namespace
Delets a team from a namespace. The team won't have access to the namespace anymore.
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**namespaceID** | **int32**| Namespace ID |
**teamID** | **int32**| team ID |
### Return type
[**ModelsMessage**](models.Message.md)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **NamespacesNamespaceIDTeamsTeamIDPost**
> ModelsTeamNamespace NamespacesNamespaceIDTeamsTeamIDPost(ctx, namespaceID, teamID, namespace)
Update a team <-> namespace relation
Update a team <-> namespace relation. Mostly used to update the right that team has.
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**namespaceID** | **int32**| Namespace ID |
**teamID** | **int32**| Team ID |
**namespace** | [**ModelsTeamNamespace**](ModelsTeamNamespace.md)| The team you want to update. |
### Return type
[**ModelsTeamNamespace**](models.TeamNamespace.md)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **NamespacesNamespaceIDUsersUserIDDelete**
> ModelsMessage NamespacesNamespaceIDUsersUserIDDelete(ctx, namespaceID, userID)
Delete a user from a namespace
Delets a user from a namespace. The user won't have access to the namespace anymore.
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**namespaceID** | **int32**| Namespace ID |
**userID** | **int32**| user ID |
### Return type
[**ModelsMessage**](models.Message.md)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **NamespacesNamespaceIDUsersUserIDPost**
> ModelsNamespaceUser NamespacesNamespaceIDUsersUserIDPost(ctx, namespaceID, userID, namespace)
Update a user <-> namespace relation
Update a user <-> namespace relation. Mostly used to update the right that user has.
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**namespaceID** | **int32**| Namespace ID |
**userID** | **int32**| User ID |
**namespace** | [**ModelsNamespaceUser**](ModelsNamespaceUser.md)| The user you want to update. |
### Return type
[**ModelsNamespaceUser**](models.NamespaceUser.md)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **SharesShareAuthPost**
> V1Token SharesShareAuthPost(ctx, share)
Get an auth token for a share
Get a jwt auth token for a shared list from a share hash.
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**share** | **string**| The share hash |
### Return type
[**V1Token**](v1.Token.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

343
docs/TaskApi.md Normal file
View File

@ -0,0 +1,343 @@
# \TaskApi
All URIs are relative to *https://localhost/api/v1*
Method | HTTP request | Description
------------- | ------------- | -------------
[**ListsIdPut**](TaskApi.md#ListsIdPut) | **Put** /lists/{id} | Create a task
[**TasksAllGet**](TaskApi.md#TasksAllGet) | **Get** /tasks/all | Get tasks
[**TasksBulkPost**](TaskApi.md#TasksBulkPost) | **Post** /tasks/bulk | Update a bunch of tasks at once
[**TasksIdAttachmentsAttachmentIDDelete**](TaskApi.md#TasksIdAttachmentsAttachmentIDDelete) | **Delete** /tasks/{id}/attachments/{attachmentID} | Delete an attachment
[**TasksIdAttachmentsAttachmentIDGet**](TaskApi.md#TasksIdAttachmentsAttachmentIDGet) | **Get** /tasks/{id}/attachments/{attachmentID} | Get one attachment.
[**TasksIdAttachmentsGet**](TaskApi.md#TasksIdAttachmentsGet) | **Get** /tasks/{id}/attachments | Get all attachments for one task.
[**TasksIdAttachmentsPut**](TaskApi.md#TasksIdAttachmentsPut) | **Put** /tasks/{id}/attachments | Upload a task attachment
[**TasksIdDelete**](TaskApi.md#TasksIdDelete) | **Delete** /tasks/{id} | Delete a task
[**TasksIdPost**](TaskApi.md#TasksIdPost) | **Post** /tasks/{id} | Update a task
[**TasksTaskIDRelationsDelete**](TaskApi.md#TasksTaskIDRelationsDelete) | **Delete** /tasks/{taskID}/relations | Remove a task relation
[**TasksTaskIDRelationsPut**](TaskApi.md#TasksTaskIDRelationsPut) | **Put** /tasks/{taskID}/relations | Create a new relation between two tasks
# **ListsIdPut**
> ModelsTask ListsIdPut(ctx, id, task)
Create a task
Inserts a task into a list.
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**id** | **int32**| List ID |
**task** | [**ModelsTask**](ModelsTask.md)| The task object |
### Return type
[**ModelsTask**](models.Task.md)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **TasksAllGet**
> []ModelsTask TasksAllGet(ctx, optional)
Get tasks
Returns all tasks on any list the user has access to.
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**optional** | **map[string]interface{}** | optional parameters | nil if no parameters
### Optional Parameters
Optional parameters are passed through a map[string]interface{}.
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**p** | **int32**| The page number. Used for pagination. If not provided, the first page of results is returned. |
**s** | **string**| Search tasks by task text. |
**sort** | **string**| The sorting parameter. Possible values to sort by are priority, prioritydesc, priorityasc, duedate, duedatedesc, duedateasc. |
**startdate** | **int32**| The start date parameter to filter by. Expects a unix timestamp. If no end date, but a start date is specified, the end date is set to the current time. |
**enddate** | **int32**| The end date parameter to filter by. Expects a unix timestamp. If no start date, but an end date is specified, the start date is set to the current time. |
### Return type
[**[]ModelsTask**](models.Task.md)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **TasksBulkPost**
> ModelsTask TasksBulkPost(ctx, task)
Update a bunch of tasks at once
Updates a bunch of tasks at once. This includes marking them as done. Note: although you could supply another ID, it will be ignored. Use task_ids instead.
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**task** | [**ModelsBulkTask**](ModelsBulkTask.md)| The task object. Looks like a normal task, the only difference is it uses an array of list_ids to update. |
### Return type
[**ModelsTask**](models.Task.md)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **TasksIdAttachmentsAttachmentIDDelete**
> ModelsMessage TasksIdAttachmentsAttachmentIDDelete(ctx, id, attachmentID)
Delete an attachment
Delete an attachment.
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**id** | **int32**| Task ID |
**attachmentID** | **int32**| Attachment ID |
### Return type
[**ModelsMessage**](models.Message.md)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **TasksIdAttachmentsAttachmentIDGet**
> TasksIdAttachmentsAttachmentIDGet(ctx, id, attachmentID)
Get one attachment.
Get one attachment for download. **Returns json on error.**
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**id** | **int32**| Task ID |
**attachmentID** | **int32**| Attachment ID |
### Return type
(empty response body)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/octet-stream
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **TasksIdAttachmentsGet**
> []ModelsTaskAttachment TasksIdAttachmentsGet(ctx, id)
Get all attachments for one task.
Get all task attachments for one task.
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**id** | **int32**| Task ID |
### Return type
[**[]ModelsTaskAttachment**](models.TaskAttachment.md)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **TasksIdAttachmentsPut**
> ModelsMessage TasksIdAttachmentsPut(ctx, id, files)
Upload a task attachment
Upload a task attachment. You can pass multiple files with the files form param.
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**id** | **int32**| Task ID |
**files** | **string**| The file, as multipart form file. You can pass multiple. |
### Return type
[**ModelsMessage**](models.Message.md)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: multipart/form-data
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **TasksIdDelete**
> ModelsMessage TasksIdDelete(ctx, id)
Delete a task
Deletes a task from a list. This does not mean \"mark it done\".
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**id** | **int32**| Task ID |
### Return type
[**ModelsMessage**](models.Message.md)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **TasksIdPost**
> ModelsTask TasksIdPost(ctx, id, task)
Update a task
Updates a task. This includes marking it as done. Assignees you pass will be updated, see their individual endpoints for more details on how this is done. To update labels, see the description of the endpoint.
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**id** | **int32**| Task ID |
**task** | [**ModelsTask**](ModelsTask.md)| The task object |
### Return type
[**ModelsTask**](models.Task.md)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **TasksTaskIDRelationsDelete**
> ModelsMessage TasksTaskIDRelationsDelete(ctx, relation, taskID)
Remove a task relation
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**relation** | [**ModelsTaskRelation**](ModelsTaskRelation.md)| The relation object |
**taskID** | **int32**| Task ID |
### Return type
[**ModelsMessage**](models.Message.md)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **TasksTaskIDRelationsPut**
> ModelsTaskRelation TasksTaskIDRelationsPut(ctx, relation, taskID)
Create a new relation between two tasks
Creates a new relation between two tasks. The user needs to have update rights on the base task and at least read rights on the other task. Both tasks do not need to be on the same list. Take a look at the docs for available task relation kinds.
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**relation** | [**ModelsTaskRelation**](ModelsTaskRelation.md)| The relation object |
**taskID** | **int32**| Task ID |
### Return type
[**ModelsTaskRelation**](models.TaskRelation.md)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

193
docs/TeamApi.md Normal file
View File

@ -0,0 +1,193 @@
# \TeamApi
All URIs are relative to *https://localhost/api/v1*
Method | HTTP request | Description
------------- | ------------- | -------------
[**TeamsGet**](TeamApi.md#TeamsGet) | **Get** /teams | Get teams
[**TeamsIdDelete**](TeamApi.md#TeamsIdDelete) | **Delete** /teams/{id} | Deletes a team
[**TeamsIdMembersPut**](TeamApi.md#TeamsIdMembersPut) | **Put** /teams/{id}/members | Add a user to a team
[**TeamsIdMembersUserIDDelete**](TeamApi.md#TeamsIdMembersUserIDDelete) | **Delete** /teams/{id}/members/{userID} | Remove a user from a team
[**TeamsIdPost**](TeamApi.md#TeamsIdPost) | **Post** /teams/{id} | Updates a team
[**TeamsPut**](TeamApi.md#TeamsPut) | **Put** /teams | Creates a new team
# **TeamsGet**
> []ModelsTeam TeamsGet(ctx, optional)
Get teams
Returns all teams the current user is part of.
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**optional** | **map[string]interface{}** | optional parameters | nil if no parameters
### Optional Parameters
Optional parameters are passed through a map[string]interface{}.
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**p** | **int32**| The page number. Used for pagination. If not provided, the first page of results is returned. |
**s** | **string**| Search teams by its name. |
### Return type
[**[]ModelsTeam**](models.Team.md)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **TeamsIdDelete**
> ModelsMessage TeamsIdDelete(ctx, id)
Deletes a team
Delets a team. This will also remove the access for all users in that team.
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**id** | **int32**| Team ID |
### Return type
[**ModelsMessage**](models.Message.md)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **TeamsIdMembersPut**
> ModelsTeamMember TeamsIdMembersPut(ctx, id, team)
Add a user to a team
Add a user to a team.
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**id** | **int32**| Team ID |
**team** | [**ModelsTeamMember**](ModelsTeamMember.md)| The user to be added to a team. |
### Return type
[**ModelsTeamMember**](models.TeamMember.md)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **TeamsIdMembersUserIDDelete**
> ModelsMessage TeamsIdMembersUserIDDelete(ctx, id, userID)
Remove a user from a team
Remove a user from a team. This will also revoke any access this user might have via that team.
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**id** | **int32**| Team ID |
**userID** | **int32**| User ID |
### Return type
[**ModelsMessage**](models.Message.md)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **TeamsIdPost**
> ModelsTeam TeamsIdPost(ctx, id, team)
Updates a team
Updates a team.
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**id** | **int32**| Team ID |
**team** | [**ModelsTeam**](ModelsTeam.md)| The team with updated values you want to update. |
### Return type
[**ModelsTeam**](models.Team.md)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **TeamsPut**
> ModelsTeam TeamsPut(ctx, team)
Creates a new team
Creates a new team in a given namespace. The user needs write-access to the namespace.
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**team** | [**ModelsTeam**](ModelsTeam.md)| The team you want to create. |
### Return type
[**ModelsTeam**](models.Team.md)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

243
docs/UserApi.md Normal file
View File

@ -0,0 +1,243 @@
# \UserApi
All URIs are relative to *https://localhost/api/v1*
Method | HTTP request | Description
------------- | ------------- | -------------
[**LoginPost**](UserApi.md#LoginPost) | **Post** /login | Login
[**RegisterPost**](UserApi.md#RegisterPost) | **Post** /register | Register
[**UserConfirmPost**](UserApi.md#UserConfirmPost) | **Post** /user/confirm | Confirm the email of a new user
[**UserGet**](UserApi.md#UserGet) | **Get** /user | Get user information
[**UserPasswordPost**](UserApi.md#UserPasswordPost) | **Post** /user/password | Change password
[**UserPasswordResetPost**](UserApi.md#UserPasswordResetPost) | **Post** /user/password/reset | Resets a password
[**UserPasswordTokenPost**](UserApi.md#UserPasswordTokenPost) | **Post** /user/password/token | Request password reset token
[**UsersGet**](UserApi.md#UsersGet) | **Get** /users | Get users
# **LoginPost**
> V1Token LoginPost(ctx, credentials)
Login
Logs a user in. Returns a JWT-Token to authenticate further requests.
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**credentials** | [**ModelsUserLogin**](ModelsUserLogin.md)| The login credentials |
### Return type
[**V1Token**](v1.Token.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **RegisterPost**
> ModelsUser RegisterPost(ctx, credentials)
Register
Creates a new user account.
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**credentials** | [**ModelsApiUserPassword**](ModelsApiUserPassword.md)| The user credentials |
### Return type
[**ModelsUser**](models.User.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **UserConfirmPost**
> ModelsMessage UserConfirmPost(ctx, credentials)
Confirm the email of a new user
Confirms the email of a newly registered user.
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**credentials** | [**ModelsEmailConfirm**](ModelsEmailConfirm.md)| The token. |
### Return type
[**ModelsMessage**](models.Message.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **UserGet**
> ModelsUser UserGet(ctx, )
Get user information
Returns the current user object.
### Required Parameters
This endpoint does not need any parameter.
### Return type
[**ModelsUser**](models.User.md)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **UserPasswordPost**
> ModelsMessage UserPasswordPost(ctx, userPassword)
Change password
Lets the current user change its password.
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**userPassword** | [**V1UserPassword**](V1UserPassword.md)| The current and new password. |
### Return type
[**ModelsMessage**](models.Message.md)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **UserPasswordResetPost**
> ModelsMessage UserPasswordResetPost(ctx, credentials)
Resets a password
Resets a user email with a previously reset token.
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**credentials** | [**ModelsPasswordReset**](ModelsPasswordReset.md)| The token with the new password. |
### Return type
[**ModelsMessage**](models.Message.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **UserPasswordTokenPost**
> ModelsMessage UserPasswordTokenPost(ctx, credentials)
Request password reset token
Requests a token to reset a users password. The token is sent via email.
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**credentials** | [**ModelsPasswordTokenRequest**](ModelsPasswordTokenRequest.md)| The username of the user to request a token for. |
### Return type
[**ModelsMessage**](models.Message.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **UsersGet**
> []ModelsUser UsersGet(ctx, optional)
Get users
Lists all users (without emailadresses). Also possible to search for a specific user.
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for logging, tracing, authentication, etc.
**optional** | **map[string]interface{}** | optional parameters | nil if no parameters
### Optional Parameters
Optional parameters are passed through a map[string]interface{}.
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**s** | **string**| Search for a user by its name. |
### Return type
[**[]ModelsUser**](models.User.md)
### Authorization
[JWTKeyAuth](../README.md#JWTKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

10
docs/V1Token.md Normal file
View File

@ -0,0 +1,10 @@
# V1Token
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Token** | **string** | | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

11
docs/V1UserPassword.md Normal file
View File

@ -0,0 +1,11 @@
# V1UserPassword
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**NewPassword** | **string** | | [optional] [default to null]
**OldPassword** | **string** | | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

14
docs/V1VikunjaInfos.md Normal file
View File

@ -0,0 +1,14 @@
# V1VikunjaInfos
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**FrontendUrl** | **string** | | [optional] [default to null]
**LinkSharingEnabled** | **bool** | | [optional] [default to null]
**MaxFileSize** | **int32** | | [optional] [default to null]
**Motd** | **string** | | [optional] [default to null]
**Version** | **string** | | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

24
files_file.go Normal file
View File

@ -0,0 +1,24 @@
/*
* Vikunja API
*
* This is the documentation for the [Vikunja](http://vikunja.io) API. Vikunja is a cross-plattform Todo-application with a lot of features, such as sharing lists with users or teams. <!-- ReDoc-Inject: <security-definitions> --> # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer <jwt-token>`-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. <!-- ReDoc-Inject: <security-definitions> -->
*
* API version: 0.8+21-854fde1e4c
* Contact: hello@vikunja.io
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package swagger
type FilesFile struct {
Created string `json:"created,omitempty"`
Id int32 `json:"id,omitempty"`
Mime string `json:"mime,omitempty"`
Name string `json:"name,omitempty"`
Size int32 `json:"size,omitempty"`
}

52
git_push.sh Normal file
View File

@ -0,0 +1,52 @@
#!/bin/sh
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
#
# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update"
git_user_id=$1
git_repo_id=$2
release_note=$3
if [ "$git_user_id" = "" ]; then
git_user_id="GIT_USER_ID"
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
fi
if [ "$git_repo_id" = "" ]; then
git_repo_id="GIT_REPO_ID"
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
fi
if [ "$release_note" = "" ]; then
release_note="Minor update"
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
fi
# Initialize the local directory as a Git repository
git init
# Adds the files in the local repository and stages them for commit.
git add .
# Commits the tracked changes and prepares them to be pushed to a remote repository.
git commit -m "$release_note"
# Sets the new remote
git_remote=`git remote`
if [ "$git_remote" = "" ]; then # git remote not defined
if [ "$GIT_TOKEN" = "" ]; then
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
else
git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
fi
fi
git pull origin master
# Pushes (Forces) the changes in the local repository up to the remote repository
echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
git push origin master 2>&1 | grep -v 'To https'

763
labels_api.go Normal file
View File

@ -0,0 +1,763 @@
/*
* Vikunja API
*
* This is the documentation for the [Vikunja](http://vikunja.io) API. Vikunja is a cross-plattform Todo-application with a lot of features, such as sharing lists with users or teams. <!-- ReDoc-Inject: <security-definitions> --> # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer <jwt-token>`-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. <!-- ReDoc-Inject: <security-definitions> -->
*
* API version: 0.8+21-854fde1e4c
* Contact: hello@vikunja.io
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package swagger
import (
"io/ioutil"
"net/url"
"net/http"
"strings"
"golang.org/x/net/context"
"encoding/json"
"fmt"
)
// Linger please
var (
_ context.Context
)
type LabelsApiService service
/* LabelsApiService Get all labels a user has access to
Returns all labels which are either created by the user or associated with a task the user has at least read-access to.
* @param ctx context.Context for authentication, logging, tracing, etc.
@param optional (nil or map[string]interface{}) with one or more of:
@param "p" (int32) The page number. Used for pagination. If not provided, the first page of results is returned.
@param "s" (string) Search labels by label text.
@return []ModelsLabel*/
func (a *LabelsApiService) LabelsGet(ctx context.Context, localVarOptionals map[string]interface{}) ([]ModelsLabel, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload []ModelsLabel
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/labels"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["p"], "int32", "p"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["s"], "string", "s"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["p"].(int32); localVarOk {
localVarQueryParams.Add("p", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["s"].(string); localVarOk {
localVarQueryParams.Add("s", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["Authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* LabelsApiService Delete a label
Delete an existing label. The user needs to be the creator of the label to be able to do this.
* @param ctx context.Context for authentication, logging, tracing, etc.
@param id Label ID
@return ModelsLabel*/
func (a *LabelsApiService) LabelsIdDelete(ctx context.Context, id int32) (ModelsLabel, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Delete")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload ModelsLabel
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/labels/{id}"
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["Authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* LabelsApiService Gets one label
Returns one label by its ID.
* @param ctx context.Context for authentication, logging, tracing, etc.
@param id Label ID
@return ModelsLabel*/
func (a *LabelsApiService) LabelsIdGet(ctx context.Context, id int32) (ModelsLabel, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload ModelsLabel
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/labels/{id}"
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["Authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* LabelsApiService Update a label
Update an existing label. The user needs to be the creator of the label to be able to do this.
* @param ctx context.Context for authentication, logging, tracing, etc.
@param id Label ID
@param label The label object
@return ModelsLabel*/
func (a *LabelsApiService) LabelsIdPut(ctx context.Context, id int32, label ModelsLabel) (ModelsLabel, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Put")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload ModelsLabel
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/labels/{id}"
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &label
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["Authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* LabelsApiService Create a label
Creates a new label.
* @param ctx context.Context for authentication, logging, tracing, etc.
@param label The label object
@return ModelsLabel*/
func (a *LabelsApiService) LabelsPut(ctx context.Context, label ModelsLabel) (ModelsLabel, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Put")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload ModelsLabel
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/labels"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &label
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["Authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* LabelsApiService Update all labels on a task.
Updates all labels on a task. Every label which is not passed but exists on the task will be deleted. Every label which does not exist on the task will be added. All labels which are passed and already exist on the task won&#39;t be touched.
* @param ctx context.Context for authentication, logging, tracing, etc.
@param label The array of labels
@param taskID Task ID
@return ModelsLabelTaskBulk*/
func (a *LabelsApiService) TasksTaskIDLabelsBulkPost(ctx context.Context, label ModelsLabelTaskBulk, taskID int32) (ModelsLabelTaskBulk, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Post")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload ModelsLabelTaskBulk
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/tasks/{taskID}/labels/bulk"
localVarPath = strings.Replace(localVarPath, "{"+"taskID"+"}", fmt.Sprintf("%v", taskID), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &label
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["Authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* LabelsApiService Get all labels on a task
Returns all labels which are assicociated with a given task.
* @param ctx context.Context for authentication, logging, tracing, etc.
@param task Task ID
@param optional (nil or map[string]interface{}) with one or more of:
@param "p" (int32) The page number. Used for pagination. If not provided, the first page of results is returned.
@param "s" (string) Search labels by label text.
@return []ModelsLabel*/
func (a *LabelsApiService) TasksTaskLabelsGet(ctx context.Context, task int32, localVarOptionals map[string]interface{}) ([]ModelsLabel, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload []ModelsLabel
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/tasks/{task}/labels"
localVarPath = strings.Replace(localVarPath, "{"+"task"+"}", fmt.Sprintf("%v", task), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["p"], "int32", "p"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["s"], "string", "s"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["p"].(int32); localVarOk {
localVarQueryParams.Add("p", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["s"].(string); localVarOk {
localVarQueryParams.Add("s", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["Authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* LabelsApiService Remove a label from a task
Remove a label from a task. The user needs to have write-access to the list to be able do this.
* @param ctx context.Context for authentication, logging, tracing, etc.
@param task Task ID
@param label Label ID
@return ModelsMessage*/
func (a *LabelsApiService) TasksTaskLabelsLabelDelete(ctx context.Context, task int32, label int32) (ModelsMessage, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Delete")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload ModelsMessage
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/tasks/{task}/labels/{label}"
localVarPath = strings.Replace(localVarPath, "{"+"task"+"}", fmt.Sprintf("%v", task), -1)
localVarPath = strings.Replace(localVarPath, "{"+"label"+"}", fmt.Sprintf("%v", label), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["Authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* LabelsApiService Add a label to a task
Add a label to a task. The user needs to have write-access to the list to be able do this.
* @param ctx context.Context for authentication, logging, tracing, etc.
@param task Task ID
@param label The label object
@return ModelsLabelTask*/
func (a *LabelsApiService) TasksTaskLabelsPut(ctx context.Context, task int32, label ModelsLabelTask) (ModelsLabelTask, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Put")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload ModelsLabelTask
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/tasks/{task}/labels"
localVarPath = strings.Replace(localVarPath, "{"+"task"+"}", fmt.Sprintf("%v", task), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &label
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["Authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}

519
list_api.go Normal file
View File

@ -0,0 +1,519 @@
/*
* Vikunja API
*
* This is the documentation for the [Vikunja](http://vikunja.io) API. Vikunja is a cross-plattform Todo-application with a lot of features, such as sharing lists with users or teams. <!-- ReDoc-Inject: <security-definitions> --> # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer <jwt-token>`-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. <!-- ReDoc-Inject: <security-definitions> -->
*
* API version: 0.8+21-854fde1e4c
* Contact: hello@vikunja.io
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package swagger
import (
"io/ioutil"
"net/url"
"net/http"
"strings"
"golang.org/x/net/context"
"encoding/json"
"fmt"
)
// Linger please
var (
_ context.Context
)
type ListApiService service
/* ListApiService Get all lists a user has access to
Returns all lists a user has access to.
* @param ctx context.Context for authentication, logging, tracing, etc.
@param optional (nil or map[string]interface{}) with one or more of:
@param "p" (int32) The page number. Used for pagination. If not provided, the first page of results is returned.
@param "s" (string) Search lists by title.
@return []ModelsList*/
func (a *ListApiService) ListsGet(ctx context.Context, localVarOptionals map[string]interface{}) ([]ModelsList, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload []ModelsList
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/lists"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["p"], "int32", "p"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["s"], "string", "s"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["p"].(int32); localVarOk {
localVarQueryParams.Add("p", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["s"].(string); localVarOk {
localVarQueryParams.Add("s", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["Authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* ListApiService Deletes a list
Delets a list
* @param ctx context.Context for authentication, logging, tracing, etc.
@param id List ID
@return ModelsMessage*/
func (a *ListApiService) ListsIdDelete(ctx context.Context, id int32) (ModelsMessage, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Delete")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload ModelsMessage
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/lists/{id}"
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["Authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* ListApiService Gets one list
Returns a list by its ID.
* @param ctx context.Context for authentication, logging, tracing, etc.
@param id List ID
@return ModelsList*/
func (a *ListApiService) ListsIdGet(ctx context.Context, id int32) (ModelsList, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload ModelsList
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/lists/{id}"
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["Authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* ListApiService Get users
Lists all users (without emailadresses). Also possible to search for a specific user.
* @param ctx context.Context for authentication, logging, tracing, etc.
@param id List ID
@param optional (nil or map[string]interface{}) with one or more of:
@param "s" (string) Search for a user by its name.
@return []ModelsUser*/
func (a *ListApiService) ListsIdListusersGet(ctx context.Context, id int32, localVarOptionals map[string]interface{}) ([]ModelsUser, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload []ModelsUser
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/lists/{id}/listusers"
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["s"], "string", "s"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["s"].(string); localVarOk {
localVarQueryParams.Add("s", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["Authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* ListApiService Updates a list
Updates a list. This does not include adding a task (see below).
* @param ctx context.Context for authentication, logging, tracing, etc.
@param id List ID
@param list The list with updated values you want to update.
@return ModelsList*/
func (a *ListApiService) ListsIdPost(ctx context.Context, id int32, list ModelsList) (ModelsList, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Post")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload ModelsList
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/lists/{id}"
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &list
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["Authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* ListApiService Creates a new list
Creates a new list in a given namespace. The user needs write-access to the namespace.
* @param ctx context.Context for authentication, logging, tracing, etc.
@param namespaceID Namespace ID
@param list The list you want to create.
@return ModelsList*/
func (a *ListApiService) NamespacesNamespaceIDListsPut(ctx context.Context, namespaceID int32, list ModelsList) (ModelsList, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Put")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload ModelsList
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/namespaces/{namespaceID}/lists"
localVarPath = strings.Replace(localVarPath, "{"+"namespaceID"+"}", fmt.Sprintf("%v", namespaceID), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &list
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["Authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}

View File

@ -0,0 +1,26 @@
/*
* Vikunja API
*
* This is the documentation for the [Vikunja](http://vikunja.io) API. Vikunja is a cross-plattform Todo-application with a lot of features, such as sharing lists with users or teams. <!-- ReDoc-Inject: <security-definitions> --> # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer <jwt-token>`-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. <!-- ReDoc-Inject: <security-definitions> -->
*
* API version: 0.8+21-854fde1e4c
* Contact: hello@vikunja.io
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package swagger
type ModelsApiUserPassword struct {
// The user's email address
Email string `json:"email,omitempty"`
// The unique, numeric id of this user.
Id int32 `json:"id,omitempty"`
// The user's password in clear text. Only used when registering the user.
Password string `json:"password,omitempty"`
// The username of the username. Is always unique.
Username string `json:"username,omitempty"`
}

17
models_bulk_assignees.go Normal file
View File

@ -0,0 +1,17 @@
/*
* Vikunja API
*
* This is the documentation for the [Vikunja](http://vikunja.io) API. Vikunja is a cross-plattform Todo-application with a lot of features, such as sharing lists with users or teams. <!-- ReDoc-Inject: <security-definitions> --> # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer <jwt-token>`-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. <!-- ReDoc-Inject: <security-definitions> -->
*
* API version: 0.8+21-854fde1e4c
* Contact: hello@vikunja.io
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package swagger
type ModelsBulkAssignees struct {
// A list with all assignees
Assignees []ModelsUser `json:"assignees,omitempty"`
}

80
models_bulk_task.go Normal file
View File

@ -0,0 +1,80 @@
/*
* Vikunja API
*
* This is the documentation for the [Vikunja](http://vikunja.io) API. Vikunja is a cross-plattform Todo-application with a lot of features, such as sharing lists with users or teams. <!-- ReDoc-Inject: <security-definitions> --> # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer <jwt-token>`-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. <!-- ReDoc-Inject: <security-definitions> -->
*
* API version: 0.8+21-854fde1e4c
* Contact: hello@vikunja.io
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package swagger
type ModelsBulkTask struct {
// An array of users who are assigned to this task
Assignees []ModelsUser `json:"assignees,omitempty"`
// All attachments this task has
Attachments []ModelsTaskAttachment `json:"attachments,omitempty"`
// A unix timestamp when this task was created. You cannot change this value.
Created int32 `json:"created,omitempty"`
// The user who initially created the task.
CreatedBy *ModelsUser `json:"createdBy,omitempty"`
// The task description.
Description string `json:"description,omitempty"`
// Whether a task is done or not.
Done bool `json:"done,omitempty"`
// The unix timestamp when a task was marked as done.
DoneAt int32 `json:"doneAt,omitempty"`
// A unix timestamp when the task is due.
DueDate int32 `json:"dueDate,omitempty"`
// When this task ends.
EndDate int32 `json:"endDate,omitempty"`
// The task color in hex
HexColor string `json:"hexColor,omitempty"`
// The unique, numeric id of this task.
Id int32 `json:"id,omitempty"`
// An array of labels which are associated with this task.
Labels []ModelsLabel `json:"labels,omitempty"`
// The list this task belongs to.
ListID int32 `json:"listID,omitempty"`
// Determines how far a task is left from being done
PercentDone float32 `json:"percentDone,omitempty"`
// The task priority. Can be anything you want, it is possible to sort by this later.
Priority int32 `json:"priority,omitempty"`
// All related tasks, grouped by their relation kind
RelatedTasks *ModelsRelatedTaskMap `json:"related_tasks,omitempty"`
// An array of unix timestamps when the user wants to be reminded of the task.
ReminderDates []int32 `json:"reminderDates,omitempty"`
// An amount in seconds this task repeats itself. If this is set, when marking the task as done, it will mark itself as \"undone\" and then increase all remindes and the due date by its amount.
RepeatAfter int32 `json:"repeatAfter,omitempty"`
// When this task starts.
StartDate int32 `json:"startDate,omitempty"`
// A list of task ids to update
TaskIds []int32 `json:"task_ids,omitempty"`
// The task text. This is what you'll see in the list.
Text string `json:"text,omitempty"`
// A unix timestamp when this task was last updated. You cannot change this value.
Updated int32 `json:"updated,omitempty"`
}

17
models_email_confirm.go Normal file
View File

@ -0,0 +1,17 @@
/*
* Vikunja API
*
* This is the documentation for the [Vikunja](http://vikunja.io) API. Vikunja is a cross-plattform Todo-application with a lot of features, such as sharing lists with users or teams. <!-- ReDoc-Inject: <security-definitions> --> # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer <jwt-token>`-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. <!-- ReDoc-Inject: <security-definitions> -->
*
* API version: 0.8+21-854fde1e4c
* Contact: hello@vikunja.io
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package swagger
type ModelsEmailConfirm struct {
// The email confirm token sent via email.
Token string `json:"token,omitempty"`
}

35
models_label.go Normal file
View File

@ -0,0 +1,35 @@
/*
* Vikunja API
*
* This is the documentation for the [Vikunja](http://vikunja.io) API. Vikunja is a cross-plattform Todo-application with a lot of features, such as sharing lists with users or teams. <!-- ReDoc-Inject: <security-definitions> --> # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer <jwt-token>`-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. <!-- ReDoc-Inject: <security-definitions> -->
*
* API version: 0.8+21-854fde1e4c
* Contact: hello@vikunja.io
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package swagger
type ModelsLabel struct {
// A unix timestamp when this label was created. You cannot change this value.
Created int32 `json:"created,omitempty"`
// The user who created this label
CreatedBy *ModelsUser `json:"created_by,omitempty"`
// The label description.
Description string `json:"description,omitempty"`
// The color this label has
HexColor string `json:"hex_color,omitempty"`
// The unique, numeric id of this label.
Id int32 `json:"id,omitempty"`
// The title of the lable. You'll see this one on tasks associated with it.
Title string `json:"title,omitempty"`
// A unix timestamp when this label was last updated. You cannot change this value.
Updated int32 `json:"updated,omitempty"`
}

20
models_label_task.go Normal file
View File

@ -0,0 +1,20 @@
/*
* Vikunja API
*
* This is the documentation for the [Vikunja](http://vikunja.io) API. Vikunja is a cross-plattform Todo-application with a lot of features, such as sharing lists with users or teams. <!-- ReDoc-Inject: <security-definitions> --> # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer <jwt-token>`-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. <!-- ReDoc-Inject: <security-definitions> -->
*
* API version: 0.8+21-854fde1e4c
* Contact: hello@vikunja.io
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package swagger
type ModelsLabelTask struct {
// A unix timestamp when this task was created. You cannot change this value.
Created int32 `json:"created,omitempty"`
// The label id you want to associate with a task.
LabelId int32 `json:"label_id,omitempty"`
}

17
models_label_task_bulk.go Normal file
View File

@ -0,0 +1,17 @@
/*
* Vikunja API
*
* This is the documentation for the [Vikunja](http://vikunja.io) API. Vikunja is a cross-plattform Todo-application with a lot of features, such as sharing lists with users or teams. <!-- ReDoc-Inject: <security-definitions> --> # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer <jwt-token>`-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. <!-- ReDoc-Inject: <security-definitions> -->
*
* API version: 0.8+21-854fde1e4c
* Contact: hello@vikunja.io
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package swagger
type ModelsLabelTaskBulk struct {
// All labels you want to update at once.
Labels []ModelsLabel `json:"labels,omitempty"`
}

35
models_link_sharing.go Normal file
View File

@ -0,0 +1,35 @@
/*
* Vikunja API
*
* This is the documentation for the [Vikunja](http://vikunja.io) API. Vikunja is a cross-plattform Todo-application with a lot of features, such as sharing lists with users or teams. <!-- ReDoc-Inject: <security-definitions> --> # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer <jwt-token>`-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. <!-- ReDoc-Inject: <security-definitions> -->
*
* API version: 0.8+21-854fde1e4c
* Contact: hello@vikunja.io
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package swagger
type ModelsLinkSharing struct {
// A unix timestamp when this list was shared. You cannot change this value.
Created int32 `json:"created,omitempty"`
// The public id to get this shared list
Hash string `json:"hash,omitempty"`
// The ID of the shared thing
Id int32 `json:"id,omitempty"`
// The right this list is shared with. 0 = Read only, 1 = Read & Write, 2 = Admin. See the docs for more details.
Right int32 `json:"right,omitempty"`
// The user who shared this list
SharedBy *ModelsUser `json:"shared_by,omitempty"`
// The kind of this link. 0 = undefined, 1 = without password, 2 = with password (currently not implemented).
SharingType int32 `json:"sharing_type,omitempty"`
// A unix timestamp when this share was last updated. You cannot change this value.
Updated int32 `json:"updated,omitempty"`
}

35
models_list.go Normal file
View File

@ -0,0 +1,35 @@
/*
* Vikunja API
*
* This is the documentation for the [Vikunja](http://vikunja.io) API. Vikunja is a cross-plattform Todo-application with a lot of features, such as sharing lists with users or teams. <!-- ReDoc-Inject: <security-definitions> --> # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer <jwt-token>`-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. <!-- ReDoc-Inject: <security-definitions> -->
*
* API version: 0.8+21-854fde1e4c
* Contact: hello@vikunja.io
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package swagger
type ModelsList struct {
// A unix timestamp when this list was created. You cannot change this value.
Created int32 `json:"created,omitempty"`
// The description of the list.
Description string `json:"description,omitempty"`
// The unique, numeric id of this list.
Id int32 `json:"id,omitempty"`
// The user who created this list.
Owner *ModelsUser `json:"owner,omitempty"`
// An array of tasks which belong to the list.
Tasks []ModelsTask `json:"tasks,omitempty"`
// The title of the list. You'll see this in the namespace overview.
Title string `json:"title,omitempty"`
// A unix timestamp when this list was last updated. You cannot change this value.
Updated int32 `json:"updated,omitempty"`
}

29
models_list_user.go Normal file
View File

@ -0,0 +1,29 @@
/*
* Vikunja API
*
* This is the documentation for the [Vikunja](http://vikunja.io) API. Vikunja is a cross-plattform Todo-application with a lot of features, such as sharing lists with users or teams. <!-- ReDoc-Inject: <security-definitions> --> # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer <jwt-token>`-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. <!-- ReDoc-Inject: <security-definitions> -->
*
* API version: 0.8+21-854fde1e4c
* Contact: hello@vikunja.io
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package swagger
type ModelsListUser struct {
// A unix timestamp when this relation was created. You cannot change this value.
Created int32 `json:"created,omitempty"`
// The unique, numeric id of this list <-> user relation.
Id int32 `json:"id,omitempty"`
// The right this user has. 0 = Read only, 1 = Read & Write, 2 = Admin. See the docs for more details.
Right int32 `json:"right,omitempty"`
// A unix timestamp when this relation was last updated. You cannot change this value.
Updated int32 `json:"updated,omitempty"`
// The username.
UserID string `json:"userID,omitempty"`
}

17
models_message.go Normal file
View File

@ -0,0 +1,17 @@
/*
* Vikunja API
*
* This is the documentation for the [Vikunja](http://vikunja.io) API. Vikunja is a cross-plattform Todo-application with a lot of features, such as sharing lists with users or teams. <!-- ReDoc-Inject: <security-definitions> --> # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer <jwt-token>`-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. <!-- ReDoc-Inject: <security-definitions> -->
*
* API version: 0.8+21-854fde1e4c
* Contact: hello@vikunja.io
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package swagger
type ModelsMessage struct {
// A standard message.
Message string `json:"message,omitempty"`
}

32
models_namespace.go Normal file
View File

@ -0,0 +1,32 @@
/*
* Vikunja API
*
* This is the documentation for the [Vikunja](http://vikunja.io) API. Vikunja is a cross-plattform Todo-application with a lot of features, such as sharing lists with users or teams. <!-- ReDoc-Inject: <security-definitions> --> # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer <jwt-token>`-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. <!-- ReDoc-Inject: <security-definitions> -->
*
* API version: 0.8+21-854fde1e4c
* Contact: hello@vikunja.io
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package swagger
type ModelsNamespace struct {
// A unix timestamp when this namespace was created. You cannot change this value.
Created int32 `json:"created,omitempty"`
// The description of the namespace
Description string `json:"description,omitempty"`
// The unique, numeric id of this namespace.
Id int32 `json:"id,omitempty"`
// The name of this namespace.
Name string `json:"name,omitempty"`
// The user who owns this namespace
Owner *ModelsUser `json:"owner,omitempty"`
// A unix timestamp when this namespace was last updated. You cannot change this value.
Updated int32 `json:"updated,omitempty"`
}

29
models_namespace_user.go Normal file
View File

@ -0,0 +1,29 @@
/*
* Vikunja API
*
* This is the documentation for the [Vikunja](http://vikunja.io) API. Vikunja is a cross-plattform Todo-application with a lot of features, such as sharing lists with users or teams. <!-- ReDoc-Inject: <security-definitions> --> # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer <jwt-token>`-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. <!-- ReDoc-Inject: <security-definitions> -->
*
* API version: 0.8+21-854fde1e4c
* Contact: hello@vikunja.io
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package swagger
type ModelsNamespaceUser struct {
// A unix timestamp when this relation was created. You cannot change this value.
Created int32 `json:"created,omitempty"`
// The unique, numeric id of this namespace <-> user relation.
Id int32 `json:"id,omitempty"`
// The right this user has. 0 = Read only, 1 = Read & Write, 2 = Admin. See the docs for more details.
Right int32 `json:"right,omitempty"`
// A unix timestamp when this relation was last updated. You cannot change this value.
Updated int32 `json:"updated,omitempty"`
// The username.
UserID string `json:"userID,omitempty"`
}

View File

@ -0,0 +1,34 @@
/*
* Vikunja API
*
* This is the documentation for the [Vikunja](http://vikunja.io) API. Vikunja is a cross-plattform Todo-application with a lot of features, such as sharing lists with users or teams. <!-- ReDoc-Inject: <security-definitions> --> # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer <jwt-token>`-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. <!-- ReDoc-Inject: <security-definitions> -->
*
* API version: 0.8+21-854fde1e4c
* Contact: hello@vikunja.io
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package swagger
type ModelsNamespaceWithLists struct {
// A unix timestamp when this namespace was created. You cannot change this value.
Created int32 `json:"created,omitempty"`
// The description of the namespace
Description string `json:"description,omitempty"`
// The unique, numeric id of this namespace.
Id int32 `json:"id,omitempty"`
Lists []ModelsList `json:"lists,omitempty"`
// The name of this namespace.
Name string `json:"name,omitempty"`
// The user who owns this namespace
Owner *ModelsUser `json:"owner,omitempty"`
// A unix timestamp when this namespace was last updated. You cannot change this value.
Updated int32 `json:"updated,omitempty"`
}

20
models_password_reset.go Normal file
View File

@ -0,0 +1,20 @@
/*
* Vikunja API
*
* This is the documentation for the [Vikunja](http://vikunja.io) API. Vikunja is a cross-plattform Todo-application with a lot of features, such as sharing lists with users or teams. <!-- ReDoc-Inject: <security-definitions> --> # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer <jwt-token>`-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. <!-- ReDoc-Inject: <security-definitions> -->
*
* API version: 0.8+21-854fde1e4c
* Contact: hello@vikunja.io
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package swagger
type ModelsPasswordReset struct {
// The new password for this user.
NewPassword string `json:"new_password,omitempty"`
// The previously issued reset token.
Token string `json:"token,omitempty"`
}

View File

@ -0,0 +1,16 @@
/*
* Vikunja API
*
* This is the documentation for the [Vikunja](http://vikunja.io) API. Vikunja is a cross-plattform Todo-application with a lot of features, such as sharing lists with users or teams. <!-- ReDoc-Inject: <security-definitions> --> # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer <jwt-token>`-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. <!-- ReDoc-Inject: <security-definitions> -->
*
* API version: 0.8+21-854fde1e4c
* Contact: hello@vikunja.io
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package swagger
type ModelsPasswordTokenRequest struct {
Email string `json:"email,omitempty"`
}

View File

@ -0,0 +1,14 @@
/*
* Vikunja API
*
* This is the documentation for the [Vikunja](http://vikunja.io) API. Vikunja is a cross-plattform Todo-application with a lot of features, such as sharing lists with users or teams. <!-- ReDoc-Inject: <security-definitions> --> # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer <jwt-token>`-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. <!-- ReDoc-Inject: <security-definitions> -->
*
* API version: 0.8+21-854fde1e4c
* Contact: hello@vikunja.io
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package swagger
type ModelsRelatedTaskMap struct {
}

77
models_task.go Normal file
View File

@ -0,0 +1,77 @@
/*
* Vikunja API
*
* This is the documentation for the [Vikunja](http://vikunja.io) API. Vikunja is a cross-plattform Todo-application with a lot of features, such as sharing lists with users or teams. <!-- ReDoc-Inject: <security-definitions> --> # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer <jwt-token>`-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. <!-- ReDoc-Inject: <security-definitions> -->
*
* API version: 0.8+21-854fde1e4c
* Contact: hello@vikunja.io
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package swagger
type ModelsTask struct {
// An array of users who are assigned to this task
Assignees []ModelsUser `json:"assignees,omitempty"`
// All attachments this task has
Attachments []ModelsTaskAttachment `json:"attachments,omitempty"`
// A unix timestamp when this task was created. You cannot change this value.
Created int32 `json:"created,omitempty"`
// The user who initially created the task.
CreatedBy *ModelsUser `json:"createdBy,omitempty"`
// The task description.
Description string `json:"description,omitempty"`
// Whether a task is done or not.
Done bool `json:"done,omitempty"`
// The unix timestamp when a task was marked as done.
DoneAt int32 `json:"doneAt,omitempty"`
// A unix timestamp when the task is due.
DueDate int32 `json:"dueDate,omitempty"`
// When this task ends.
EndDate int32 `json:"endDate,omitempty"`
// The task color in hex
HexColor string `json:"hexColor,omitempty"`
// The unique, numeric id of this task.
Id int32 `json:"id,omitempty"`
// An array of labels which are associated with this task.
Labels []ModelsLabel `json:"labels,omitempty"`
// The list this task belongs to.
ListID int32 `json:"listID,omitempty"`
// Determines how far a task is left from being done
PercentDone float32 `json:"percentDone,omitempty"`
// The task priority. Can be anything you want, it is possible to sort by this later.
Priority int32 `json:"priority,omitempty"`
// All related tasks, grouped by their relation kind
RelatedTasks *ModelsRelatedTaskMap `json:"related_tasks,omitempty"`
// An array of unix timestamps when the user wants to be reminded of the task.
ReminderDates []int32 `json:"reminderDates,omitempty"`
// An amount in seconds this task repeats itself. If this is set, when marking the task as done, it will mark itself as \"undone\" and then increase all remindes and the due date by its amount.
RepeatAfter int32 `json:"repeatAfter,omitempty"`
// When this task starts.
StartDate int32 `json:"startDate,omitempty"`
// The task text. This is what you'll see in the list.
Text string `json:"text,omitempty"`
// A unix timestamp when this task was last updated. You cannot change this value.
Updated int32 `json:"updated,omitempty"`
}

18
models_task_assginee.go Normal file
View File

@ -0,0 +1,18 @@
/*
* Vikunja API
*
* This is the documentation for the [Vikunja](http://vikunja.io) API. Vikunja is a cross-plattform Todo-application with a lot of features, such as sharing lists with users or teams. <!-- ReDoc-Inject: <security-definitions> --> # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer <jwt-token>`-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. <!-- ReDoc-Inject: <security-definitions> -->
*
* API version: 0.8+21-854fde1e4c
* Contact: hello@vikunja.io
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package swagger
type ModelsTaskAssginee struct {
Created int32 `json:"created,omitempty"`
UserId int32 `json:"user_id,omitempty"`
}

24
models_task_attachment.go Normal file
View File

@ -0,0 +1,24 @@
/*
* Vikunja API
*
* This is the documentation for the [Vikunja](http://vikunja.io) API. Vikunja is a cross-plattform Todo-application with a lot of features, such as sharing lists with users or teams. <!-- ReDoc-Inject: <security-definitions> --> # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer <jwt-token>`-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. <!-- ReDoc-Inject: <security-definitions> -->
*
* API version: 0.8+21-854fde1e4c
* Contact: hello@vikunja.io
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package swagger
type ModelsTaskAttachment struct {
Created int32 `json:"created,omitempty"`
CreatedBy *ModelsUser `json:"created_by,omitempty"`
File *FilesFile `json:"file,omitempty"`
Id int32 `json:"id,omitempty"`
TaskId int32 `json:"task_id,omitempty"`
}

29
models_task_relation.go Normal file
View File

@ -0,0 +1,29 @@
/*
* Vikunja API
*
* This is the documentation for the [Vikunja](http://vikunja.io) API. Vikunja is a cross-plattform Todo-application with a lot of features, such as sharing lists with users or teams. <!-- ReDoc-Inject: <security-definitions> --> # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer <jwt-token>`-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. <!-- ReDoc-Inject: <security-definitions> -->
*
* API version: 0.8+21-854fde1e4c
* Contact: hello@vikunja.io
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package swagger
type ModelsTaskRelation struct {
// A unix timestamp when this label was created. You cannot change this value.
Created int32 `json:"created,omitempty"`
// The user who created this relation
CreatedBy *ModelsUser `json:"created_by,omitempty"`
// The ID of the other task, the task which is being related.
OtherTaskId int32 `json:"other_task_id,omitempty"`
// The kind of the relation.
RelationKind string `json:"relation_kind,omitempty"`
// The ID of the \"base\" task, the task which has a relation to another.
TaskId int32 `json:"task_id,omitempty"`
}

35
models_team.go Normal file
View File

@ -0,0 +1,35 @@
/*
* Vikunja API
*
* This is the documentation for the [Vikunja](http://vikunja.io) API. Vikunja is a cross-plattform Todo-application with a lot of features, such as sharing lists with users or teams. <!-- ReDoc-Inject: <security-definitions> --> # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer <jwt-token>`-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. <!-- ReDoc-Inject: <security-definitions> -->
*
* API version: 0.8+21-854fde1e4c
* Contact: hello@vikunja.io
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package swagger
type ModelsTeam struct {
// A unix timestamp when this relation was created. You cannot change this value.
Created int32 `json:"created,omitempty"`
// The user who created this team.
CreatedBy *ModelsUser `json:"createdBy,omitempty"`
// The team's description.
Description string `json:"description,omitempty"`
// The unique, numeric id of this team.
Id int32 `json:"id,omitempty"`
// An array of all members in this team.
Members []ModelsTeamUser `json:"members,omitempty"`
// The name of this team.
Name string `json:"name,omitempty"`
// A unix timestamp when this relation was last updated. You cannot change this value.
Updated int32 `json:"updated,omitempty"`
}

29
models_team_list.go Normal file
View File

@ -0,0 +1,29 @@
/*
* Vikunja API
*
* This is the documentation for the [Vikunja](http://vikunja.io) API. Vikunja is a cross-plattform Todo-application with a lot of features, such as sharing lists with users or teams. <!-- ReDoc-Inject: <security-definitions> --> # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer <jwt-token>`-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. <!-- ReDoc-Inject: <security-definitions> -->
*
* API version: 0.8+21-854fde1e4c
* Contact: hello@vikunja.io
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package swagger
type ModelsTeamList struct {
// A unix timestamp when this relation was created. You cannot change this value.
Created int32 `json:"created,omitempty"`
// The unique, numeric id of this list <-> team relation.
Id int32 `json:"id,omitempty"`
// The right this team has. 0 = Read only, 1 = Read & Write, 2 = Admin. See the docs for more details.
Right int32 `json:"right,omitempty"`
// The team id.
TeamID int32 `json:"teamID,omitempty"`
// A unix timestamp when this relation was last updated. You cannot change this value.
Updated int32 `json:"updated,omitempty"`
}

26
models_team_member.go Normal file
View File

@ -0,0 +1,26 @@
/*
* Vikunja API
*
* This is the documentation for the [Vikunja](http://vikunja.io) API. Vikunja is a cross-plattform Todo-application with a lot of features, such as sharing lists with users or teams. <!-- ReDoc-Inject: <security-definitions> --> # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer <jwt-token>`-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. <!-- ReDoc-Inject: <security-definitions> -->
*
* API version: 0.8+21-854fde1e4c
* Contact: hello@vikunja.io
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package swagger
type ModelsTeamMember struct {
// Whether or not the member is an admin of the team. See the docs for more about what a team admin can do
Admin bool `json:"admin,omitempty"`
// A unix timestamp when this relation was created. You cannot change this value.
Created int32 `json:"created,omitempty"`
// The unique, numeric id of this team member relation.
Id int32 `json:"id,omitempty"`
// The username of the member. We use this to prevent automated user id entering.
Username string `json:"username,omitempty"`
}

29
models_team_namespace.go Normal file
View File

@ -0,0 +1,29 @@
/*
* Vikunja API
*
* This is the documentation for the [Vikunja](http://vikunja.io) API. Vikunja is a cross-plattform Todo-application with a lot of features, such as sharing lists with users or teams. <!-- ReDoc-Inject: <security-definitions> --> # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer <jwt-token>`-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. <!-- ReDoc-Inject: <security-definitions> -->
*
* API version: 0.8+21-854fde1e4c
* Contact: hello@vikunja.io
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package swagger
type ModelsTeamNamespace struct {
// A unix timestamp when this relation was created. You cannot change this value.
Created int32 `json:"created,omitempty"`
// The unique, numeric id of this namespace <-> team relation.
Id int32 `json:"id,omitempty"`
// The right this team has. 0 = Read only, 1 = Read & Write, 2 = Admin. See the docs for more details.
Right int32 `json:"right,omitempty"`
// The team id.
TeamID int32 `json:"teamID,omitempty"`
// A unix timestamp when this relation was last updated. You cannot change this value.
Updated int32 `json:"updated,omitempty"`
}

35
models_team_user.go Normal file
View File

@ -0,0 +1,35 @@
/*
* Vikunja API
*
* This is the documentation for the [Vikunja](http://vikunja.io) API. Vikunja is a cross-plattform Todo-application with a lot of features, such as sharing lists with users or teams. <!-- ReDoc-Inject: <security-definitions> --> # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer <jwt-token>`-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. <!-- ReDoc-Inject: <security-definitions> -->
*
* API version: 0.8+21-854fde1e4c
* Contact: hello@vikunja.io
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package swagger
type ModelsTeamUser struct {
// Whether or not the member is an admin of the team. See the docs for more about what a team admin can do
Admin bool `json:"admin,omitempty"`
// The users md5-hashed email address, used to get the avatar from gravatar and the likes.
AvatarUrl string `json:"avatarUrl,omitempty"`
// A unix timestamp when this task was created. You cannot change this value.
Created int32 `json:"created,omitempty"`
// The user's email address.
Email string `json:"email,omitempty"`
// The unique, numeric id of this user.
Id int32 `json:"id,omitempty"`
// A unix timestamp when this task was last updated. You cannot change this value.
Updated int32 `json:"updated,omitempty"`
// The username of the user. Is always unique.
Username string `json:"username,omitempty"`
}

37
models_team_with_right.go Normal file
View File

@ -0,0 +1,37 @@
/*
* Vikunja API
*
* This is the documentation for the [Vikunja](http://vikunja.io) API. Vikunja is a cross-plattform Todo-application with a lot of features, such as sharing lists with users or teams. <!-- ReDoc-Inject: <security-definitions> --> # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer <jwt-token>`-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. <!-- ReDoc-Inject: <security-definitions> -->
*
* API version: 0.8+21-854fde1e4c
* Contact: hello@vikunja.io
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package swagger
type ModelsTeamWithRight struct {
// A unix timestamp when this relation was created. You cannot change this value.
Created int32 `json:"created,omitempty"`
// The user who created this team.
CreatedBy *ModelsUser `json:"createdBy,omitempty"`
// The team's description.
Description string `json:"description,omitempty"`
// The unique, numeric id of this team.
Id int32 `json:"id,omitempty"`
// An array of all members in this team.
Members []ModelsTeamUser `json:"members,omitempty"`
// The name of this team.
Name string `json:"name,omitempty"`
Right int32 `json:"right,omitempty"`
// A unix timestamp when this relation was last updated. You cannot change this value.
Updated int32 `json:"updated,omitempty"`
}

32
models_user.go Normal file
View File

@ -0,0 +1,32 @@
/*
* Vikunja API
*
* This is the documentation for the [Vikunja](http://vikunja.io) API. Vikunja is a cross-plattform Todo-application with a lot of features, such as sharing lists with users or teams. <!-- ReDoc-Inject: <security-definitions> --> # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer <jwt-token>`-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. <!-- ReDoc-Inject: <security-definitions> -->
*
* API version: 0.8+21-854fde1e4c
* Contact: hello@vikunja.io
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package swagger
type ModelsUser struct {
// The users md5-hashed email address, used to get the avatar from gravatar and the likes.
AvatarUrl string `json:"avatarUrl,omitempty"`
// A unix timestamp when this task was created. You cannot change this value.
Created int32 `json:"created,omitempty"`
// The user's email address.
Email string `json:"email,omitempty"`
// The unique, numeric id of this user.
Id int32 `json:"id,omitempty"`
// A unix timestamp when this task was last updated. You cannot change this value.
Updated int32 `json:"updated,omitempty"`
// The username of the user. Is always unique.
Username string `json:"username,omitempty"`
}

20
models_user_login.go Normal file
View File

@ -0,0 +1,20 @@
/*
* Vikunja API
*
* This is the documentation for the [Vikunja](http://vikunja.io) API. Vikunja is a cross-plattform Todo-application with a lot of features, such as sharing lists with users or teams. <!-- ReDoc-Inject: <security-definitions> --> # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer <jwt-token>`-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. <!-- ReDoc-Inject: <security-definitions> -->
*
* API version: 0.8+21-854fde1e4c
* Contact: hello@vikunja.io
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package swagger
type ModelsUserLogin struct {
// The password for the user.
Password string `json:"password,omitempty"`
// The username used to log in.
Username string `json:"username,omitempty"`
}

34
models_user_with_right.go Normal file
View File

@ -0,0 +1,34 @@
/*
* Vikunja API
*
* This is the documentation for the [Vikunja](http://vikunja.io) API. Vikunja is a cross-plattform Todo-application with a lot of features, such as sharing lists with users or teams. <!-- ReDoc-Inject: <security-definitions> --> # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer <jwt-token>`-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. <!-- ReDoc-Inject: <security-definitions> -->
*
* API version: 0.8+21-854fde1e4c
* Contact: hello@vikunja.io
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package swagger
type ModelsUserWithRight struct {
// The users md5-hashed email address, used to get the avatar from gravatar and the likes.
AvatarUrl string `json:"avatarUrl,omitempty"`
// A unix timestamp when this task was created. You cannot change this value.
Created int32 `json:"created,omitempty"`
// The user's email address.
Email string `json:"email,omitempty"`
// The unique, numeric id of this user.
Id int32 `json:"id,omitempty"`
Right int32 `json:"right,omitempty"`
// A unix timestamp when this task was last updated. You cannot change this value.
Updated int32 `json:"updated,omitempty"`
// The username of the user. Is always unique.
Username string `json:"username,omitempty"`
}

509
namespace_api.go Normal file
View File

@ -0,0 +1,509 @@
/*
* Vikunja API
*
* This is the documentation for the [Vikunja](http://vikunja.io) API. Vikunja is a cross-plattform Todo-application with a lot of features, such as sharing lists with users or teams. <!-- ReDoc-Inject: <security-definitions> --> # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer <jwt-token>`-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. <!-- ReDoc-Inject: <security-definitions> -->
*
* API version: 0.8+21-854fde1e4c
* Contact: hello@vikunja.io
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package swagger
import (
"io/ioutil"
"net/url"
"net/http"
"strings"
"golang.org/x/net/context"
"encoding/json"
"fmt"
)
// Linger please
var (
_ context.Context
)
type NamespaceApiService service
/* NamespaceApiService Updates a namespace
Updates a namespace.
* @param ctx context.Context for authentication, logging, tracing, etc.
@param id Namespace ID
@param namespace The namespace with updated values you want to update.
@return ModelsNamespace*/
func (a *NamespaceApiService) NamespaceIdPost(ctx context.Context, id int32, namespace ModelsNamespace) (ModelsNamespace, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Post")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload ModelsNamespace
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/namespace/{id}"
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &namespace
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["Authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* NamespaceApiService Get all namespaces a user has access to
Returns all namespaces a user has access to.
* @param ctx context.Context for authentication, logging, tracing, etc.
@param optional (nil or map[string]interface{}) with one or more of:
@param "p" (int32) The page number. Used for pagination. If not provided, the first page of results is returned.
@param "s" (string) Search namespaces by name.
@return []ModelsNamespaceWithLists*/
func (a *NamespaceApiService) NamespacesGet(ctx context.Context, localVarOptionals map[string]interface{}) ([]ModelsNamespaceWithLists, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload []ModelsNamespaceWithLists
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/namespaces"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["p"], "int32", "p"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["s"], "string", "s"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["p"].(int32); localVarOk {
localVarQueryParams.Add("p", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["s"].(string); localVarOk {
localVarQueryParams.Add("s", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["Authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* NamespaceApiService Deletes a namespace
Delets a namespace
* @param ctx context.Context for authentication, logging, tracing, etc.
@param id Namespace ID
@return ModelsMessage*/
func (a *NamespaceApiService) NamespacesIdDelete(ctx context.Context, id int32) (ModelsMessage, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Delete")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload ModelsMessage
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/namespaces/{id}"
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["Authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* NamespaceApiService Gets one namespace
Returns a namespace by its ID.
* @param ctx context.Context for authentication, logging, tracing, etc.
@param id Namespace ID
@return ModelsNamespace*/
func (a *NamespaceApiService) NamespacesIdGet(ctx context.Context, id int32) (ModelsNamespace, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload ModelsNamespace
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/namespaces/{id}"
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["Authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* NamespaceApiService Get all lists in a namespace
Returns all lists inside of a namespace.
* @param ctx context.Context for authentication, logging, tracing, etc.
@param id Namespace ID
@return []ModelsList*/
func (a *NamespaceApiService) NamespacesIdListsGet(ctx context.Context, id int32) ([]ModelsList, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload []ModelsList
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/namespaces/{id}/lists"
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["Authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* NamespaceApiService Creates a new namespace
Creates a new namespace.
* @param ctx context.Context for authentication, logging, tracing, etc.
@param namespace The namespace you want to create.
@return ModelsNamespace*/
func (a *NamespaceApiService) NamespacesPut(ctx context.Context, namespace ModelsNamespace) (ModelsNamespace, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Put")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload ModelsNamespace
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/namespaces"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &namespace
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["Authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}

92
service_api.go Normal file
View File

@ -0,0 +1,92 @@
/*
* Vikunja API
*
* This is the documentation for the [Vikunja](http://vikunja.io) API. Vikunja is a cross-plattform Todo-application with a lot of features, such as sharing lists with users or teams. <!-- ReDoc-Inject: <security-definitions> --> # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer <jwt-token>`-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. <!-- ReDoc-Inject: <security-definitions> -->
*
* API version: 0.8+21-854fde1e4c
* Contact: hello@vikunja.io
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package swagger
import (
"io/ioutil"
"net/url"
"net/http"
"strings"
"golang.org/x/net/context"
"encoding/json"
)
// Linger please
var (
_ context.Context
)
type ServiceApiService service
/* ServiceApiService Info
Returns the version, frontendurl, motd and various settings of Vikunja
* @param ctx context.Context for authentication, logging, tracing, etc.
@return V1VikunjaInfos*/
func (a *ServiceApiService) InfoGet(ctx context.Context) (V1VikunjaInfos, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1VikunjaInfos
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/info"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}

1757
sharing_api.go Normal file

File diff suppressed because it is too large Load Diff

923
task_api.go Normal file
View File

@ -0,0 +1,923 @@
/*
* Vikunja API
*
* This is the documentation for the [Vikunja](http://vikunja.io) API. Vikunja is a cross-plattform Todo-application with a lot of features, such as sharing lists with users or teams. <!-- ReDoc-Inject: <security-definitions> --> # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer <jwt-token>`-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. <!-- ReDoc-Inject: <security-definitions> -->
*
* API version: 0.8+21-854fde1e4c
* Contact: hello@vikunja.io
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package swagger
import (
"io/ioutil"
"net/url"
"net/http"
"strings"
"golang.org/x/net/context"
"encoding/json"
"fmt"
)
// Linger please
var (
_ context.Context
)
type TaskApiService service
/* TaskApiService Create a task
Inserts a task into a list.
* @param ctx context.Context for authentication, logging, tracing, etc.
@param id List ID
@param task The task object
@return ModelsTask*/
func (a *TaskApiService) ListsIdPut(ctx context.Context, id int32, task ModelsTask) (ModelsTask, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Put")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload ModelsTask
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/lists/{id}"
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &task
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["Authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* TaskApiService Get tasks
Returns all tasks on any list the user has access to.
* @param ctx context.Context for authentication, logging, tracing, etc.
@param optional (nil or map[string]interface{}) with one or more of:
@param "p" (int32) The page number. Used for pagination. If not provided, the first page of results is returned.
@param "s" (string) Search tasks by task text.
@param "sort" (string) The sorting parameter. Possible values to sort by are priority, prioritydesc, priorityasc, duedate, duedatedesc, duedateasc.
@param "startdate" (int32) The start date parameter to filter by. Expects a unix timestamp. If no end date, but a start date is specified, the end date is set to the current time.
@param "enddate" (int32) The end date parameter to filter by. Expects a unix timestamp. If no start date, but an end date is specified, the start date is set to the current time.
@return []ModelsTask*/
func (a *TaskApiService) TasksAllGet(ctx context.Context, localVarOptionals map[string]interface{}) ([]ModelsTask, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload []ModelsTask
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/tasks/all"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["p"], "int32", "p"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["s"], "string", "s"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["sort"], "string", "sort"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["startdate"], "int32", "startdate"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["enddate"], "int32", "enddate"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["p"].(int32); localVarOk {
localVarQueryParams.Add("p", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["s"].(string); localVarOk {
localVarQueryParams.Add("s", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["sort"].(string); localVarOk {
localVarQueryParams.Add("sort", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["startdate"].(int32); localVarOk {
localVarQueryParams.Add("startdate", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["enddate"].(int32); localVarOk {
localVarQueryParams.Add("enddate", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["Authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* TaskApiService Update a bunch of tasks at once
Updates a bunch of tasks at once. This includes marking them as done. Note: although you could supply another ID, it will be ignored. Use task_ids instead.
* @param ctx context.Context for authentication, logging, tracing, etc.
@param task The task object. Looks like a normal task, the only difference is it uses an array of list_ids to update.
@return ModelsTask*/
func (a *TaskApiService) TasksBulkPost(ctx context.Context, task ModelsBulkTask) (ModelsTask, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Post")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload ModelsTask
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/tasks/bulk"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &task
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["Authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* TaskApiService Delete an attachment
Delete an attachment.
* @param ctx context.Context for authentication, logging, tracing, etc.
@param id Task ID
@param attachmentID Attachment ID
@return ModelsMessage*/
func (a *TaskApiService) TasksIdAttachmentsAttachmentIDDelete(ctx context.Context, id int32, attachmentID int32) (ModelsMessage, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Delete")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload ModelsMessage
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/tasks/{id}/attachments/{attachmentID}"
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1)
localVarPath = strings.Replace(localVarPath, "{"+"attachmentID"+"}", fmt.Sprintf("%v", attachmentID), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["Authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* TaskApiService Get one attachment.
Get one attachment for download. **Returns json on error.**
* @param ctx context.Context for authentication, logging, tracing, etc.
@param id Task ID
@param attachmentID Attachment ID
@return */
func (a *TaskApiService) TasksIdAttachmentsAttachmentIDGet(ctx context.Context, id int32, attachmentID int32) ( *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/tasks/{id}/attachments/{attachmentID}"
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1)
localVarPath = strings.Replace(localVarPath, "{"+"attachmentID"+"}", fmt.Sprintf("%v", attachmentID), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/octet-stream",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["Authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
return localVarHttpResponse, err
}
/* TaskApiService Get all attachments for one task.
Get all task attachments for one task.
* @param ctx context.Context for authentication, logging, tracing, etc.
@param id Task ID
@return []ModelsTaskAttachment*/
func (a *TaskApiService) TasksIdAttachmentsGet(ctx context.Context, id int32) ([]ModelsTaskAttachment, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload []ModelsTaskAttachment
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/tasks/{id}/attachments"
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["Authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* TaskApiService Upload a task attachment
Upload a task attachment. You can pass multiple files with the files form param.
* @param ctx context.Context for authentication, logging, tracing, etc.
@param id Task ID
@param files The file, as multipart form file. You can pass multiple.
@return ModelsMessage*/
func (a *TaskApiService) TasksIdAttachmentsPut(ctx context.Context, id int32, files string) (ModelsMessage, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Put")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload ModelsMessage
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/tasks/{id}/attachments"
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "multipart/form-data", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
localVarFormParams.Add("files", parameterToString(files, ""))
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["Authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* TaskApiService Delete a task
Deletes a task from a list. This does not mean \&quot;mark it done\&quot;.
* @param ctx context.Context for authentication, logging, tracing, etc.
@param id Task ID
@return ModelsMessage*/
func (a *TaskApiService) TasksIdDelete(ctx context.Context, id int32) (ModelsMessage, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Delete")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload ModelsMessage
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/tasks/{id}"
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["Authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* TaskApiService Update a task
Updates a task. This includes marking it as done. Assignees you pass will be updated, see their individual endpoints for more details on how this is done. To update labels, see the description of the endpoint.
* @param ctx context.Context for authentication, logging, tracing, etc.
@param id Task ID
@param task The task object
@return ModelsTask*/
func (a *TaskApiService) TasksIdPost(ctx context.Context, id int32, task ModelsTask) (ModelsTask, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Post")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload ModelsTask
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/tasks/{id}"
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &task
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["Authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* TaskApiService Remove a task relation
* @param ctx context.Context for authentication, logging, tracing, etc.
@param relation The relation object
@param taskID Task ID
@return ModelsMessage*/
func (a *TaskApiService) TasksTaskIDRelationsDelete(ctx context.Context, relation ModelsTaskRelation, taskID int32) (ModelsMessage, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Delete")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload ModelsMessage
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/tasks/{taskID}/relations"
localVarPath = strings.Replace(localVarPath, "{"+"taskID"+"}", fmt.Sprintf("%v", taskID), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &relation
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["Authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* TaskApiService Create a new relation between two tasks
Creates a new relation between two tasks. The user needs to have update rights on the base task and at least read rights on the other task. Both tasks do not need to be on the same list. Take a look at the docs for available task relation kinds.
* @param ctx context.Context for authentication, logging, tracing, etc.
@param relation The relation object
@param taskID Task ID
@return ModelsTaskRelation*/
func (a *TaskApiService) TasksTaskIDRelationsPut(ctx context.Context, relation ModelsTaskRelation, taskID int32) (ModelsTaskRelation, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Put")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload ModelsTaskRelation
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/tasks/{taskID}/relations"
localVarPath = strings.Replace(localVarPath, "{"+"taskID"+"}", fmt.Sprintf("%v", taskID), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &relation
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["Authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}

514
team_api.go Normal file
View File

@ -0,0 +1,514 @@
/*
* Vikunja API
*
* This is the documentation for the [Vikunja](http://vikunja.io) API. Vikunja is a cross-plattform Todo-application with a lot of features, such as sharing lists with users or teams. <!-- ReDoc-Inject: <security-definitions> --> # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer <jwt-token>`-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. <!-- ReDoc-Inject: <security-definitions> -->
*
* API version: 0.8+21-854fde1e4c
* Contact: hello@vikunja.io
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package swagger
import (
"io/ioutil"
"net/url"
"net/http"
"strings"
"golang.org/x/net/context"
"encoding/json"
"fmt"
)
// Linger please
var (
_ context.Context
)
type TeamApiService service
/* TeamApiService Get teams
Returns all teams the current user is part of.
* @param ctx context.Context for authentication, logging, tracing, etc.
@param optional (nil or map[string]interface{}) with one or more of:
@param "p" (int32) The page number. Used for pagination. If not provided, the first page of results is returned.
@param "s" (string) Search teams by its name.
@return []ModelsTeam*/
func (a *TeamApiService) TeamsGet(ctx context.Context, localVarOptionals map[string]interface{}) ([]ModelsTeam, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload []ModelsTeam
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/teams"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["p"], "int32", "p"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["s"], "string", "s"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["p"].(int32); localVarOk {
localVarQueryParams.Add("p", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["s"].(string); localVarOk {
localVarQueryParams.Add("s", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["Authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* TeamApiService Deletes a team
Delets a team. This will also remove the access for all users in that team.
* @param ctx context.Context for authentication, logging, tracing, etc.
@param id Team ID
@return ModelsMessage*/
func (a *TeamApiService) TeamsIdDelete(ctx context.Context, id int32) (ModelsMessage, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Delete")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload ModelsMessage
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/teams/{id}"
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["Authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* TeamApiService Add a user to a team
Add a user to a team.
* @param ctx context.Context for authentication, logging, tracing, etc.
@param id Team ID
@param team The user to be added to a team.
@return ModelsTeamMember*/
func (a *TeamApiService) TeamsIdMembersPut(ctx context.Context, id int32, team ModelsTeamMember) (ModelsTeamMember, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Put")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload ModelsTeamMember
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/teams/{id}/members"
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &team
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["Authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* TeamApiService Remove a user from a team
Remove a user from a team. This will also revoke any access this user might have via that team.
* @param ctx context.Context for authentication, logging, tracing, etc.
@param id Team ID
@param userID User ID
@return ModelsMessage*/
func (a *TeamApiService) TeamsIdMembersUserIDDelete(ctx context.Context, id int32, userID int32) (ModelsMessage, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Delete")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload ModelsMessage
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/teams/{id}/members/{userID}"
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1)
localVarPath = strings.Replace(localVarPath, "{"+"userID"+"}", fmt.Sprintf("%v", userID), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["Authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* TeamApiService Updates a team
Updates a team.
* @param ctx context.Context for authentication, logging, tracing, etc.
@param id Team ID
@param team The team with updated values you want to update.
@return ModelsTeam*/
func (a *TeamApiService) TeamsIdPost(ctx context.Context, id int32, team ModelsTeam) (ModelsTeam, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Post")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload ModelsTeam
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/teams/{id}"
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &team
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["Authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* TeamApiService Creates a new team
Creates a new team in a given namespace. The user needs write-access to the namespace.
* @param ctx context.Context for authentication, logging, tracing, etc.
@param team The team you want to create.
@return ModelsTeam*/
func (a *TeamApiService) TeamsPut(ctx context.Context, team ModelsTeam) (ModelsTeam, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Put")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload ModelsTeam
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/teams"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &team
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["Authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}

595
user_api.go Normal file
View File

@ -0,0 +1,595 @@
/*
* Vikunja API
*
* This is the documentation for the [Vikunja](http://vikunja.io) API. Vikunja is a cross-plattform Todo-application with a lot of features, such as sharing lists with users or teams. <!-- ReDoc-Inject: <security-definitions> --> # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer <jwt-token>`-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. <!-- ReDoc-Inject: <security-definitions> -->
*
* API version: 0.8+21-854fde1e4c
* Contact: hello@vikunja.io
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package swagger
import (
"io/ioutil"
"net/url"
"net/http"
"strings"
"golang.org/x/net/context"
"encoding/json"
)
// Linger please
var (
_ context.Context
)
type UserApiService service
/* UserApiService Login
Logs a user in. Returns a JWT-Token to authenticate further requests.
* @param ctx context.Context for authentication, logging, tracing, etc.
@param credentials The login credentials
@return V1Token*/
func (a *UserApiService) LoginPost(ctx context.Context, credentials ModelsUserLogin) (V1Token, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Post")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1Token
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/login"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &credentials
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* UserApiService Register
Creates a new user account.
* @param ctx context.Context for authentication, logging, tracing, etc.
@param credentials The user credentials
@return ModelsUser*/
func (a *UserApiService) RegisterPost(ctx context.Context, credentials ModelsApiUserPassword) (ModelsUser, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Post")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload ModelsUser
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/register"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &credentials
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* UserApiService Confirm the email of a new user
Confirms the email of a newly registered user.
* @param ctx context.Context for authentication, logging, tracing, etc.
@param credentials The token.
@return ModelsMessage*/
func (a *UserApiService) UserConfirmPost(ctx context.Context, credentials ModelsEmailConfirm) (ModelsMessage, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Post")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload ModelsMessage
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/user/confirm"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &credentials
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* UserApiService Get user information
Returns the current user object.
* @param ctx context.Context for authentication, logging, tracing, etc.
@return ModelsUser*/
func (a *UserApiService) UserGet(ctx context.Context) (ModelsUser, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload ModelsUser
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/user"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["Authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* UserApiService Change password
Lets the current user change its password.
* @param ctx context.Context for authentication, logging, tracing, etc.
@param userPassword The current and new password.
@return ModelsMessage*/
func (a *UserApiService) UserPasswordPost(ctx context.Context, userPassword V1UserPassword) (ModelsMessage, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Post")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload ModelsMessage
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/user/password"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &userPassword
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["Authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* UserApiService Resets a password
Resets a user email with a previously reset token.
* @param ctx context.Context for authentication, logging, tracing, etc.
@param credentials The token with the new password.
@return ModelsMessage*/
func (a *UserApiService) UserPasswordResetPost(ctx context.Context, credentials ModelsPasswordReset) (ModelsMessage, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Post")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload ModelsMessage
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/user/password/reset"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &credentials
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* UserApiService Request password reset token
Requests a token to reset a users password. The token is sent via email.
* @param ctx context.Context for authentication, logging, tracing, etc.
@param credentials The username of the user to request a token for.
@return ModelsMessage*/
func (a *UserApiService) UserPasswordTokenPost(ctx context.Context, credentials ModelsPasswordTokenRequest) (ModelsMessage, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Post")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload ModelsMessage
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/user/password/token"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &credentials
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* UserApiService Get users
Lists all users (without emailadresses). Also possible to search for a specific user.
* @param ctx context.Context for authentication, logging, tracing, etc.
@param optional (nil or map[string]interface{}) with one or more of:
@param "s" (string) Search for a user by its name.
@return []ModelsUser*/
func (a *UserApiService) UsersGet(ctx context.Context, localVarOptionals map[string]interface{}) ([]ModelsUser, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload []ModelsUser
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/users"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["s"], "string", "s"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["s"].(string); localVarOk {
localVarQueryParams.Add("s", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["Authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}

16
v1_token.go Normal file
View File

@ -0,0 +1,16 @@
/*
* Vikunja API
*
* This is the documentation for the [Vikunja](http://vikunja.io) API. Vikunja is a cross-plattform Todo-application with a lot of features, such as sharing lists with users or teams. <!-- ReDoc-Inject: <security-definitions> --> # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer <jwt-token>`-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. <!-- ReDoc-Inject: <security-definitions> -->
*
* API version: 0.8+21-854fde1e4c
* Contact: hello@vikunja.io
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package swagger
type V1Token struct {
Token string `json:"token,omitempty"`
}

18
v1_user_password.go Normal file
View File

@ -0,0 +1,18 @@
/*
* Vikunja API
*
* This is the documentation for the [Vikunja](http://vikunja.io) API. Vikunja is a cross-plattform Todo-application with a lot of features, such as sharing lists with users or teams. <!-- ReDoc-Inject: <security-definitions> --> # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer <jwt-token>`-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. <!-- ReDoc-Inject: <security-definitions> -->
*
* API version: 0.8+21-854fde1e4c
* Contact: hello@vikunja.io
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package swagger
type V1UserPassword struct {
NewPassword string `json:"new_password,omitempty"`
OldPassword string `json:"old_password,omitempty"`
}

24
v1_vikunja_infos.go Normal file
View File

@ -0,0 +1,24 @@
/*
* Vikunja API
*
* This is the documentation for the [Vikunja](http://vikunja.io) API. Vikunja is a cross-plattform Todo-application with a lot of features, such as sharing lists with users or teams. <!-- ReDoc-Inject: <security-definitions> --> # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer <jwt-token>`-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. <!-- ReDoc-Inject: <security-definitions> -->
*
* API version: 0.8+21-854fde1e4c
* Contact: hello@vikunja.io
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package swagger
type V1VikunjaInfos struct {
FrontendUrl string `json:"frontend_url,omitempty"`
LinkSharingEnabled bool `json:"link_sharing_enabled,omitempty"`
MaxFileSize int32 `json:"max_file_size,omitempty"`
Motd string `json:"motd,omitempty"`
Version string `json:"version,omitempty"`
}