commit d1bd0237add924013ba1f2d417c39261492215d6 Author: kolaente Date: Sat Oct 19 22:53:41 2019 +0200 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..daf913b --- /dev/null +++ b/.gitignore @@ -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 diff --git a/.swagger-codegen-ignore b/.swagger-codegen-ignore new file mode 100644 index 0000000..c5fa491 --- /dev/null +++ b/.swagger-codegen-ignore @@ -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 diff --git a/.swagger-codegen/VERSION b/.swagger-codegen/VERSION new file mode 100644 index 0000000..a625450 --- /dev/null +++ b/.swagger-codegen/VERSION @@ -0,0 +1 @@ +2.3.1 \ No newline at end of file diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..f5cb2ce --- /dev/null +++ b/.travis.yml @@ -0,0 +1,8 @@ +language: go + +install: + - go get -d -v . + +script: + - go build -v ./ + diff --git a/README.md b/README.md new file mode 100644 index 0000000..d7e1b84 --- /dev/null +++ b/README.md @@ -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. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. + +## 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 <-> 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 <-> 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 <-> 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 <-> 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 + diff --git a/api/swagger.yaml b/api/swagger.yaml new file mode 100644 index 0000000..4e8405e --- /dev/null +++ b/api/swagger.yaml @@ -0,0 +1,4700 @@ +--- +swagger: "2.0" +info: + description: "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. \n# Authorization\n**JWT-Auth:** Main authorization method, used for most\ + \ of the requests. Needs `Authorization: Bearer `-header to authenticate\ + \ successfully.\n\n**BasicAuth:** Only used when requesting tasks via caldav.\n\ + " + version: "0.8+21-854fde1e4c" + title: "Vikunja API" + contact: + name: "General Vikunja contact" + url: "http://vikunja.io/en/contact/" + email: "hello@vikunja.io" + license: + name: "GPLv3" + url: "http://code.vikunja.io/api/src/branch/master/LICENSE" +host: "" +basePath: "/api/v1" +paths: + /info: + get: + tags: + - "service" + summary: "Info" + description: "Returns the version, frontendurl, motd and various settings of\ + \ Vikunja" + produces: + - "application/json" + parameters: [] + responses: + 200: + description: "OK" + schema: + $ref: "#/definitions/v1.vikunjaInfos" + /labels: + get: + tags: + - "labels" + summary: "Get all labels a user has access to" + description: "Returns all labels which are either created by the user or associated\ + \ with a task the user has at least read-access to." + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - name: "p" + in: "query" + description: "The page number. Used for pagination. If not provided, the first\ + \ page of results is returned." + required: false + type: "integer" + x-exportParamName: "P" + - name: "s" + in: "query" + description: "Search labels by label text." + required: false + type: "string" + x-exportParamName: "S" + responses: + 200: + description: "The labels" + schema: + type: "array" + items: + $ref: "#/definitions/models.Label" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] + put: + tags: + - "labels" + summary: "Create a label" + description: "Creates a new label." + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - in: "body" + name: "label" + description: "The label object" + required: true + schema: + $ref: "#/definitions/models.Label" + x-exportParamName: "Label" + responses: + 200: + description: "The created label object." + schema: + $ref: "#/definitions/models.Label" + 400: + description: "Invalid label object provided." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] + /labels/{id}: + get: + tags: + - "labels" + summary: "Gets one label" + description: "Returns one label by its ID." + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - name: "id" + in: "path" + description: "Label ID" + required: true + type: "integer" + x-exportParamName: "Id" + responses: + 200: + description: "The label" + schema: + $ref: "#/definitions/models.Label" + 403: + description: "The user does not have access to the label" + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 404: + description: "Label not found" + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] + put: + tags: + - "labels" + summary: "Update a label" + description: "Update an existing label. The user needs to be the creator of\ + \ the label to be able to do this." + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - name: "id" + in: "path" + description: "Label ID" + required: true + type: "integer" + x-exportParamName: "Id" + - in: "body" + name: "label" + description: "The label object" + required: true + schema: + $ref: "#/definitions/models.Label" + x-exportParamName: "Label" + responses: + 200: + description: "The created label object." + schema: + $ref: "#/definitions/models.Label" + 400: + description: "Invalid label object provided." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 403: + description: "Not allowed to update the label." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 404: + description: "Label not found." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] + delete: + tags: + - "labels" + summary: "Delete a label" + description: "Delete an existing label. The user needs to be the creator of\ + \ the label to be able to do this." + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - name: "id" + in: "path" + description: "Label ID" + required: true + type: "integer" + x-exportParamName: "Id" + responses: + 200: + description: "The label was successfully deleted." + schema: + $ref: "#/definitions/models.Label" + 403: + description: "Not allowed to delete the label." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 404: + description: "Label not found." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] + /lists: + get: + tags: + - "list" + summary: "Get all lists a user has access to" + description: "Returns all lists a user has access to." + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - name: "p" + in: "query" + description: "The page number. Used for pagination. If not provided, the first\ + \ page of results is returned." + required: false + type: "integer" + x-exportParamName: "P" + - name: "s" + in: "query" + description: "Search lists by title." + required: false + type: "string" + x-exportParamName: "S" + responses: + 200: + description: "The lists" + schema: + type: "array" + items: + $ref: "#/definitions/models.List" + 403: + description: "The user does not have access to the list" + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] + /lists/{id}: + get: + tags: + - "list" + summary: "Gets one list" + description: "Returns a list by its ID." + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - name: "id" + in: "path" + description: "List ID" + required: true + type: "integer" + x-exportParamName: "Id" + responses: + 200: + description: "The list" + schema: + $ref: "#/definitions/models.List" + 403: + description: "The user does not have access to the list" + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] + post: + tags: + - "list" + summary: "Updates a list" + description: "Updates a list. This does not include adding a task (see below)." + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - name: "id" + in: "path" + description: "List ID" + required: true + type: "integer" + x-exportParamName: "Id" + - in: "body" + name: "list" + description: "The list with updated values you want to update." + required: true + schema: + $ref: "#/definitions/models.List" + x-exportParamName: "List" + responses: + 200: + description: "The updated list." + schema: + $ref: "#/definitions/models.List" + 400: + description: "Invalid list object provided." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 403: + description: "The user does not have access to the list" + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] + put: + tags: + - "task" + summary: "Create a task" + description: "Inserts a task into a list." + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - name: "id" + in: "path" + description: "List ID" + required: true + type: "integer" + x-exportParamName: "Id" + - in: "body" + name: "task" + description: "The task object" + required: true + schema: + $ref: "#/definitions/models.Task" + x-exportParamName: "Task" + responses: + 200: + description: "The created task object." + schema: + $ref: "#/definitions/models.Task" + 400: + description: "Invalid task object provided." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 403: + description: "The user does not have access to the list" + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] + delete: + tags: + - "list" + summary: "Deletes a list" + description: "Delets a list" + produces: + - "application/json" + parameters: + - name: "id" + in: "path" + description: "List ID" + required: true + type: "integer" + x-exportParamName: "Id" + responses: + 200: + description: "The list was successfully deleted." + schema: + $ref: "#/definitions/models.Message" + 400: + description: "Invalid list object provided." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 403: + description: "The user does not have access to the list" + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] + /lists/{id}/listusers: + get: + tags: + - "list" + summary: "Get users" + description: "Lists all users (without emailadresses). Also possible to search\ + \ for a specific user." + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - name: "s" + in: "query" + description: "Search for a user by its name." + required: false + type: "string" + x-exportParamName: "S" + - name: "id" + in: "path" + description: "List ID" + required: true + type: "integer" + x-exportParamName: "Id" + responses: + 200: + description: "All (found) users." + schema: + type: "array" + items: + $ref: "#/definitions/models.User" + 400: + description: "Something's invalid." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 401: + description: "The user does not have the right to see the list." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 500: + description: "Internal server error." + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] + /lists/{id}/teams: + get: + tags: + - "sharing" + summary: "Get teams on a list" + description: "Returns a list with all teams which have access on a given list." + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - name: "id" + in: "path" + description: "List ID" + required: true + type: "integer" + x-exportParamName: "Id" + - name: "p" + in: "query" + description: "The page number. Used for pagination. If not provided, the first\ + \ page of results is returned." + required: false + type: "integer" + x-exportParamName: "P" + - name: "s" + in: "query" + description: "Search teams by its name." + required: false + type: "string" + x-exportParamName: "S" + responses: + 200: + description: "The teams with their right." + schema: + type: "array" + items: + $ref: "#/definitions/models.TeamWithRight" + 403: + description: "No right to see the list." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] + put: + tags: + - "sharing" + summary: "Add a team to a list" + description: "Gives a team access to a list." + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - name: "id" + in: "path" + description: "List ID" + required: true + type: "integer" + x-exportParamName: "Id" + - in: "body" + name: "list" + description: "The team you want to add to the list." + required: true + schema: + $ref: "#/definitions/models.TeamList" + x-exportParamName: "List" + responses: + 200: + description: "The created team<->list relation." + schema: + $ref: "#/definitions/models.TeamList" + 400: + description: "Invalid team list object provided." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 403: + description: "The user does not have access to the list" + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 404: + description: "The team does not exist." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] + /lists/{id}/users: + get: + tags: + - "sharing" + summary: "Get users on a list" + description: "Returns a list with all users which have access on a given list." + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - name: "id" + in: "path" + description: "List ID" + required: true + type: "integer" + x-exportParamName: "Id" + - name: "p" + in: "query" + description: "The page number. Used for pagination. If not provided, the first\ + \ page of results is returned." + required: false + type: "integer" + x-exportParamName: "P" + - name: "s" + in: "query" + description: "Search users by its name." + required: false + type: "string" + x-exportParamName: "S" + responses: + 200: + description: "The users with the right they have." + schema: + type: "array" + items: + $ref: "#/definitions/models.UserWithRight" + 403: + description: "No right to see the list." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] + put: + tags: + - "sharing" + summary: "Add a user to a list" + description: "Gives a user access to a list." + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - name: "id" + in: "path" + description: "List ID" + required: true + type: "integer" + x-exportParamName: "Id" + - in: "body" + name: "list" + description: "The user you want to add to the list." + required: true + schema: + $ref: "#/definitions/models.ListUser" + x-exportParamName: "List" + responses: + 200: + description: "The created user<->list relation." + schema: + $ref: "#/definitions/models.ListUser" + 400: + description: "Invalid user list object provided." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 403: + description: "The user does not have access to the list" + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 404: + description: "The user does not exist." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] + /lists/{listID}/teams/{teamID}: + post: + tags: + - "sharing" + summary: "Update a team <-> list relation" + description: "Update a team <-> list relation. Mostly used to update the right\ + \ that team has." + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - name: "listID" + in: "path" + description: "List ID" + required: true + type: "integer" + x-exportParamName: "ListID" + - name: "teamID" + in: "path" + description: "Team ID" + required: true + type: "integer" + x-exportParamName: "TeamID" + - in: "body" + name: "list" + description: "The team you want to update." + required: true + schema: + $ref: "#/definitions/models.TeamList" + x-exportParamName: "List" + responses: + 200: + description: "The updated team <-> list relation." + schema: + $ref: "#/definitions/models.TeamList" + 403: + description: "The user does not have admin-access to the list" + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 404: + description: "Team or list does not exist." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] + delete: + tags: + - "sharing" + summary: "Delete a team from a list" + description: "Delets a team from a list. The team won't have access to the list\ + \ anymore." + produces: + - "application/json" + parameters: + - name: "listID" + in: "path" + description: "List ID" + required: true + type: "integer" + x-exportParamName: "ListID" + - name: "teamID" + in: "path" + description: "Team ID" + required: true + type: "integer" + x-exportParamName: "TeamID" + responses: + 200: + description: "The team was successfully deleted." + schema: + $ref: "#/definitions/models.Message" + 403: + description: "The user does not have access to the list" + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 404: + description: "Team or list does not exist." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] + /lists/{listID}/users/{userID}: + post: + tags: + - "sharing" + summary: "Update a user <-> list relation" + description: "Update a user <-> list relation. Mostly used to update the right\ + \ that user has." + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - name: "listID" + in: "path" + description: "List ID" + required: true + type: "integer" + x-exportParamName: "ListID" + - name: "userID" + in: "path" + description: "User ID" + required: true + type: "integer" + x-exportParamName: "UserID" + - in: "body" + name: "list" + description: "The user you want to update." + required: true + schema: + $ref: "#/definitions/models.ListUser" + x-exportParamName: "List" + responses: + 200: + description: "The updated user <-> list relation." + schema: + $ref: "#/definitions/models.ListUser" + 403: + description: "The user does not have admin-access to the list" + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 404: + description: "User or list does not exist." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] + delete: + tags: + - "sharing" + summary: "Delete a user from a list" + description: "Delets a user from a list. The user won't have access to the list\ + \ anymore." + produces: + - "application/json" + parameters: + - name: "listID" + in: "path" + description: "List ID" + required: true + type: "integer" + x-exportParamName: "ListID" + - name: "userID" + in: "path" + description: "User ID" + required: true + type: "integer" + x-exportParamName: "UserID" + responses: + 200: + description: "The user was successfully removed from the list." + schema: + $ref: "#/definitions/models.Message" + 403: + description: "The user does not have access to the list" + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 404: + description: "user or list does not exist." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] + /lists/{list}/shares: + get: + tags: + - "sharing" + summary: "Get all link shares for a list" + description: "Returns all link shares which exist for a given list" + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - name: "list" + in: "path" + description: "List ID" + required: true + type: "integer" + x-exportParamName: "List" + - name: "p" + in: "query" + description: "The page number. Used for pagination. If not provided, the first\ + \ page of results is returned." + required: false + type: "integer" + x-exportParamName: "P" + - name: "s" + in: "query" + description: "Search shares by hash." + required: false + type: "string" + x-exportParamName: "S" + responses: + 200: + description: "The share links" + schema: + type: "array" + items: + $ref: "#/definitions/models.LinkSharing" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] + put: + tags: + - "sharing" + summary: "Share a list via link" + description: "Share a list via link. The user needs to have write-access to\ + \ the list to be able do this." + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - name: "list" + in: "path" + description: "List ID" + required: true + type: "integer" + x-exportParamName: "List" + - in: "body" + name: "label" + description: "The new link share object" + required: true + schema: + $ref: "#/definitions/models.LinkSharing" + x-exportParamName: "Label" + responses: + 200: + description: "The created link share object." + schema: + $ref: "#/definitions/models.LinkSharing" + 400: + description: "Invalid link share object provided." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 403: + description: "Not allowed to add the list share." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 404: + description: "The list does not exist." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] + /lists/{list}/shares/{share}: + get: + tags: + - "sharing" + summary: "Get one link shares for a list" + description: "Returns one link share by its ID." + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - name: "list" + in: "path" + description: "List ID" + required: true + type: "integer" + x-exportParamName: "List" + - name: "share" + in: "path" + description: "Share ID" + required: true + type: "integer" + x-exportParamName: "Share" + responses: + 200: + description: "The share links" + schema: + $ref: "#/definitions/models.LinkSharing" + 403: + description: "No access to the list" + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 404: + description: "Share Link not found." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] + delete: + tags: + - "sharing" + summary: "Remove a link share" + description: "Remove a link share. The user needs to have write-access to the\ + \ list to be able do this." + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - name: "list" + in: "path" + description: "List ID" + required: true + type: "integer" + x-exportParamName: "List" + - name: "share" + in: "path" + description: "Share Link ID" + required: true + type: "integer" + x-exportParamName: "Share" + responses: + 200: + description: "The link was successfully removed." + schema: + $ref: "#/definitions/models.Message" + 403: + description: "Not allowed to remove the link." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 404: + description: "Share Link not found." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] + /login: + post: + tags: + - "user" + summary: "Login" + description: "Logs a user in. Returns a JWT-Token to authenticate further requests." + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - in: "body" + name: "credentials" + description: "The login credentials" + required: true + schema: + $ref: "#/definitions/models.UserLogin" + x-exportParamName: "Credentials" + responses: + 200: + description: "OK" + schema: + $ref: "#/definitions/v1.Token" + 400: + description: "Invalid user password model." + schema: + $ref: "#/definitions/models.Message" + 403: + description: "Invalid username or password." + schema: + $ref: "#/definitions/models.Message" + /namespace/{id}: + post: + tags: + - "namespace" + summary: "Updates a namespace" + description: "Updates a namespace." + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - name: "id" + in: "path" + description: "Namespace ID" + required: true + type: "integer" + x-exportParamName: "Id" + - in: "body" + name: "namespace" + description: "The namespace with updated values you want to update." + required: true + schema: + $ref: "#/definitions/models.Namespace" + x-exportParamName: "Namespace" + responses: + 200: + description: "The updated namespace." + schema: + $ref: "#/definitions/models.Namespace" + 400: + description: "Invalid namespace object provided." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 403: + description: "The user does not have access to the namespace" + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] + /namespaces: + get: + tags: + - "namespace" + summary: "Get all namespaces a user has access to" + description: "Returns all namespaces a user has access to." + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - name: "p" + in: "query" + description: "The page number. Used for pagination. If not provided, the first\ + \ page of results is returned." + required: false + type: "integer" + x-exportParamName: "P" + - name: "s" + in: "query" + description: "Search namespaces by name." + required: false + type: "string" + x-exportParamName: "S" + responses: + 200: + description: "The Namespaces." + schema: + type: "array" + items: + $ref: "#/definitions/models.NamespaceWithLists" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] + put: + tags: + - "namespace" + summary: "Creates a new namespace" + description: "Creates a new namespace." + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - in: "body" + name: "namespace" + description: "The namespace you want to create." + required: true + schema: + $ref: "#/definitions/models.Namespace" + x-exportParamName: "Namespace" + responses: + 200: + description: "The created namespace." + schema: + $ref: "#/definitions/models.Namespace" + 400: + description: "Invalid namespace object provided." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 403: + description: "The user does not have access to the namespace" + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] + /namespaces/{id}: + get: + tags: + - "namespace" + summary: "Gets one namespace" + description: "Returns a namespace by its ID." + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - name: "id" + in: "path" + description: "Namespace ID" + required: true + type: "integer" + x-exportParamName: "Id" + responses: + 200: + description: "The Namespace" + schema: + $ref: "#/definitions/models.Namespace" + 403: + description: "The user does not have access to that namespace." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] + delete: + tags: + - "namespace" + summary: "Deletes a namespace" + description: "Delets a namespace" + produces: + - "application/json" + parameters: + - name: "id" + in: "path" + description: "Namespace ID" + required: true + type: "integer" + x-exportParamName: "Id" + responses: + 200: + description: "The namespace was successfully deleted." + schema: + $ref: "#/definitions/models.Message" + 400: + description: "Invalid namespace object provided." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 403: + description: "The user does not have access to the namespace" + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] + /namespaces/{id}/lists: + get: + tags: + - "namespace" + summary: "Get all lists in a namespace" + description: "Returns all lists inside of a namespace." + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - name: "id" + in: "path" + description: "Namespace ID" + required: true + type: "integer" + x-exportParamName: "Id" + responses: + 200: + description: "The lists." + schema: + type: "array" + items: + $ref: "#/definitions/models.List" + 403: + description: "No access to that namespace." + schema: + $ref: "#/definitions/models.Message" + 404: + description: "The namespace does not exist." + schema: + $ref: "#/definitions/models.Message" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] + /namespaces/{id}/teams: + get: + tags: + - "sharing" + summary: "Get teams on a namespace" + description: "Returns a namespace with all teams which have access on a given\ + \ namespace." + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - name: "id" + in: "path" + description: "Namespace ID" + required: true + type: "integer" + x-exportParamName: "Id" + - name: "p" + in: "query" + description: "The page number. Used for pagination. If not provided, the first\ + \ page of results is returned." + required: false + type: "integer" + x-exportParamName: "P" + - name: "s" + in: "query" + description: "Search teams by its name." + required: false + type: "string" + x-exportParamName: "S" + responses: + 200: + description: "The teams with the right they have." + schema: + type: "array" + items: + $ref: "#/definitions/models.TeamWithRight" + 403: + description: "No right to see the namespace." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] + put: + tags: + - "sharing" + summary: "Add a team to a namespace" + description: "Gives a team access to a namespace." + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - name: "id" + in: "path" + description: "Namespace ID" + required: true + type: "integer" + x-exportParamName: "Id" + - in: "body" + name: "namespace" + description: "The team you want to add to the namespace." + required: true + schema: + $ref: "#/definitions/models.TeamNamespace" + x-exportParamName: "Namespace" + responses: + 200: + description: "The created team<->namespace relation." + schema: + $ref: "#/definitions/models.TeamNamespace" + 400: + description: "Invalid team namespace object provided." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 403: + description: "The team does not have access to the namespace" + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 404: + description: "The team does not exist." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] + /namespaces/{id}/users: + get: + tags: + - "sharing" + summary: "Get users on a namespace" + description: "Returns a namespace with all users which have access on a given\ + \ namespace." + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - name: "id" + in: "path" + description: "Namespace ID" + required: true + type: "integer" + x-exportParamName: "Id" + - name: "p" + in: "query" + description: "The page number. Used for pagination. If not provided, the first\ + \ page of results is returned." + required: false + type: "integer" + x-exportParamName: "P" + - name: "s" + in: "query" + description: "Search users by its name." + required: false + type: "string" + x-exportParamName: "S" + responses: + 200: + description: "The users with the right they have." + schema: + type: "array" + items: + $ref: "#/definitions/models.UserWithRight" + 403: + description: "No right to see the namespace." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] + put: + tags: + - "sharing" + summary: "Add a user to a namespace" + description: "Gives a user access to a namespace." + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - name: "id" + in: "path" + description: "Namespace ID" + required: true + type: "integer" + x-exportParamName: "Id" + - in: "body" + name: "namespace" + description: "The user you want to add to the namespace." + required: true + schema: + $ref: "#/definitions/models.NamespaceUser" + x-exportParamName: "Namespace" + responses: + 200: + description: "The created user<->namespace relation." + schema: + $ref: "#/definitions/models.NamespaceUser" + 400: + description: "Invalid user namespace object provided." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 403: + description: "The user does not have access to the namespace" + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 404: + description: "The user does not exist." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] + /namespaces/{namespaceID}/lists: + put: + tags: + - "list" + summary: "Creates a new list" + description: "Creates a new list in a given namespace. The user needs write-access\ + \ to the namespace." + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - name: "namespaceID" + in: "path" + description: "Namespace ID" + required: true + type: "integer" + x-exportParamName: "NamespaceID" + - in: "body" + name: "list" + description: "The list you want to create." + required: true + schema: + $ref: "#/definitions/models.List" + x-exportParamName: "List" + responses: + 200: + description: "The created list." + schema: + $ref: "#/definitions/models.List" + 400: + description: "Invalid list object provided." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 403: + description: "The user does not have access to the list" + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] + /namespaces/{namespaceID}/teams/{teamID}: + post: + tags: + - "sharing" + summary: "Update a team <-> namespace relation" + description: "Update a team <-> namespace relation. Mostly used to update the\ + \ right that team has." + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - name: "namespaceID" + in: "path" + description: "Namespace ID" + required: true + type: "integer" + x-exportParamName: "NamespaceID" + - name: "teamID" + in: "path" + description: "Team ID" + required: true + type: "integer" + x-exportParamName: "TeamID" + - in: "body" + name: "namespace" + description: "The team you want to update." + required: true + schema: + $ref: "#/definitions/models.TeamNamespace" + x-exportParamName: "Namespace" + responses: + 200: + description: "The updated team <-> namespace relation." + schema: + $ref: "#/definitions/models.TeamNamespace" + 403: + description: "The team does not have admin-access to the namespace" + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 404: + description: "Team or namespace does not exist." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] + delete: + tags: + - "sharing" + summary: "Delete a team from a namespace" + description: "Delets a team from a namespace. The team won't have access to\ + \ the namespace anymore." + produces: + - "application/json" + parameters: + - name: "namespaceID" + in: "path" + description: "Namespace ID" + required: true + type: "integer" + x-exportParamName: "NamespaceID" + - name: "teamID" + in: "path" + description: "team ID" + required: true + type: "integer" + x-exportParamName: "TeamID" + responses: + 200: + description: "The team was successfully deleted." + schema: + $ref: "#/definitions/models.Message" + 403: + description: "The team does not have access to the namespace" + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 404: + description: "team or namespace does not exist." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] + /namespaces/{namespaceID}/users/{userID}: + post: + tags: + - "sharing" + summary: "Update a user <-> namespace relation" + description: "Update a user <-> namespace relation. Mostly used to update the\ + \ right that user has." + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - name: "namespaceID" + in: "path" + description: "Namespace ID" + required: true + type: "integer" + x-exportParamName: "NamespaceID" + - name: "userID" + in: "path" + description: "User ID" + required: true + type: "integer" + x-exportParamName: "UserID" + - in: "body" + name: "namespace" + description: "The user you want to update." + required: true + schema: + $ref: "#/definitions/models.NamespaceUser" + x-exportParamName: "Namespace" + responses: + 200: + description: "The updated user <-> namespace relation." + schema: + $ref: "#/definitions/models.NamespaceUser" + 403: + description: "The user does not have admin-access to the namespace" + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 404: + description: "User or namespace does not exist." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] + delete: + tags: + - "sharing" + summary: "Delete a user from a namespace" + description: "Delets a user from a namespace. The user won't have access to\ + \ the namespace anymore." + produces: + - "application/json" + parameters: + - name: "namespaceID" + in: "path" + description: "Namespace ID" + required: true + type: "integer" + x-exportParamName: "NamespaceID" + - name: "userID" + in: "path" + description: "user ID" + required: true + type: "integer" + x-exportParamName: "UserID" + responses: + 200: + description: "The user was successfully deleted." + schema: + $ref: "#/definitions/models.Message" + 403: + description: "The user does not have access to the namespace" + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 404: + description: "user or namespace does not exist." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] + /register: + post: + tags: + - "user" + summary: "Register" + description: "Creates a new user account." + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - in: "body" + name: "credentials" + description: "The user credentials" + required: true + schema: + $ref: "#/definitions/models.APIUserPassword" + x-exportParamName: "Credentials" + responses: + 200: + description: "OK" + schema: + $ref: "#/definitions/models.User" + 400: + description: "No or invalid user register object provided / User already\ + \ exists." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + /shares/{share}/auth: + post: + tags: + - "sharing" + summary: "Get an auth token for a share" + description: "Get a jwt auth token for a shared list from a share hash." + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - name: "share" + in: "path" + description: "The share hash" + required: true + type: "string" + x-exportParamName: "Share" + responses: + 200: + description: "The valid jwt auth token." + schema: + $ref: "#/definitions/v1.Token" + 400: + description: "Invalid link share object provided." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + /tasks/all: + get: + tags: + - "task" + summary: "Get tasks" + description: "Returns all tasks on any list the user has access to." + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - name: "p" + in: "query" + description: "The page number. Used for pagination. If not provided, the first\ + \ page of results is returned." + required: false + type: "integer" + x-exportParamName: "P" + - name: "s" + in: "query" + description: "Search tasks by task text." + required: false + type: "string" + x-exportParamName: "S" + - name: "sort" + in: "query" + description: "The sorting parameter. Possible values to sort by are priority,\ + \ prioritydesc, priorityasc, duedate, duedatedesc, duedateasc." + required: false + type: "string" + x-exportParamName: "Sort" + - name: "startdate" + in: "query" + description: "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." + required: false + type: "integer" + x-exportParamName: "Startdate" + - name: "enddate" + in: "query" + description: "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." + required: false + type: "integer" + x-exportParamName: "Enddate" + responses: + 200: + description: "The tasks" + schema: + type: "array" + items: + $ref: "#/definitions/models.Task" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] + /tasks/bulk: + post: + tags: + - "task" + summary: "Update a bunch of tasks at once" + description: "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." + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - in: "body" + name: "task" + description: "The task object. Looks like a normal task, the only difference\ + \ is it uses an array of list_ids to update." + required: true + schema: + $ref: "#/definitions/models.BulkTask" + x-exportParamName: "Task" + responses: + 200: + description: "The updated task object." + schema: + $ref: "#/definitions/models.Task" + 400: + description: "Invalid task object provided." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 403: + description: "The user does not have access to the task (aka its list)" + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] + /tasks/{id}: + post: + tags: + - "task" + summary: "Update a task" + description: "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." + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - name: "id" + in: "path" + description: "Task ID" + required: true + type: "integer" + x-exportParamName: "Id" + - in: "body" + name: "task" + description: "The task object" + required: true + schema: + $ref: "#/definitions/models.Task" + x-exportParamName: "Task" + responses: + 200: + description: "The updated task object." + schema: + $ref: "#/definitions/models.Task" + 400: + description: "Invalid task object provided." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 403: + description: "The user does not have access to the task (aka its list)" + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] + delete: + tags: + - "task" + summary: "Delete a task" + description: "Deletes a task from a list. This does not mean \"mark it done\"\ + ." + produces: + - "application/json" + parameters: + - name: "id" + in: "path" + description: "Task ID" + required: true + type: "integer" + x-exportParamName: "Id" + responses: + 200: + description: "The created task object." + schema: + $ref: "#/definitions/models.Message" + 400: + description: "Invalid task ID provided." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 403: + description: "The user does not have access to the list" + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] + /tasks/{id}/attachments: + get: + tags: + - "task" + summary: "Get all attachments for one task." + description: "Get all task attachments for one task." + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - name: "id" + in: "path" + description: "Task ID" + required: true + type: "integer" + x-exportParamName: "Id" + responses: + 200: + description: "All attachments for this task" + schema: + type: "array" + items: + $ref: "#/definitions/models.TaskAttachment" + 403: + description: "No access to this task." + schema: + $ref: "#/definitions/models.Message" + 404: + description: "The task does not exist." + schema: + $ref: "#/definitions/models.Message" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] + put: + tags: + - "task" + summary: "Upload a task attachment" + description: "Upload a task attachment. You can pass multiple files with the\ + \ files form param." + consumes: + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "id" + in: "path" + description: "Task ID" + required: true + type: "integer" + x-exportParamName: "Id" + - name: "files" + in: "formData" + description: "The file, as multipart form file. You can pass multiple." + required: true + type: "string" + x-exportParamName: "Files" + responses: + 200: + description: "Attachments were uploaded successfully." + schema: + $ref: "#/definitions/models.Message" + 403: + description: "No access to the task." + schema: + $ref: "#/definitions/models.Message" + 404: + description: "The task does not exist." + schema: + $ref: "#/definitions/models.Message" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] + /tasks/{id}/attachments/{attachmentID}: + get: + tags: + - "task" + summary: "Get one attachment." + description: "Get one attachment for download. **Returns json on error.**" + produces: + - "application/octet-stream" + parameters: + - name: "id" + in: "path" + description: "Task ID" + required: true + type: "integer" + x-exportParamName: "Id" + - name: "attachmentID" + in: "path" + description: "Attachment ID" + required: true + type: "integer" + x-exportParamName: "AttachmentID" + responses: + 200: + description: "The attachment file." + 403: + description: "No access to this task." + schema: + $ref: "#/definitions/models.Message" + 404: + description: "The task does not exist." + schema: + $ref: "#/definitions/models.Message" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] + delete: + tags: + - "task" + summary: "Delete an attachment" + description: "Delete an attachment." + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - name: "id" + in: "path" + description: "Task ID" + required: true + type: "integer" + x-exportParamName: "Id" + - name: "attachmentID" + in: "path" + description: "Attachment ID" + required: true + type: "integer" + x-exportParamName: "AttachmentID" + responses: + 200: + description: "The attachment was deleted successfully." + schema: + $ref: "#/definitions/models.Message" + 403: + description: "No access to this task." + schema: + $ref: "#/definitions/models.Message" + 404: + description: "The task does not exist." + schema: + $ref: "#/definitions/models.Message" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] + /tasks/{taskID}/assignees: + get: + tags: + - "assignees" + summary: "Get all assignees for a task" + description: "Returns an array with all assignees for this task." + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - name: "p" + in: "query" + description: "The page number. Used for pagination. If not provided, the first\ + \ page of results is returned." + required: false + type: "integer" + x-exportParamName: "P" + - name: "s" + in: "query" + description: "Search assignees by their username." + required: false + type: "string" + x-exportParamName: "S" + - name: "taskID" + in: "path" + description: "Task ID" + required: true + type: "integer" + x-exportParamName: "TaskID" + responses: + 200: + description: "The assignees" + schema: + type: "array" + items: + $ref: "#/definitions/models.User" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] + put: + tags: + - "assignees" + summary: "Add a new assignee to a task" + description: "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." + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - in: "body" + name: "assignee" + description: "The assingee object" + required: true + schema: + $ref: "#/definitions/models.TaskAssginee" + x-exportParamName: "Assignee" + - name: "taskID" + in: "path" + description: "Task ID" + required: true + type: "integer" + x-exportParamName: "TaskID" + responses: + 200: + description: "The created assingee object." + schema: + $ref: "#/definitions/models.TaskAssginee" + 400: + description: "Invalid assignee object provided." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] + /tasks/{taskID}/assignees/bulk: + post: + tags: + - "assignees" + summary: "Add multiple new assignees to a task" + description: "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." + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - in: "body" + name: "assignee" + description: "The array of assignees" + required: true + schema: + $ref: "#/definitions/models.BulkAssignees" + x-exportParamName: "Assignee" + - name: "taskID" + in: "path" + description: "Task ID" + required: true + type: "integer" + x-exportParamName: "TaskID" + responses: + 200: + description: "The created assingees object." + schema: + $ref: "#/definitions/models.TaskAssginee" + 400: + description: "Invalid assignee object provided." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] + /tasks/{taskID}/assignees/{userID}: + delete: + tags: + - "assignees" + summary: "Delete an assignee" + description: "Un-assign a user from a task." + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - name: "taskID" + in: "path" + description: "Task ID" + required: true + type: "integer" + x-exportParamName: "TaskID" + - name: "userID" + in: "path" + description: "Assignee user ID" + required: true + type: "integer" + x-exportParamName: "UserID" + responses: + 200: + description: "The assignee was successfully deleted." + schema: + $ref: "#/definitions/models.Message" + 403: + description: "Not allowed to delete the assignee." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] + /tasks/{taskID}/labels/bulk: + post: + tags: + - "labels" + summary: "Update all labels on a task." + description: "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." + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - in: "body" + name: "label" + description: "The array of labels" + required: true + schema: + $ref: "#/definitions/models.LabelTaskBulk" + x-exportParamName: "Label" + - name: "taskID" + in: "path" + description: "Task ID" + required: true + type: "integer" + x-exportParamName: "TaskID" + responses: + 200: + description: "The updated labels object." + schema: + $ref: "#/definitions/models.LabelTaskBulk" + 400: + description: "Invalid label object provided." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] + /tasks/{taskID}/relations: + put: + tags: + - "task" + summary: "Create a new relation between two tasks" + description: "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." + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - in: "body" + name: "relation" + description: "The relation object" + required: true + schema: + $ref: "#/definitions/models.TaskRelation" + x-exportParamName: "Relation" + - name: "taskID" + in: "path" + description: "Task ID" + required: true + type: "integer" + x-exportParamName: "TaskID" + responses: + 200: + description: "The created task relation object." + schema: + $ref: "#/definitions/models.TaskRelation" + 400: + description: "Invalid task relation object provided." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] + delete: + tags: + - "task" + summary: "Remove a task relation" + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - in: "body" + name: "relation" + description: "The relation object" + required: true + schema: + $ref: "#/definitions/models.TaskRelation" + x-exportParamName: "Relation" + - name: "taskID" + in: "path" + description: "Task ID" + required: true + type: "integer" + x-exportParamName: "TaskID" + responses: + 200: + description: "The task relation was successfully deleted." + schema: + $ref: "#/definitions/models.Message" + 400: + description: "Invalid task relation object provided." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 404: + description: "The task relation was not found." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] + /tasks/{task}/labels: + get: + tags: + - "labels" + summary: "Get all labels on a task" + description: "Returns all labels which are assicociated with a given task." + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - name: "task" + in: "path" + description: "Task ID" + required: true + type: "integer" + x-exportParamName: "Task" + - name: "p" + in: "query" + description: "The page number. Used for pagination. If not provided, the first\ + \ page of results is returned." + required: false + type: "integer" + x-exportParamName: "P" + - name: "s" + in: "query" + description: "Search labels by label text." + required: false + type: "string" + x-exportParamName: "S" + responses: + 200: + description: "The labels" + schema: + type: "array" + items: + $ref: "#/definitions/models.Label" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] + put: + tags: + - "labels" + summary: "Add a label to a task" + description: "Add a label to a task. The user needs to have write-access to\ + \ the list to be able do this." + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - name: "task" + in: "path" + description: "Task ID" + required: true + type: "integer" + x-exportParamName: "Task" + - in: "body" + name: "label" + description: "The label object" + required: true + schema: + $ref: "#/definitions/models.LabelTask" + x-exportParamName: "Label" + responses: + 200: + description: "The created label relation object." + schema: + $ref: "#/definitions/models.LabelTask" + 400: + description: "Invalid label object provided." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 403: + description: "Not allowed to add the label." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 404: + description: "The label does not exist." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] + /tasks/{task}/labels/{label}: + delete: + tags: + - "labels" + summary: "Remove a label from a task" + description: "Remove a label from a task. The user needs to have write-access\ + \ to the list to be able do this." + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - name: "task" + in: "path" + description: "Task ID" + required: true + type: "integer" + x-exportParamName: "Task" + - name: "label" + in: "path" + description: "Label ID" + required: true + type: "integer" + x-exportParamName: "Label" + responses: + 200: + description: "The label was successfully removed." + schema: + $ref: "#/definitions/models.Message" + 403: + description: "Not allowed to remove the label." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 404: + description: "Label not found." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] + /teams: + get: + tags: + - "team" + summary: "Get teams" + description: "Returns all teams the current user is part of." + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - name: "p" + in: "query" + description: "The page number. Used for pagination. If not provided, the first\ + \ page of results is returned." + required: false + type: "integer" + x-exportParamName: "P" + - name: "s" + in: "query" + description: "Search teams by its name." + required: false + type: "string" + x-exportParamName: "S" + responses: + 200: + description: "The teams." + schema: + type: "array" + items: + $ref: "#/definitions/models.Team" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] + put: + tags: + - "team" + summary: "Creates a new team" + description: "Creates a new team in a given namespace. The user needs write-access\ + \ to the namespace." + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - in: "body" + name: "team" + description: "The team you want to create." + required: true + schema: + $ref: "#/definitions/models.Team" + x-exportParamName: "Team" + responses: + 200: + description: "The created team." + schema: + $ref: "#/definitions/models.Team" + 400: + description: "Invalid team object provided." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] + /teams/{id}: + post: + tags: + - "team" + summary: "Updates a team" + description: "Updates a team." + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - name: "id" + in: "path" + description: "Team ID" + required: true + type: "integer" + x-exportParamName: "Id" + - in: "body" + name: "team" + description: "The team with updated values you want to update." + required: true + schema: + $ref: "#/definitions/models.Team" + x-exportParamName: "Team" + responses: + 200: + description: "The updated team." + schema: + $ref: "#/definitions/models.Team" + 400: + description: "Invalid team object provided." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] + delete: + tags: + - "team" + summary: "Deletes a team" + description: "Delets a team. This will also remove the access for all users\ + \ in that team." + produces: + - "application/json" + parameters: + - name: "id" + in: "path" + description: "Team ID" + required: true + type: "integer" + x-exportParamName: "Id" + responses: + 200: + description: "The team was successfully deleted." + schema: + $ref: "#/definitions/models.Message" + 400: + description: "Invalid team object provided." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] + /teams/{id}/members: + put: + tags: + - "team" + summary: "Add a user to a team" + description: "Add a user to a team." + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - name: "id" + in: "path" + description: "Team ID" + required: true + type: "integer" + x-exportParamName: "Id" + - in: "body" + name: "team" + description: "The user to be added to a team." + required: true + schema: + $ref: "#/definitions/models.TeamMember" + x-exportParamName: "Team" + responses: + 200: + description: "The newly created member object" + schema: + $ref: "#/definitions/models.TeamMember" + 400: + description: "Invalid member object provided." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 403: + description: "The user does not have access to the team" + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] + /teams/{id}/members/{userID}: + delete: + tags: + - "team" + summary: "Remove a user from a team" + description: "Remove a user from a team. This will also revoke any access this\ + \ user might have via that team." + produces: + - "application/json" + parameters: + - name: "id" + in: "path" + description: "Team ID" + required: true + type: "integer" + x-exportParamName: "Id" + - name: "userID" + in: "path" + description: "User ID" + required: true + type: "integer" + x-exportParamName: "UserID" + responses: + 200: + description: "The user was successfully removed from the team." + schema: + $ref: "#/definitions/models.Message" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] + /user: + get: + tags: + - "user" + summary: "Get user information" + description: "Returns the current user object." + consumes: + - "application/json" + produces: + - "application/json" + parameters: [] + responses: + 200: + description: "OK" + schema: + $ref: "#/definitions/models.User" + 404: + description: "User does not exist." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 500: + description: "Internal server error." + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] + /user/confirm: + post: + tags: + - "user" + summary: "Confirm the email of a new user" + description: "Confirms the email of a newly registered user." + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - in: "body" + name: "credentials" + description: "The token." + required: true + schema: + $ref: "#/definitions/models.EmailConfirm" + x-exportParamName: "Credentials" + responses: + 200: + description: "OK" + schema: + $ref: "#/definitions/models.Message" + 412: + description: "Bad token provided." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + /user/password: + post: + tags: + - "user" + summary: "Change password" + description: "Lets the current user change its password." + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - in: "body" + name: "userPassword" + description: "The current and new password." + required: true + schema: + $ref: "#/definitions/v1.UserPassword" + x-exportParamName: "UserPassword" + responses: + 200: + description: "OK" + schema: + $ref: "#/definitions/models.Message" + 400: + description: "Something's invalid." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 404: + description: "User does not exist." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 500: + description: "Internal server error." + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] + /user/password/reset: + post: + tags: + - "user" + summary: "Resets a password" + description: "Resets a user email with a previously reset token." + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - in: "body" + name: "credentials" + description: "The token with the new password." + required: true + schema: + $ref: "#/definitions/models.PasswordReset" + x-exportParamName: "Credentials" + responses: + 200: + description: "OK" + schema: + $ref: "#/definitions/models.Message" + 400: + description: "Bad token provided." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + /user/password/token: + post: + tags: + - "user" + summary: "Request password reset token" + description: "Requests a token to reset a users password. The token is sent\ + \ via email." + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - in: "body" + name: "credentials" + description: "The username of the user to request a token for." + required: true + schema: + $ref: "#/definitions/models.PasswordTokenRequest" + x-exportParamName: "Credentials" + responses: + 200: + description: "OK" + schema: + $ref: "#/definitions/models.Message" + 404: + description: "The user does not exist." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 500: + description: "Internal error" + schema: + $ref: "#/definitions/models.Message" + /users: + get: + tags: + - "user" + summary: "Get users" + description: "Lists all users (without emailadresses). Also possible to search\ + \ for a specific user." + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - name: "s" + in: "query" + description: "Search for a user by its name." + required: false + type: "string" + x-exportParamName: "S" + responses: + 200: + description: "All (found) users." + schema: + type: "array" + items: + $ref: "#/definitions/models.User" + 400: + description: "Something's invalid." + schema: + $ref: "#/definitions/code.vikunja.io.web.HTTPError" + 500: + description: "Internal server error." + schema: + $ref: "#/definitions/models.Message" + security: + - JWTKeyAuth: [] +securityDefinitions: + BasicAuth: + type: "basic" + JWTKeyAuth: + type: "apiKey" + name: "Authorization" + in: "header" +definitions: + code.vikunja.io.web.HTTPError: + type: "object" + properties: + code: + type: "integer" + message: + type: "string" + files.File: + type: "object" + properties: + created: + type: "string" + id: + type: "integer" + mime: + type: "string" + name: + type: "string" + size: + type: "integer" + example: + size: 5 + created: "created" + mime: "mime" + name: "name" + id: 5 + models.APIUserPassword: + type: "object" + properties: + email: + type: "string" + description: "The user's email address" + maxLength: 250 + id: + type: "integer" + description: "The unique, numeric id of this user." + password: + type: "string" + description: "The user's password in clear text. Only used when registering\ + \ the user." + minLength: 8 + maxLength: 250 + username: + type: "string" + description: "The username of the username. Is always unique." + minLength: 3 + maxLength: 250 + models.BulkAssignees: + type: "object" + properties: + assignees: + type: "array" + description: "A list with all assignees" + items: + $ref: "#/definitions/models.User" + models.BulkTask: + type: "object" + properties: + assignees: + type: "array" + description: "An array of users who are assigned to this task" + items: + $ref: "#/definitions/models.User" + attachments: + type: "array" + description: "All attachments this task has" + items: + $ref: "#/definitions/models.TaskAttachment" + created: + type: "integer" + description: "A unix timestamp when this task was created. You cannot change\ + \ this value." + createdBy: + description: "The user who initially created the task." + $ref: "#/definitions/models.User" + description: + type: "string" + description: "The task description." + done: + type: "boolean" + description: "Whether a task is done or not." + doneAt: + type: "integer" + description: "The unix timestamp when a task was marked as done." + dueDate: + type: "integer" + description: "A unix timestamp when the task is due." + endDate: + type: "integer" + description: "When this task ends." + hexColor: + type: "string" + description: "The task color in hex" + maxLength: 6 + id: + type: "integer" + description: "The unique, numeric id of this task." + labels: + type: "array" + description: "An array of labels which are associated with this task." + items: + $ref: "#/definitions/models.Label" + listID: + type: "integer" + description: "The list this task belongs to." + percentDone: + type: "number" + description: "Determines how far a task is left from being done" + priority: + type: "integer" + description: "The task priority. Can be anything you want, it is possible\ + \ to sort by this later." + related_tasks: + description: "All related tasks, grouped by their relation kind" + $ref: "#/definitions/models.RelatedTaskMap" + reminderDates: + type: "array" + description: "An array of unix timestamps when the user wants to be reminded\ + \ of the task." + items: + type: "integer" + repeatAfter: + type: "integer" + description: "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." + startDate: + type: "integer" + description: "When this task starts." + task_ids: + type: "array" + description: "A list of task ids to update" + items: + type: "integer" + text: + type: "string" + description: "The task text. This is what you'll see in the list." + minLength: 3 + maxLength: 250 + updated: + type: "integer" + description: "A unix timestamp when this task was last updated. You cannot\ + \ change this value." + models.EmailConfirm: + type: "object" + properties: + token: + type: "string" + description: "The email confirm token sent via email." + models.Label: + type: "object" + properties: + created: + type: "integer" + description: "A unix timestamp when this label was created. You cannot change\ + \ this value." + created_by: + description: "The user who created this label" + $ref: "#/definitions/models.User" + description: + type: "string" + description: "The label description." + hex_color: + type: "string" + description: "The color this label has" + maxLength: 6 + id: + type: "integer" + description: "The unique, numeric id of this label." + title: + type: "string" + description: "The title of the lable. You'll see this one on tasks associated\ + \ with it." + minLength: 3 + maxLength: 250 + updated: + type: "integer" + description: "A unix timestamp when this label was last updated. You cannot\ + \ change this value." + example: + created: 0 + description: "description" + id: 5 + hex_color: "hex_color" + title: "title" + created_by: + avatarUrl: "avatarUrl" + created: 6 + id: 1 + updated: 5 + email: "email" + username: "username" + updated: 2 + models.LabelTask: + type: "object" + properties: + created: + type: "integer" + description: "A unix timestamp when this task was created. You cannot change\ + \ this value." + label_id: + type: "integer" + description: "The label id you want to associate with a task." + example: + created: 0 + label_id: 6 + models.LabelTaskBulk: + type: "object" + properties: + labels: + type: "array" + description: "All labels you want to update at once." + items: + $ref: "#/definitions/models.Label" + example: + labels: + - created: 0 + description: "description" + id: 5 + hex_color: "hex_color" + title: "title" + created_by: + avatarUrl: "avatarUrl" + created: 6 + id: 1 + updated: 5 + email: "email" + username: "username" + updated: 2 + - created: 0 + description: "description" + id: 5 + hex_color: "hex_color" + title: "title" + created_by: + avatarUrl: "avatarUrl" + created: 6 + id: 1 + updated: 5 + email: "email" + username: "username" + updated: 2 + models.LinkSharing: + type: "object" + properties: + created: + type: "integer" + description: "A unix timestamp when this list was shared. You cannot change\ + \ this value." + hash: + type: "string" + description: "The public id to get this shared list" + id: + type: "integer" + description: "The ID of the shared thing" + right: + type: "integer" + description: "The right this list is shared with. 0 = Read only, 1 = Read\ + \ & Write, 2 = Admin. See the docs for more details." + maximum: 2 + shared_by: + description: "The user who shared this list" + $ref: "#/definitions/models.User" + sharing_type: + type: "integer" + description: "The kind of this link. 0 = undefined, 1 = without password,\ + \ 2 = with password (currently not implemented)." + maximum: 2 + updated: + type: "integer" + description: "A unix timestamp when this share was last updated. You cannot\ + \ change this value." + example: + created: 0 + shared_by: + avatarUrl: "avatarUrl" + created: 6 + id: 1 + updated: 5 + email: "email" + username: "username" + id: 6 + right: 0 + sharing_type: 1 + updated: 5 + hash: "hash" + models.List: + type: "object" + properties: + created: + type: "integer" + description: "A unix timestamp when this list was created. You cannot change\ + \ this value." + description: + type: "string" + description: "The description of the list." + id: + type: "integer" + description: "The unique, numeric id of this list." + owner: + description: "The user who created this list." + $ref: "#/definitions/models.User" + tasks: + type: "array" + description: "An array of tasks which belong to the list." + items: + $ref: "#/definitions/models.Task" + title: + type: "string" + description: "The title of the list. You'll see this in the namespace overview." + minLength: 3 + maxLength: 250 + updated: + type: "integer" + description: "A unix timestamp when this list was last updated. You cannot\ + \ change this value." + example: + owner: + avatarUrl: "avatarUrl" + created: 6 + id: 1 + updated: 5 + email: "email" + username: "username" + created: 0 + description: "description" + id: 6 + title: "title" + updated: 5 + tasks: + - doneAt: 3 + attachments: + - file: + size: 5 + created: "created" + mime: "mime" + name: "name" + id: 5 + created: 1 + task_id: 7 + id: 2 + created_by: + avatarUrl: "avatarUrl" + created: 6 + id: 1 + updated: 5 + email: "email" + username: "username" + - file: + size: 5 + created: "created" + mime: "mime" + name: "name" + id: 5 + created: 1 + task_id: 7 + id: 2 + created_by: + avatarUrl: "avatarUrl" + created: 6 + id: 1 + updated: 5 + email: "email" + username: "username" + percentDone: 1.024645700144157789424070870154537260532379150390625 + endDate: 4 + created: 9 + reminderDates: + - 6 + - 6 + dueDate: 2 + assignees: + - avatarUrl: "avatarUrl" + created: 6 + id: 1 + updated: 5 + email: "email" + username: "username" + - avatarUrl: "avatarUrl" + created: 6 + id: 1 + updated: 5 + email: "email" + username: "username" + description: "description" + related_tasks: {} + repeatAfter: 7 + priority: 1 + done: true + labels: + - created: 0 + description: "description" + id: 5 + hex_color: "hex_color" + title: "title" + created_by: + avatarUrl: "avatarUrl" + created: 6 + id: 1 + updated: 5 + email: "email" + username: "username" + updated: 2 + - created: 0 + description: "description" + id: 5 + hex_color: "hex_color" + title: "title" + created_by: + avatarUrl: "avatarUrl" + created: 6 + id: 1 + updated: 5 + email: "email" + username: "username" + updated: 2 + listID: 1 + hexColor: "hexColor" + createdBy: + avatarUrl: "avatarUrl" + created: 6 + id: 1 + updated: 5 + email: "email" + username: "username" + id: 7 + text: "text" + updated: 4 + startDate: 1 + - doneAt: 3 + attachments: + - file: + size: 5 + created: "created" + mime: "mime" + name: "name" + id: 5 + created: 1 + task_id: 7 + id: 2 + created_by: + avatarUrl: "avatarUrl" + created: 6 + id: 1 + updated: 5 + email: "email" + username: "username" + - file: + size: 5 + created: "created" + mime: "mime" + name: "name" + id: 5 + created: 1 + task_id: 7 + id: 2 + created_by: + avatarUrl: "avatarUrl" + created: 6 + id: 1 + updated: 5 + email: "email" + username: "username" + percentDone: 1.024645700144157789424070870154537260532379150390625 + endDate: 4 + created: 9 + reminderDates: + - 6 + - 6 + dueDate: 2 + assignees: + - avatarUrl: "avatarUrl" + created: 6 + id: 1 + updated: 5 + email: "email" + username: "username" + - avatarUrl: "avatarUrl" + created: 6 + id: 1 + updated: 5 + email: "email" + username: "username" + description: "description" + related_tasks: {} + repeatAfter: 7 + priority: 1 + done: true + labels: + - created: 0 + description: "description" + id: 5 + hex_color: "hex_color" + title: "title" + created_by: + avatarUrl: "avatarUrl" + created: 6 + id: 1 + updated: 5 + email: "email" + username: "username" + updated: 2 + - created: 0 + description: "description" + id: 5 + hex_color: "hex_color" + title: "title" + created_by: + avatarUrl: "avatarUrl" + created: 6 + id: 1 + updated: 5 + email: "email" + username: "username" + updated: 2 + listID: 1 + hexColor: "hexColor" + createdBy: + avatarUrl: "avatarUrl" + created: 6 + id: 1 + updated: 5 + email: "email" + username: "username" + id: 7 + text: "text" + updated: 4 + startDate: 1 + models.ListUser: + type: "object" + properties: + created: + type: "integer" + description: "A unix timestamp when this relation was created. You cannot\ + \ change this value." + id: + type: "integer" + description: "The unique, numeric id of this list <-> user relation." + right: + type: "integer" + description: "The right this user has. 0 = Read only, 1 = Read & Write, 2\ + \ = Admin. See the docs for more details." + maximum: 2 + updated: + type: "integer" + description: "A unix timestamp when this relation was last updated. You cannot\ + \ change this value." + userID: + type: "string" + description: "The username." + example: + created: 0 + id: 6 + right: 0 + updated: 5 + userID: "userID" + models.Message: + type: "object" + properties: + message: + type: "string" + description: "A standard message." + example: + message: "message" + models.Namespace: + type: "object" + properties: + created: + type: "integer" + description: "A unix timestamp when this namespace was created. You cannot\ + \ change this value." + description: + type: "string" + description: "The description of the namespace" + id: + type: "integer" + description: "The unique, numeric id of this namespace." + name: + type: "string" + description: "The name of this namespace." + minLength: 5 + maxLength: 250 + owner: + description: "The user who owns this namespace" + $ref: "#/definitions/models.User" + updated: + type: "integer" + description: "A unix timestamp when this namespace was last updated. You cannot\ + \ change this value." + example: + owner: + avatarUrl: "avatarUrl" + created: 6 + id: 1 + updated: 5 + email: "email" + username: "username" + created: 0 + name: "name" + description: "description" + id: 6 + updated: 1 + models.NamespaceUser: + type: "object" + properties: + created: + type: "integer" + description: "A unix timestamp when this relation was created. You cannot\ + \ change this value." + id: + type: "integer" + description: "The unique, numeric id of this namespace <-> user relation." + right: + type: "integer" + description: "The right this user has. 0 = Read only, 1 = Read & Write, 2\ + \ = Admin. See the docs for more details." + maximum: 2 + updated: + type: "integer" + description: "A unix timestamp when this relation was last updated. You cannot\ + \ change this value." + userID: + type: "string" + description: "The username." + example: + created: 0 + id: 6 + right: 0 + updated: 5 + userID: "userID" + models.NamespaceWithLists: + type: "object" + properties: + created: + type: "integer" + description: "A unix timestamp when this namespace was created. You cannot\ + \ change this value." + description: + type: "string" + description: "The description of the namespace" + id: + type: "integer" + description: "The unique, numeric id of this namespace." + lists: + type: "array" + items: + $ref: "#/definitions/models.List" + name: + type: "string" + description: "The name of this namespace." + minLength: 5 + maxLength: 250 + owner: + description: "The user who owns this namespace" + $ref: "#/definitions/models.User" + updated: + type: "integer" + description: "A unix timestamp when this namespace was last updated. You cannot\ + \ change this value." + example: + owner: + avatarUrl: "avatarUrl" + created: 6 + id: 1 + updated: 5 + email: "email" + username: "username" + created: 0 + lists: + - owner: + avatarUrl: "avatarUrl" + created: 6 + id: 1 + updated: 5 + email: "email" + username: "username" + created: 0 + description: "description" + id: 6 + title: "title" + updated: 5 + tasks: + - doneAt: 3 + attachments: + - file: + size: 5 + created: "created" + mime: "mime" + name: "name" + id: 5 + created: 1 + task_id: 7 + id: 2 + created_by: + avatarUrl: "avatarUrl" + created: 6 + id: 1 + updated: 5 + email: "email" + username: "username" + - file: + size: 5 + created: "created" + mime: "mime" + name: "name" + id: 5 + created: 1 + task_id: 7 + id: 2 + created_by: + avatarUrl: "avatarUrl" + created: 6 + id: 1 + updated: 5 + email: "email" + username: "username" + percentDone: 1.024645700144157789424070870154537260532379150390625 + endDate: 4 + created: 9 + reminderDates: + - 6 + - 6 + dueDate: 2 + assignees: + - avatarUrl: "avatarUrl" + created: 6 + id: 1 + updated: 5 + email: "email" + username: "username" + - avatarUrl: "avatarUrl" + created: 6 + id: 1 + updated: 5 + email: "email" + username: "username" + description: "description" + related_tasks: {} + repeatAfter: 7 + priority: 1 + done: true + labels: + - created: 0 + description: "description" + id: 5 + hex_color: "hex_color" + title: "title" + created_by: + avatarUrl: "avatarUrl" + created: 6 + id: 1 + updated: 5 + email: "email" + username: "username" + updated: 2 + - created: 0 + description: "description" + id: 5 + hex_color: "hex_color" + title: "title" + created_by: + avatarUrl: "avatarUrl" + created: 6 + id: 1 + updated: 5 + email: "email" + username: "username" + updated: 2 + listID: 1 + hexColor: "hexColor" + createdBy: + avatarUrl: "avatarUrl" + created: 6 + id: 1 + updated: 5 + email: "email" + username: "username" + id: 7 + text: "text" + updated: 4 + startDate: 1 + - doneAt: 3 + attachments: + - file: + size: 5 + created: "created" + mime: "mime" + name: "name" + id: 5 + created: 1 + task_id: 7 + id: 2 + created_by: + avatarUrl: "avatarUrl" + created: 6 + id: 1 + updated: 5 + email: "email" + username: "username" + - file: + size: 5 + created: "created" + mime: "mime" + name: "name" + id: 5 + created: 1 + task_id: 7 + id: 2 + created_by: + avatarUrl: "avatarUrl" + created: 6 + id: 1 + updated: 5 + email: "email" + username: "username" + percentDone: 1.024645700144157789424070870154537260532379150390625 + endDate: 4 + created: 9 + reminderDates: + - 6 + - 6 + dueDate: 2 + assignees: + - avatarUrl: "avatarUrl" + created: 6 + id: 1 + updated: 5 + email: "email" + username: "username" + - avatarUrl: "avatarUrl" + created: 6 + id: 1 + updated: 5 + email: "email" + username: "username" + description: "description" + related_tasks: {} + repeatAfter: 7 + priority: 1 + done: true + labels: + - created: 0 + description: "description" + id: 5 + hex_color: "hex_color" + title: "title" + created_by: + avatarUrl: "avatarUrl" + created: 6 + id: 1 + updated: 5 + email: "email" + username: "username" + updated: 2 + - created: 0 + description: "description" + id: 5 + hex_color: "hex_color" + title: "title" + created_by: + avatarUrl: "avatarUrl" + created: 6 + id: 1 + updated: 5 + email: "email" + username: "username" + updated: 2 + listID: 1 + hexColor: "hexColor" + createdBy: + avatarUrl: "avatarUrl" + created: 6 + id: 1 + updated: 5 + email: "email" + username: "username" + id: 7 + text: "text" + updated: 4 + startDate: 1 + - owner: + avatarUrl: "avatarUrl" + created: 6 + id: 1 + updated: 5 + email: "email" + username: "username" + created: 0 + description: "description" + id: 6 + title: "title" + updated: 5 + tasks: + - doneAt: 3 + attachments: + - file: + size: 5 + created: "created" + mime: "mime" + name: "name" + id: 5 + created: 1 + task_id: 7 + id: 2 + created_by: + avatarUrl: "avatarUrl" + created: 6 + id: 1 + updated: 5 + email: "email" + username: "username" + - file: + size: 5 + created: "created" + mime: "mime" + name: "name" + id: 5 + created: 1 + task_id: 7 + id: 2 + created_by: + avatarUrl: "avatarUrl" + created: 6 + id: 1 + updated: 5 + email: "email" + username: "username" + percentDone: 1.024645700144157789424070870154537260532379150390625 + endDate: 4 + created: 9 + reminderDates: + - 6 + - 6 + dueDate: 2 + assignees: + - avatarUrl: "avatarUrl" + created: 6 + id: 1 + updated: 5 + email: "email" + username: "username" + - avatarUrl: "avatarUrl" + created: 6 + id: 1 + updated: 5 + email: "email" + username: "username" + description: "description" + related_tasks: {} + repeatAfter: 7 + priority: 1 + done: true + labels: + - created: 0 + description: "description" + id: 5 + hex_color: "hex_color" + title: "title" + created_by: + avatarUrl: "avatarUrl" + created: 6 + id: 1 + updated: 5 + email: "email" + username: "username" + updated: 2 + - created: 0 + description: "description" + id: 5 + hex_color: "hex_color" + title: "title" + created_by: + avatarUrl: "avatarUrl" + created: 6 + id: 1 + updated: 5 + email: "email" + username: "username" + updated: 2 + listID: 1 + hexColor: "hexColor" + createdBy: + avatarUrl: "avatarUrl" + created: 6 + id: 1 + updated: 5 + email: "email" + username: "username" + id: 7 + text: "text" + updated: 4 + startDate: 1 + - doneAt: 3 + attachments: + - file: + size: 5 + created: "created" + mime: "mime" + name: "name" + id: 5 + created: 1 + task_id: 7 + id: 2 + created_by: + avatarUrl: "avatarUrl" + created: 6 + id: 1 + updated: 5 + email: "email" + username: "username" + - file: + size: 5 + created: "created" + mime: "mime" + name: "name" + id: 5 + created: 1 + task_id: 7 + id: 2 + created_by: + avatarUrl: "avatarUrl" + created: 6 + id: 1 + updated: 5 + email: "email" + username: "username" + percentDone: 1.024645700144157789424070870154537260532379150390625 + endDate: 4 + created: 9 + reminderDates: + - 6 + - 6 + dueDate: 2 + assignees: + - avatarUrl: "avatarUrl" + created: 6 + id: 1 + updated: 5 + email: "email" + username: "username" + - avatarUrl: "avatarUrl" + created: 6 + id: 1 + updated: 5 + email: "email" + username: "username" + description: "description" + related_tasks: {} + repeatAfter: 7 + priority: 1 + done: true + labels: + - created: 0 + description: "description" + id: 5 + hex_color: "hex_color" + title: "title" + created_by: + avatarUrl: "avatarUrl" + created: 6 + id: 1 + updated: 5 + email: "email" + username: "username" + updated: 2 + - created: 0 + description: "description" + id: 5 + hex_color: "hex_color" + title: "title" + created_by: + avatarUrl: "avatarUrl" + created: 6 + id: 1 + updated: 5 + email: "email" + username: "username" + updated: 2 + listID: 1 + hexColor: "hexColor" + createdBy: + avatarUrl: "avatarUrl" + created: 6 + id: 1 + updated: 5 + email: "email" + username: "username" + id: 7 + text: "text" + updated: 4 + startDate: 1 + name: "name" + description: "description" + id: 6 + updated: 1 + models.PasswordReset: + type: "object" + properties: + new_password: + type: "string" + description: "The new password for this user." + token: + type: "string" + description: "The previously issued reset token." + models.PasswordTokenRequest: + type: "object" + properties: + email: + type: "string" + maxLength: 250 + models.RelatedTaskMap: + type: "object" + additionalProperties: + type: "array" + items: + type: "object" + properties: + assignees: + type: "array" + description: "An array of users who are assigned to this task" + items: + $ref: "#/definitions/models.User" + attachments: + type: "array" + description: "All attachments this task has" + items: + $ref: "#/definitions/models.TaskAttachment" + created: + type: "integer" + description: "A unix timestamp when this task was created. You cannot\ + \ change this value." + createdBy: + description: "The user who initially created the task." + $ref: "#/definitions/models.User" + description: + type: "string" + description: "The task description." + done: + type: "boolean" + description: "Whether a task is done or not." + doneAt: + type: "integer" + description: "The unix timestamp when a task was marked as done." + dueDate: + type: "integer" + description: "A unix timestamp when the task is due." + endDate: + type: "integer" + description: "When this task ends." + hexColor: + type: "string" + description: "The task color in hex" + maxLength: 6 + id: + type: "integer" + description: "The unique, numeric id of this task." + labels: + type: "array" + description: "An array of labels which are associated with this task." + items: + $ref: "#/definitions/models.Label" + listID: + type: "integer" + description: "The list this task belongs to." + percentDone: + type: "number" + description: "Determines how far a task is left from being done" + priority: + type: "integer" + description: "The task priority. Can be anything you want, it is possible\ + \ to sort by this later." + related_tasks: + description: "All related tasks, grouped by their relation kind" + $ref: "#/definitions/models.RelatedTaskMap" + reminderDates: + type: "array" + description: "An array of unix timestamps when the user wants to be reminded\ + \ of the task." + items: + type: "integer" + repeatAfter: + type: "integer" + description: "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." + startDate: + type: "integer" + description: "When this task starts." + text: + type: "string" + description: "The task text. This is what you'll see in the list." + minLength: 3 + maxLength: 250 + updated: + type: "integer" + description: "A unix timestamp when this task was last updated. You cannot\ + \ change this value." + models.Task: + type: "object" + properties: + assignees: + type: "array" + description: "An array of users who are assigned to this task" + items: + $ref: "#/definitions/models.User" + attachments: + type: "array" + description: "All attachments this task has" + items: + $ref: "#/definitions/models.TaskAttachment" + created: + type: "integer" + description: "A unix timestamp when this task was created. You cannot change\ + \ this value." + createdBy: + description: "The user who initially created the task." + $ref: "#/definitions/models.User" + description: + type: "string" + description: "The task description." + done: + type: "boolean" + description: "Whether a task is done or not." + doneAt: + type: "integer" + description: "The unix timestamp when a task was marked as done." + dueDate: + type: "integer" + description: "A unix timestamp when the task is due." + endDate: + type: "integer" + description: "When this task ends." + hexColor: + type: "string" + description: "The task color in hex" + maxLength: 6 + id: + type: "integer" + description: "The unique, numeric id of this task." + labels: + type: "array" + description: "An array of labels which are associated with this task." + items: + $ref: "#/definitions/models.Label" + listID: + type: "integer" + description: "The list this task belongs to." + percentDone: + type: "number" + description: "Determines how far a task is left from being done" + priority: + type: "integer" + description: "The task priority. Can be anything you want, it is possible\ + \ to sort by this later." + related_tasks: + description: "All related tasks, grouped by their relation kind" + $ref: "#/definitions/models.RelatedTaskMap" + reminderDates: + type: "array" + description: "An array of unix timestamps when the user wants to be reminded\ + \ of the task." + items: + type: "integer" + repeatAfter: + type: "integer" + description: "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." + startDate: + type: "integer" + description: "When this task starts." + text: + type: "string" + description: "The task text. This is what you'll see in the list." + minLength: 3 + maxLength: 250 + updated: + type: "integer" + description: "A unix timestamp when this task was last updated. You cannot\ + \ change this value." + example: + doneAt: 3 + attachments: + - file: + size: 5 + created: "created" + mime: "mime" + name: "name" + id: 5 + created: 1 + task_id: 7 + id: 2 + created_by: + avatarUrl: "avatarUrl" + created: 6 + id: 1 + updated: 5 + email: "email" + username: "username" + - file: + size: 5 + created: "created" + mime: "mime" + name: "name" + id: 5 + created: 1 + task_id: 7 + id: 2 + created_by: + avatarUrl: "avatarUrl" + created: 6 + id: 1 + updated: 5 + email: "email" + username: "username" + percentDone: 1.024645700144157789424070870154537260532379150390625 + endDate: 4 + created: 9 + reminderDates: + - 6 + - 6 + dueDate: 2 + assignees: + - avatarUrl: "avatarUrl" + created: 6 + id: 1 + updated: 5 + email: "email" + username: "username" + - avatarUrl: "avatarUrl" + created: 6 + id: 1 + updated: 5 + email: "email" + username: "username" + description: "description" + related_tasks: {} + repeatAfter: 7 + priority: 1 + done: true + labels: + - created: 0 + description: "description" + id: 5 + hex_color: "hex_color" + title: "title" + created_by: + avatarUrl: "avatarUrl" + created: 6 + id: 1 + updated: 5 + email: "email" + username: "username" + updated: 2 + - created: 0 + description: "description" + id: 5 + hex_color: "hex_color" + title: "title" + created_by: + avatarUrl: "avatarUrl" + created: 6 + id: 1 + updated: 5 + email: "email" + username: "username" + updated: 2 + listID: 1 + hexColor: "hexColor" + createdBy: + avatarUrl: "avatarUrl" + created: 6 + id: 1 + updated: 5 + email: "email" + username: "username" + id: 7 + text: "text" + updated: 4 + startDate: 1 + models.TaskAssginee: + type: "object" + properties: + created: + type: "integer" + user_id: + type: "integer" + example: + user_id: 6 + created: 0 + models.TaskAttachment: + type: "object" + properties: + created: + type: "integer" + created_by: + $ref: "#/definitions/models.User" + file: + $ref: "#/definitions/files.File" + id: + type: "integer" + task_id: + type: "integer" + example: + file: + size: 5 + created: "created" + mime: "mime" + name: "name" + id: 5 + created: 1 + task_id: 7 + id: 2 + created_by: + avatarUrl: "avatarUrl" + created: 6 + id: 1 + updated: 5 + email: "email" + username: "username" + models.TaskRelation: + type: "object" + properties: + created: + type: "integer" + description: "A unix timestamp when this label was created. You cannot change\ + \ this value." + created_by: + description: "The user who created this relation" + $ref: "#/definitions/models.User" + other_task_id: + type: "integer" + description: "The ID of the other task, the task which is being related." + relation_kind: + type: "string" + description: "The kind of the relation." + task_id: + type: "integer" + description: "The ID of the \"base\" task, the task which has a relation to\ + \ another." + example: + created: 0 + relation_kind: "relation_kind" + task_id: 1 + created_by: + avatarUrl: "avatarUrl" + created: 6 + id: 1 + updated: 5 + email: "email" + username: "username" + other_task_id: 6 + models.Team: + type: "object" + properties: + created: + type: "integer" + description: "A unix timestamp when this relation was created. You cannot\ + \ change this value." + createdBy: + description: "The user who created this team." + $ref: "#/definitions/models.User" + description: + type: "string" + description: "The team's description." + id: + type: "integer" + description: "The unique, numeric id of this team." + members: + type: "array" + description: "An array of all members in this team." + items: + $ref: "#/definitions/models.TeamUser" + name: + type: "string" + description: "The name of this team." + minLength: 5 + maxLength: 250 + updated: + type: "integer" + description: "A unix timestamp when this relation was last updated. You cannot\ + \ change this value." + example: + createdBy: + avatarUrl: "avatarUrl" + created: 6 + id: 1 + updated: 5 + email: "email" + username: "username" + created: 0 + members: + - avatarUrl: "avatarUrl" + created: 1 + admin: true + id: 5 + updated: 5 + email: "email" + username: "username" + - avatarUrl: "avatarUrl" + created: 1 + admin: true + id: 5 + updated: 5 + email: "email" + username: "username" + name: "name" + description: "description" + id: 6 + updated: 1 + models.TeamList: + type: "object" + properties: + created: + type: "integer" + description: "A unix timestamp when this relation was created. You cannot\ + \ change this value." + id: + type: "integer" + description: "The unique, numeric id of this list <-> team relation." + right: + type: "integer" + description: "The right this team has. 0 = Read only, 1 = Read & Write, 2\ + \ = Admin. See the docs for more details." + maximum: 2 + teamID: + type: "integer" + description: "The team id." + updated: + type: "integer" + description: "A unix timestamp when this relation was last updated. You cannot\ + \ change this value." + example: + created: 0 + teamID: 5 + id: 6 + right: 0 + updated: 5 + models.TeamMember: + type: "object" + properties: + admin: + type: "boolean" + description: "Whether or not the member is an admin of the team. See the docs\ + \ for more about what a team admin can do" + created: + type: "integer" + description: "A unix timestamp when this relation was created. You cannot\ + \ change this value." + id: + type: "integer" + description: "The unique, numeric id of this team member relation." + username: + type: "string" + description: "The username of the member. We use this to prevent automated\ + \ user id entering." + example: + created: 0 + admin: true + id: 6 + username: "username" + models.TeamNamespace: + type: "object" + properties: + created: + type: "integer" + description: "A unix timestamp when this relation was created. You cannot\ + \ change this value." + id: + type: "integer" + description: "The unique, numeric id of this namespace <-> team relation." + right: + type: "integer" + description: "The right this team has. 0 = Read only, 1 = Read & Write, 2\ + \ = Admin. See the docs for more details." + maximum: 2 + teamID: + type: "integer" + description: "The team id." + updated: + type: "integer" + description: "A unix timestamp when this relation was last updated. You cannot\ + \ change this value." + example: + created: 0 + teamID: 5 + id: 6 + right: 0 + updated: 5 + models.TeamUser: + type: "object" + properties: + admin: + type: "boolean" + description: "Whether or not the member is an admin of the team. See the docs\ + \ for more about what a team admin can do" + avatarUrl: + type: "string" + description: "The users md5-hashed email address, used to get the avatar from\ + \ gravatar and the likes." + created: + type: "integer" + description: "A unix timestamp when this task was created. You cannot change\ + \ this value." + email: + type: "string" + description: "The user's email address." + maxLength: 250 + id: + type: "integer" + description: "The unique, numeric id of this user." + updated: + type: "integer" + description: "A unix timestamp when this task was last updated. You cannot\ + \ change this value." + username: + type: "string" + description: "The username of the user. Is always unique." + minLength: 3 + maxLength: 250 + example: + avatarUrl: "avatarUrl" + created: 1 + admin: true + id: 5 + updated: 5 + email: "email" + username: "username" + models.TeamWithRight: + type: "object" + properties: + created: + type: "integer" + description: "A unix timestamp when this relation was created. You cannot\ + \ change this value." + createdBy: + description: "The user who created this team." + $ref: "#/definitions/models.User" + description: + type: "string" + description: "The team's description." + id: + type: "integer" + description: "The unique, numeric id of this team." + members: + type: "array" + description: "An array of all members in this team." + items: + $ref: "#/definitions/models.TeamUser" + name: + type: "string" + description: "The name of this team." + minLength: 5 + maxLength: 250 + right: + type: "integer" + updated: + type: "integer" + description: "A unix timestamp when this relation was last updated. You cannot\ + \ change this value." + example: + createdBy: + avatarUrl: "avatarUrl" + created: 6 + id: 1 + updated: 5 + email: "email" + username: "username" + created: 0 + members: + - avatarUrl: "avatarUrl" + created: 1 + admin: true + id: 5 + updated: 5 + email: "email" + username: "username" + - avatarUrl: "avatarUrl" + created: 1 + admin: true + id: 5 + updated: 5 + email: "email" + username: "username" + name: "name" + description: "description" + id: 6 + right: 2 + updated: 7 + models.User: + type: "object" + properties: + avatarUrl: + type: "string" + description: "The users md5-hashed email address, used to get the avatar from\ + \ gravatar and the likes." + created: + type: "integer" + description: "A unix timestamp when this task was created. You cannot change\ + \ this value." + email: + type: "string" + description: "The user's email address." + maxLength: 250 + id: + type: "integer" + description: "The unique, numeric id of this user." + updated: + type: "integer" + description: "A unix timestamp when this task was last updated. You cannot\ + \ change this value." + username: + type: "string" + description: "The username of the user. Is always unique." + minLength: 3 + maxLength: 250 + example: + avatarUrl: "avatarUrl" + created: 6 + id: 1 + updated: 5 + email: "email" + username: "username" + models.UserLogin: + type: "object" + properties: + password: + type: "string" + description: "The password for the user." + username: + type: "string" + description: "The username used to log in." + models.UserWithRight: + type: "object" + properties: + avatarUrl: + type: "string" + description: "The users md5-hashed email address, used to get the avatar from\ + \ gravatar and the likes." + created: + type: "integer" + description: "A unix timestamp when this task was created. You cannot change\ + \ this value." + email: + type: "string" + description: "The user's email address." + maxLength: 250 + id: + type: "integer" + description: "The unique, numeric id of this user." + right: + type: "integer" + updated: + type: "integer" + description: "A unix timestamp when this task was last updated. You cannot\ + \ change this value." + username: + type: "string" + description: "The username of the user. Is always unique." + minLength: 3 + maxLength: 250 + example: + avatarUrl: "avatarUrl" + created: 0 + id: 6 + right: 1 + updated: 5 + email: "email" + username: "username" + v1.Token: + type: "object" + properties: + token: + type: "string" + example: + token: "token" + v1.UserPassword: + type: "object" + properties: + new_password: + type: "string" + old_password: + type: "string" + v1.vikunjaInfos: + type: "object" + properties: + frontend_url: + type: "string" + link_sharing_enabled: + type: "boolean" + max_file_size: + type: "integer" + motd: + type: "string" + version: + type: "string" + example: + link_sharing_enabled: true + max_file_size: 0 + motd: "motd" + frontend_url: "frontend_url" + version: "version" diff --git a/api_client.go b/api_client.go new file mode 100644 index 0000000..2eb1a0b --- /dev/null +++ b/api_client.go @@ -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. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. + * + * 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) +} + diff --git a/api_response.go b/api_response.go new file mode 100644 index 0000000..5ee0c7c --- /dev/null +++ b/api_response.go @@ -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. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. + * + * 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 +} diff --git a/assignees_api.go b/assignees_api.go new file mode 100644 index 0000000..c7bec58 --- /dev/null +++ b/assignees_api.go @@ -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. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. + * + * 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 +} + diff --git a/code_vikunja_io_web_http_error.go b/code_vikunja_io_web_http_error.go new file mode 100644 index 0000000..693cab7 --- /dev/null +++ b/code_vikunja_io_web_http_error.go @@ -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. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. + * + * 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"` +} diff --git a/configuration.go b/configuration.go new file mode 100644 index 0000000..ef0b7ba --- /dev/null +++ b/configuration.go @@ -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. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. + * + * 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 +} \ No newline at end of file diff --git a/docs/AssigneesApi.md b/docs/AssigneesApi.md new file mode 100644 index 0000000..e47fe1b --- /dev/null +++ b/docs/AssigneesApi.md @@ -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) + diff --git a/docs/CodeVikunjaIoWebHttpError.md b/docs/CodeVikunjaIoWebHttpError.md new file mode 100644 index 0000000..727d76a --- /dev/null +++ b/docs/CodeVikunjaIoWebHttpError.md @@ -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) + + diff --git a/docs/FilesFile.md b/docs/FilesFile.md new file mode 100644 index 0000000..7798c34 --- /dev/null +++ b/docs/FilesFile.md @@ -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) + + diff --git a/docs/LabelsApi.md b/docs/LabelsApi.md new file mode 100644 index 0000000..0dfdc1e --- /dev/null +++ b/docs/LabelsApi.md @@ -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) + diff --git a/docs/ListApi.md b/docs/ListApi.md new file mode 100644 index 0000000..f086f57 --- /dev/null +++ b/docs/ListApi.md @@ -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) + diff --git a/docs/ModelsApiUserPassword.md b/docs/ModelsApiUserPassword.md new file mode 100644 index 0000000..2cce60d --- /dev/null +++ b/docs/ModelsApiUserPassword.md @@ -0,0 +1,13 @@ +# ModelsApiUserPassword + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Email** | **string** | The user's email address | [optional] [default to null] +**Id** | **int32** | The unique, numeric id of this user. | [optional] [default to null] +**Password** | **string** | The user'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) + + diff --git a/docs/ModelsBulkAssignees.md b/docs/ModelsBulkAssignees.md new file mode 100644 index 0000000..2aabf0a --- /dev/null +++ b/docs/ModelsBulkAssignees.md @@ -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) + + diff --git a/docs/ModelsBulkTask.md b/docs/ModelsBulkTask.md new file mode 100644 index 0000000..dfe4398 --- /dev/null +++ b/docs/ModelsBulkTask.md @@ -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 \"undone\" 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'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) + + diff --git a/docs/ModelsEmailConfirm.md b/docs/ModelsEmailConfirm.md new file mode 100644 index 0000000..6719089 --- /dev/null +++ b/docs/ModelsEmailConfirm.md @@ -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) + + diff --git a/docs/ModelsLabel.md b/docs/ModelsLabel.md new file mode 100644 index 0000000..af50ed2 --- /dev/null +++ b/docs/ModelsLabel.md @@ -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'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) + + diff --git a/docs/ModelsLabelTask.md b/docs/ModelsLabelTask.md new file mode 100644 index 0000000..b693984 --- /dev/null +++ b/docs/ModelsLabelTask.md @@ -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) + + diff --git a/docs/ModelsLabelTaskBulk.md b/docs/ModelsLabelTaskBulk.md new file mode 100644 index 0000000..0d001f7 --- /dev/null +++ b/docs/ModelsLabelTaskBulk.md @@ -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) + + diff --git a/docs/ModelsLinkSharing.md b/docs/ModelsLinkSharing.md new file mode 100644 index 0000000..f217d69 --- /dev/null +++ b/docs/ModelsLinkSharing.md @@ -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 = Read only, 1 = Read & Write, 2 = 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 = undefined, 1 = without password, 2 = 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) + + diff --git a/docs/ModelsList.md b/docs/ModelsList.md new file mode 100644 index 0000000..1aab741 --- /dev/null +++ b/docs/ModelsList.md @@ -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'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) + + diff --git a/docs/ModelsListUser.md b/docs/ModelsListUser.md new file mode 100644 index 0000000..0003caa --- /dev/null +++ b/docs/ModelsListUser.md @@ -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 <-> user relation. | [optional] [default to null] +**Right** | **int32** | The right this user has. 0 = Read only, 1 = Read & Write, 2 = 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) + + diff --git a/docs/ModelsMessage.md b/docs/ModelsMessage.md new file mode 100644 index 0000000..476337b --- /dev/null +++ b/docs/ModelsMessage.md @@ -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) + + diff --git a/docs/ModelsNamespace.md b/docs/ModelsNamespace.md new file mode 100644 index 0000000..d5d9f1e --- /dev/null +++ b/docs/ModelsNamespace.md @@ -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) + + diff --git a/docs/ModelsNamespaceUser.md b/docs/ModelsNamespaceUser.md new file mode 100644 index 0000000..122a8fd --- /dev/null +++ b/docs/ModelsNamespaceUser.md @@ -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 <-> user relation. | [optional] [default to null] +**Right** | **int32** | The right this user has. 0 = Read only, 1 = Read & Write, 2 = 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) + + diff --git a/docs/ModelsNamespaceWithLists.md b/docs/ModelsNamespaceWithLists.md new file mode 100644 index 0000000..dd578af --- /dev/null +++ b/docs/ModelsNamespaceWithLists.md @@ -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) + + diff --git a/docs/ModelsPasswordReset.md b/docs/ModelsPasswordReset.md new file mode 100644 index 0000000..639ef35 --- /dev/null +++ b/docs/ModelsPasswordReset.md @@ -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) + + diff --git a/docs/ModelsPasswordTokenRequest.md b/docs/ModelsPasswordTokenRequest.md new file mode 100644 index 0000000..5b34c13 --- /dev/null +++ b/docs/ModelsPasswordTokenRequest.md @@ -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) + + diff --git a/docs/ModelsRelatedTaskMap.md b/docs/ModelsRelatedTaskMap.md new file mode 100644 index 0000000..9483ef9 --- /dev/null +++ b/docs/ModelsRelatedTaskMap.md @@ -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) + + diff --git a/docs/ModelsTask.md b/docs/ModelsTask.md new file mode 100644 index 0000000..8105a30 --- /dev/null +++ b/docs/ModelsTask.md @@ -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 \"undone\" 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'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) + + diff --git a/docs/ModelsTaskAssginee.md b/docs/ModelsTaskAssginee.md new file mode 100644 index 0000000..a6ab30d --- /dev/null +++ b/docs/ModelsTaskAssginee.md @@ -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) + + diff --git a/docs/ModelsTaskAttachment.md b/docs/ModelsTaskAttachment.md new file mode 100644 index 0000000..64c4170 --- /dev/null +++ b/docs/ModelsTaskAttachment.md @@ -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) + + diff --git a/docs/ModelsTaskRelation.md b/docs/ModelsTaskRelation.md new file mode 100644 index 0000000..5db7435 --- /dev/null +++ b/docs/ModelsTaskRelation.md @@ -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 \"base\" 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) + + diff --git a/docs/ModelsTeam.md b/docs/ModelsTeam.md new file mode 100644 index 0000000..edf5a6f --- /dev/null +++ b/docs/ModelsTeam.md @@ -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'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) + + diff --git a/docs/ModelsTeamList.md b/docs/ModelsTeamList.md new file mode 100644 index 0000000..d503afd --- /dev/null +++ b/docs/ModelsTeamList.md @@ -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 <-> team relation. | [optional] [default to null] +**Right** | **int32** | The right this team has. 0 = Read only, 1 = Read & Write, 2 = 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) + + diff --git a/docs/ModelsTeamMember.md b/docs/ModelsTeamMember.md new file mode 100644 index 0000000..c105dee --- /dev/null +++ b/docs/ModelsTeamMember.md @@ -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) + + diff --git a/docs/ModelsTeamNamespace.md b/docs/ModelsTeamNamespace.md new file mode 100644 index 0000000..946e5c7 --- /dev/null +++ b/docs/ModelsTeamNamespace.md @@ -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 <-> team relation. | [optional] [default to null] +**Right** | **int32** | The right this team has. 0 = Read only, 1 = Read & Write, 2 = 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) + + diff --git a/docs/ModelsTeamUser.md b/docs/ModelsTeamUser.md new file mode 100644 index 0000000..31e9731 --- /dev/null +++ b/docs/ModelsTeamUser.md @@ -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'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) + + diff --git a/docs/ModelsTeamWithRight.md b/docs/ModelsTeamWithRight.md new file mode 100644 index 0000000..c3877c7 --- /dev/null +++ b/docs/ModelsTeamWithRight.md @@ -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'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) + + diff --git a/docs/ModelsUser.md b/docs/ModelsUser.md new file mode 100644 index 0000000..6b721c8 --- /dev/null +++ b/docs/ModelsUser.md @@ -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'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) + + diff --git a/docs/ModelsUserLogin.md b/docs/ModelsUserLogin.md new file mode 100644 index 0000000..123d59a --- /dev/null +++ b/docs/ModelsUserLogin.md @@ -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) + + diff --git a/docs/ModelsUserWithRight.md b/docs/ModelsUserWithRight.md new file mode 100644 index 0000000..33caf8b --- /dev/null +++ b/docs/ModelsUserWithRight.md @@ -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'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) + + diff --git a/docs/NamespaceApi.md b/docs/NamespaceApi.md new file mode 100644 index 0000000..bfa3edb --- /dev/null +++ b/docs/NamespaceApi.md @@ -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) + diff --git a/docs/ServiceApi.md b/docs/ServiceApi.md new file mode 100644 index 0000000..2a7cdad --- /dev/null +++ b/docs/ServiceApi.md @@ -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) + diff --git a/docs/SharingApi.md b/docs/SharingApi.md new file mode 100644 index 0000000..7135950 --- /dev/null +++ b/docs/SharingApi.md @@ -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 <-> 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 <-> 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 <-> 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 <-> 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) + diff --git a/docs/TaskApi.md b/docs/TaskApi.md new file mode 100644 index 0000000..ebbae92 --- /dev/null +++ b/docs/TaskApi.md @@ -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) + diff --git a/docs/TeamApi.md b/docs/TeamApi.md new file mode 100644 index 0000000..e6fcf9a --- /dev/null +++ b/docs/TeamApi.md @@ -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) + diff --git a/docs/UserApi.md b/docs/UserApi.md new file mode 100644 index 0000000..a2fac3a --- /dev/null +++ b/docs/UserApi.md @@ -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) + diff --git a/docs/V1Token.md b/docs/V1Token.md new file mode 100644 index 0000000..731126e --- /dev/null +++ b/docs/V1Token.md @@ -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) + + diff --git a/docs/V1UserPassword.md b/docs/V1UserPassword.md new file mode 100644 index 0000000..5f4f9d2 --- /dev/null +++ b/docs/V1UserPassword.md @@ -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) + + diff --git a/docs/V1VikunjaInfos.md b/docs/V1VikunjaInfos.md new file mode 100644 index 0000000..2ac1c43 --- /dev/null +++ b/docs/V1VikunjaInfos.md @@ -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) + + diff --git a/files_file.go b/files_file.go new file mode 100644 index 0000000..f37f413 --- /dev/null +++ b/files_file.go @@ -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. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. + * + * 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"` +} diff --git a/git_push.sh b/git_push.sh new file mode 100644 index 0000000..ae01b18 --- /dev/null +++ b/git_push.sh @@ -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' + diff --git a/labels_api.go b/labels_api.go new file mode 100644 index 0000000..a88658b --- /dev/null +++ b/labels_api.go @@ -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. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. + * + * 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'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 +} + diff --git a/list_api.go b/list_api.go new file mode 100644 index 0000000..a29e55c --- /dev/null +++ b/list_api.go @@ -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. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. + * + * 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 +} + diff --git a/models_api_user_password.go b/models_api_user_password.go new file mode 100644 index 0000000..72e9670 --- /dev/null +++ b/models_api_user_password.go @@ -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. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. + * + * 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"` +} diff --git a/models_bulk_assignees.go b/models_bulk_assignees.go new file mode 100644 index 0000000..a57d859 --- /dev/null +++ b/models_bulk_assignees.go @@ -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. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. + * + * 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"` +} diff --git a/models_bulk_task.go b/models_bulk_task.go new file mode 100644 index 0000000..bb1ff27 --- /dev/null +++ b/models_bulk_task.go @@ -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. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. + * + * 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"` +} diff --git a/models_email_confirm.go b/models_email_confirm.go new file mode 100644 index 0000000..d2c8fe1 --- /dev/null +++ b/models_email_confirm.go @@ -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. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. + * + * 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"` +} diff --git a/models_label.go b/models_label.go new file mode 100644 index 0000000..0eeec33 --- /dev/null +++ b/models_label.go @@ -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. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. + * + * 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"` +} diff --git a/models_label_task.go b/models_label_task.go new file mode 100644 index 0000000..b672681 --- /dev/null +++ b/models_label_task.go @@ -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. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. + * + * 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"` +} diff --git a/models_label_task_bulk.go b/models_label_task_bulk.go new file mode 100644 index 0000000..0356204 --- /dev/null +++ b/models_label_task_bulk.go @@ -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. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. + * + * 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"` +} diff --git a/models_link_sharing.go b/models_link_sharing.go new file mode 100644 index 0000000..c5cfd47 --- /dev/null +++ b/models_link_sharing.go @@ -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. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. + * + * 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"` +} diff --git a/models_list.go b/models_list.go new file mode 100644 index 0000000..5a36d09 --- /dev/null +++ b/models_list.go @@ -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. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. + * + * 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"` +} diff --git a/models_list_user.go b/models_list_user.go new file mode 100644 index 0000000..cf61972 --- /dev/null +++ b/models_list_user.go @@ -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. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. + * + * 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"` +} diff --git a/models_message.go b/models_message.go new file mode 100644 index 0000000..1e82326 --- /dev/null +++ b/models_message.go @@ -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. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. + * + * 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"` +} diff --git a/models_namespace.go b/models_namespace.go new file mode 100644 index 0000000..16476e0 --- /dev/null +++ b/models_namespace.go @@ -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. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. + * + * 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"` +} diff --git a/models_namespace_user.go b/models_namespace_user.go new file mode 100644 index 0000000..c174608 --- /dev/null +++ b/models_namespace_user.go @@ -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. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. + * + * 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"` +} diff --git a/models_namespace_with_lists.go b/models_namespace_with_lists.go new file mode 100644 index 0000000..473e6db --- /dev/null +++ b/models_namespace_with_lists.go @@ -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. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. + * + * 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"` +} diff --git a/models_password_reset.go b/models_password_reset.go new file mode 100644 index 0000000..51a1b64 --- /dev/null +++ b/models_password_reset.go @@ -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. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. + * + * 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"` +} diff --git a/models_password_token_request.go b/models_password_token_request.go new file mode 100644 index 0000000..ddc7fae --- /dev/null +++ b/models_password_token_request.go @@ -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. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. + * + * 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"` +} diff --git a/models_related_task_map.go b/models_related_task_map.go new file mode 100644 index 0000000..53ecdc0 --- /dev/null +++ b/models_related_task_map.go @@ -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. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. + * + * 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 { +} diff --git a/models_task.go b/models_task.go new file mode 100644 index 0000000..1095e7f --- /dev/null +++ b/models_task.go @@ -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. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. + * + * 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"` +} diff --git a/models_task_assginee.go b/models_task_assginee.go new file mode 100644 index 0000000..a825b1a --- /dev/null +++ b/models_task_assginee.go @@ -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. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. + * + * 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"` +} diff --git a/models_task_attachment.go b/models_task_attachment.go new file mode 100644 index 0000000..e510517 --- /dev/null +++ b/models_task_attachment.go @@ -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. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. + * + * 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"` +} diff --git a/models_task_relation.go b/models_task_relation.go new file mode 100644 index 0000000..19bb1fc --- /dev/null +++ b/models_task_relation.go @@ -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. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. + * + * 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"` +} diff --git a/models_team.go b/models_team.go new file mode 100644 index 0000000..faaad37 --- /dev/null +++ b/models_team.go @@ -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. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. + * + * 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"` +} diff --git a/models_team_list.go b/models_team_list.go new file mode 100644 index 0000000..ba6fee2 --- /dev/null +++ b/models_team_list.go @@ -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. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. + * + * 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"` +} diff --git a/models_team_member.go b/models_team_member.go new file mode 100644 index 0000000..329ced4 --- /dev/null +++ b/models_team_member.go @@ -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. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. + * + * 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"` +} diff --git a/models_team_namespace.go b/models_team_namespace.go new file mode 100644 index 0000000..446eeb1 --- /dev/null +++ b/models_team_namespace.go @@ -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. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. + * + * 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"` +} diff --git a/models_team_user.go b/models_team_user.go new file mode 100644 index 0000000..5114725 --- /dev/null +++ b/models_team_user.go @@ -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. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. + * + * 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"` +} diff --git a/models_team_with_right.go b/models_team_with_right.go new file mode 100644 index 0000000..540782b --- /dev/null +++ b/models_team_with_right.go @@ -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. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. + * + * 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"` +} diff --git a/models_user.go b/models_user.go new file mode 100644 index 0000000..4e586b3 --- /dev/null +++ b/models_user.go @@ -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. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. + * + * 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"` +} diff --git a/models_user_login.go b/models_user_login.go new file mode 100644 index 0000000..6ea7195 --- /dev/null +++ b/models_user_login.go @@ -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. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. + * + * 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"` +} diff --git a/models_user_with_right.go b/models_user_with_right.go new file mode 100644 index 0000000..85de6b1 --- /dev/null +++ b/models_user_with_right.go @@ -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. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. + * + * 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"` +} diff --git a/namespace_api.go b/namespace_api.go new file mode 100644 index 0000000..fe0b535 --- /dev/null +++ b/namespace_api.go @@ -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. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. + * + * 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 +} + diff --git a/service_api.go b/service_api.go new file mode 100644 index 0000000..40971fd --- /dev/null +++ b/service_api.go @@ -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. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. + * + * 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 +} + diff --git a/sharing_api.go b/sharing_api.go new file mode 100644 index 0000000..48c5e1d --- /dev/null +++ b/sharing_api.go @@ -0,0 +1,1757 @@ +/* + * 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. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. + * + * 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 SharingApiService service + + +/* SharingApiService Get teams on a list + Returns a list with all teams which have access on a given list. + * @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 "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 []ModelsTeamWithRight*/ +func (a *SharingApiService) ListsIdTeamsGet(ctx context.Context, id int32, localVarOptionals map[string]interface{}) ([]ModelsTeamWithRight, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload []ModelsTeamWithRight + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/lists/{id}/teams" + 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["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 +} + +/* SharingApiService Add a team to a list + Gives a team access to a list. + * @param ctx context.Context for authentication, logging, tracing, etc. + @param id List ID + @param list The team you want to add to the list. + @return ModelsTeamList*/ +func (a *SharingApiService) ListsIdTeamsPut(ctx context.Context, id int32, list ModelsTeamList) (ModelsTeamList, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload ModelsTeamList + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/lists/{id}/teams" + 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 +} + +/* SharingApiService Get users on a list + Returns a list with all users which have access on a given list. + * @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 "p" (int32) The page number. Used for pagination. If not provided, the first page of results is returned. + @param "s" (string) Search users by its name. + @return []ModelsUserWithRight*/ +func (a *SharingApiService) ListsIdUsersGet(ctx context.Context, id int32, localVarOptionals map[string]interface{}) ([]ModelsUserWithRight, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload []ModelsUserWithRight + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/lists/{id}/users" + 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["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 +} + +/* SharingApiService Add a user to a list + Gives a user access to a list. + * @param ctx context.Context for authentication, logging, tracing, etc. + @param id List ID + @param list The user you want to add to the list. + @return ModelsListUser*/ +func (a *SharingApiService) ListsIdUsersPut(ctx context.Context, id int32, list ModelsListUser) (ModelsListUser, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload ModelsListUser + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/lists/{id}/users" + 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 +} + +/* SharingApiService Delete a team from a list + Delets a team from a list. The team won't have access to the list anymore. + * @param ctx context.Context for authentication, logging, tracing, etc. + @param listID List ID + @param teamID Team ID + @return ModelsMessage*/ +func (a *SharingApiService) ListsListIDTeamsTeamIDDelete(ctx context.Context, listID int32, teamID 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/{listID}/teams/{teamID}" + localVarPath = strings.Replace(localVarPath, "{"+"listID"+"}", fmt.Sprintf("%v", listID), -1) + localVarPath = strings.Replace(localVarPath, "{"+"teamID"+"}", fmt.Sprintf("%v", teamID), -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 +} + +/* SharingApiService Update a team <-> list relation + Update a team <-> list relation. Mostly used to update the right that team has. + * @param ctx context.Context for authentication, logging, tracing, etc. + @param listID List ID + @param teamID Team ID + @param list The team you want to update. + @return ModelsTeamList*/ +func (a *SharingApiService) ListsListIDTeamsTeamIDPost(ctx context.Context, listID int32, teamID int32, list ModelsTeamList) (ModelsTeamList, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload ModelsTeamList + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/lists/{listID}/teams/{teamID}" + localVarPath = strings.Replace(localVarPath, "{"+"listID"+"}", fmt.Sprintf("%v", listID), -1) + localVarPath = strings.Replace(localVarPath, "{"+"teamID"+"}", fmt.Sprintf("%v", teamID), -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 +} + +/* SharingApiService Delete a user from a list + Delets a user from a list. The user won't have access to the list anymore. + * @param ctx context.Context for authentication, logging, tracing, etc. + @param listID List ID + @param userID User ID + @return ModelsMessage*/ +func (a *SharingApiService) ListsListIDUsersUserIDDelete(ctx context.Context, listID 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 + "/lists/{listID}/users/{userID}" + localVarPath = strings.Replace(localVarPath, "{"+"listID"+"}", fmt.Sprintf("%v", listID), -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 +} + +/* SharingApiService Update a user <-> list relation + Update a user <-> list relation. Mostly used to update the right that user has. + * @param ctx context.Context for authentication, logging, tracing, etc. + @param listID List ID + @param userID User ID + @param list The user you want to update. + @return ModelsListUser*/ +func (a *SharingApiService) ListsListIDUsersUserIDPost(ctx context.Context, listID int32, userID int32, list ModelsListUser) (ModelsListUser, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload ModelsListUser + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/lists/{listID}/users/{userID}" + localVarPath = strings.Replace(localVarPath, "{"+"listID"+"}", fmt.Sprintf("%v", listID), -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 + } + // 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 +} + +/* SharingApiService Get all link shares for a list + Returns all link shares which exist for a given list + * @param ctx context.Context for authentication, logging, tracing, etc. + @param list List 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 shares by hash. + @return []ModelsLinkSharing*/ +func (a *SharingApiService) ListsListSharesGet(ctx context.Context, list int32, localVarOptionals map[string]interface{}) ([]ModelsLinkSharing, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload []ModelsLinkSharing + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/lists/{list}/shares" + localVarPath = strings.Replace(localVarPath, "{"+"list"+"}", fmt.Sprintf("%v", list), -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 +} + +/* SharingApiService 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. + * @param ctx context.Context for authentication, logging, tracing, etc. + @param list List ID + @param label The new link share object + @return ModelsLinkSharing*/ +func (a *SharingApiService) ListsListSharesPut(ctx context.Context, list int32, label ModelsLinkSharing) (ModelsLinkSharing, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload ModelsLinkSharing + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/lists/{list}/shares" + localVarPath = strings.Replace(localVarPath, "{"+"list"+"}", fmt.Sprintf("%v", list), -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 +} + +/* SharingApiService Remove a link share + Remove a link share. 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 list List ID + @param share Share Link ID + @return ModelsMessage*/ +func (a *SharingApiService) ListsListSharesShareDelete(ctx context.Context, list int32, share 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/{list}/shares/{share}" + localVarPath = strings.Replace(localVarPath, "{"+"list"+"}", fmt.Sprintf("%v", list), -1) + localVarPath = strings.Replace(localVarPath, "{"+"share"+"}", fmt.Sprintf("%v", share), -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 +} + +/* SharingApiService Get one link shares for a list + Returns one link share by its ID. + * @param ctx context.Context for authentication, logging, tracing, etc. + @param list List ID + @param share Share ID + @return ModelsLinkSharing*/ +func (a *SharingApiService) ListsListSharesShareGet(ctx context.Context, list int32, share int32) (ModelsLinkSharing, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload ModelsLinkSharing + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/lists/{list}/shares/{share}" + localVarPath = strings.Replace(localVarPath, "{"+"list"+"}", fmt.Sprintf("%v", list), -1) + localVarPath = strings.Replace(localVarPath, "{"+"share"+"}", fmt.Sprintf("%v", share), -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 +} + +/* SharingApiService Get teams on a namespace + Returns a namespace with all teams which have access on a given namespace. + * @param ctx context.Context for authentication, logging, tracing, etc. + @param id Namespace 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 teams by its name. + @return []ModelsTeamWithRight*/ +func (a *SharingApiService) NamespacesIdTeamsGet(ctx context.Context, id int32, localVarOptionals map[string]interface{}) ([]ModelsTeamWithRight, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload []ModelsTeamWithRight + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/namespaces/{id}/teams" + 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["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 +} + +/* SharingApiService Add a team to a namespace + Gives a team access to a namespace. + * @param ctx context.Context for authentication, logging, tracing, etc. + @param id Namespace ID + @param namespace The team you want to add to the namespace. + @return ModelsTeamNamespace*/ +func (a *SharingApiService) NamespacesIdTeamsPut(ctx context.Context, id int32, namespace ModelsTeamNamespace) (ModelsTeamNamespace, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload ModelsTeamNamespace + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/namespaces/{id}/teams" + 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 +} + +/* SharingApiService Get users on a namespace + Returns a namespace with all users which have access on a given namespace. + * @param ctx context.Context for authentication, logging, tracing, etc. + @param id Namespace 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 users by its name. + @return []ModelsUserWithRight*/ +func (a *SharingApiService) NamespacesIdUsersGet(ctx context.Context, id int32, localVarOptionals map[string]interface{}) ([]ModelsUserWithRight, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload []ModelsUserWithRight + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/namespaces/{id}/users" + 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["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 +} + +/* SharingApiService Add a user to a namespace + Gives a user access to a namespace. + * @param ctx context.Context for authentication, logging, tracing, etc. + @param id Namespace ID + @param namespace The user you want to add to the namespace. + @return ModelsNamespaceUser*/ +func (a *SharingApiService) NamespacesIdUsersPut(ctx context.Context, id int32, namespace ModelsNamespaceUser) (ModelsNamespaceUser, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload ModelsNamespaceUser + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/namespaces/{id}/users" + 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 +} + +/* SharingApiService Delete a team from a namespace + Delets a team from a namespace. The team won't have access to the namespace anymore. + * @param ctx context.Context for authentication, logging, tracing, etc. + @param namespaceID Namespace ID + @param teamID team ID + @return ModelsMessage*/ +func (a *SharingApiService) NamespacesNamespaceIDTeamsTeamIDDelete(ctx context.Context, namespaceID int32, teamID 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/{namespaceID}/teams/{teamID}" + localVarPath = strings.Replace(localVarPath, "{"+"namespaceID"+"}", fmt.Sprintf("%v", namespaceID), -1) + localVarPath = strings.Replace(localVarPath, "{"+"teamID"+"}", fmt.Sprintf("%v", teamID), -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 +} + +/* SharingApiService Update a team <-> namespace relation + Update a team <-> namespace relation. Mostly used to update the right that team has. + * @param ctx context.Context for authentication, logging, tracing, etc. + @param namespaceID Namespace ID + @param teamID Team ID + @param namespace The team you want to update. + @return ModelsTeamNamespace*/ +func (a *SharingApiService) NamespacesNamespaceIDTeamsTeamIDPost(ctx context.Context, namespaceID int32, teamID int32, namespace ModelsTeamNamespace) (ModelsTeamNamespace, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload ModelsTeamNamespace + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/namespaces/{namespaceID}/teams/{teamID}" + localVarPath = strings.Replace(localVarPath, "{"+"namespaceID"+"}", fmt.Sprintf("%v", namespaceID), -1) + localVarPath = strings.Replace(localVarPath, "{"+"teamID"+"}", fmt.Sprintf("%v", teamID), -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 +} + +/* SharingApiService Delete a user from a namespace + Delets a user from a namespace. The user won't have access to the namespace anymore. + * @param ctx context.Context for authentication, logging, tracing, etc. + @param namespaceID Namespace ID + @param userID user ID + @return ModelsMessage*/ +func (a *SharingApiService) NamespacesNamespaceIDUsersUserIDDelete(ctx context.Context, namespaceID 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 + "/namespaces/{namespaceID}/users/{userID}" + localVarPath = strings.Replace(localVarPath, "{"+"namespaceID"+"}", fmt.Sprintf("%v", namespaceID), -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 +} + +/* SharingApiService Update a user <-> namespace relation + Update a user <-> namespace relation. Mostly used to update the right that user has. + * @param ctx context.Context for authentication, logging, tracing, etc. + @param namespaceID Namespace ID + @param userID User ID + @param namespace The user you want to update. + @return ModelsNamespaceUser*/ +func (a *SharingApiService) NamespacesNamespaceIDUsersUserIDPost(ctx context.Context, namespaceID int32, userID int32, namespace ModelsNamespaceUser) (ModelsNamespaceUser, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload ModelsNamespaceUser + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/namespaces/{namespaceID}/users/{userID}" + localVarPath = strings.Replace(localVarPath, "{"+"namespaceID"+"}", fmt.Sprintf("%v", namespaceID), -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 + } + // 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 +} + +/* SharingApiService Get an auth token for a share + Get a jwt auth token for a shared list from a share hash. + * @param ctx context.Context for authentication, logging, tracing, etc. + @param share The share hash + @return V1Token*/ +func (a *SharingApiService) SharesShareAuthPost(ctx context.Context, share string) (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 + "/shares/{share}/auth" + localVarPath = strings.Replace(localVarPath, "{"+"share"+"}", fmt.Sprintf("%v", share), -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 + } + 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 +} + diff --git a/task_api.go b/task_api.go new file mode 100644 index 0000000..0a1b5c1 --- /dev/null +++ b/task_api.go @@ -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. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. + * + * 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 \"mark it done\". + * @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 +} + diff --git a/team_api.go b/team_api.go new file mode 100644 index 0000000..6fc1700 --- /dev/null +++ b/team_api.go @@ -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. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. + * + * 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 +} + diff --git a/user_api.go b/user_api.go new file mode 100644 index 0000000..3b76c95 --- /dev/null +++ b/user_api.go @@ -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. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. + * + * 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 +} + diff --git a/v1_token.go b/v1_token.go new file mode 100644 index 0000000..5c4444e --- /dev/null +++ b/v1_token.go @@ -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. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. + * + * 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"` +} diff --git a/v1_user_password.go b/v1_user_password.go new file mode 100644 index 0000000..0b6d042 --- /dev/null +++ b/v1_user_password.go @@ -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. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. + * + * 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"` +} diff --git a/v1_vikunja_infos.go b/v1_vikunja_infos.go new file mode 100644 index 0000000..cc39f6a --- /dev/null +++ b/v1_vikunja_infos.go @@ -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. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **BasicAuth:** Only used when requesting tasks via caldav. + * + * 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"` +}