From a8a999b9ffeffcfb7591087e0989466faa6ad9f5 Mon Sep 17 00:00:00 2001 From: Ali Abrar Date: Wed, 22 Jan 2025 21:09:22 -0500 Subject: [PATCH] 0.24.6 --- .github/workflows/haskell.yml | 38 + .gitignore | 11 + .openapi-generator-ignore | 23 + .openapi-generator/VERSION | 1 + ChangeLog.md | 5 + LICENSE | 30 + README.md | 203 + Setup.hs | 2 + generator/README.md | 9 + generator/default.nix | 29 + generator/docs-0.24.6.json | 9755 ++++++++++++++++++++ generator/openapi-hs-generator/default.nix | 7 + generator/openapi-hs-generator/github.json | 7 + generator/reflex-platform/default.nix | 2 + generator/reflex-platform/github.json | 8 + generator/reflex-platform/thunk.nix | 12 + lib/Vikunja.hs | 32 + lib/Vikunja/API.hs | 48 + lib/Vikunja/API/Api.hs | 169 + lib/Vikunja/API/Assignees.hs | 183 + lib/Vikunja/API/Auth.hs | 147 + lib/Vikunja/API/Filter.hs | 146 + lib/Vikunja/API/Labels.hs | 326 + lib/Vikunja/API/Migration.hs | 376 + lib/Vikunja/API/Project.hs | 693 ++ lib/Vikunja/API/Service.hs | 77 + lib/Vikunja/API/Sharing.hs | 469 + lib/Vikunja/API/Subscriptions.hs | 158 + lib/Vikunja/API/Task.hs | 786 ++ lib/Vikunja/API/Team.hs | 280 + lib/Vikunja/API/Testing.hs | 78 + lib/Vikunja/API/User.hs | 753 ++ lib/Vikunja/API/Webhooks.hs | 190 + lib/Vikunja/Client.hs | 224 + lib/Vikunja/Core.hs | 582 ++ lib/Vikunja/Logging.hs | 34 + lib/Vikunja/LoggingKatip.hs | 118 + lib/Vikunja/LoggingMonadLogger.hs | 127 + lib/Vikunja/MimeTypes.hs | 204 + lib/Vikunja/Model.hs | 4264 +++++++++ lib/Vikunja/ModelLens.hs | 2618 ++++++ openapi.yaml | 8185 ++++++++++++++++ stack.yaml | 7 + tests/ApproxEq.hs | 81 + tests/Instances.hs | 1164 +++ tests/PropMime.hs | 51 + tests/Test.hs | 113 + vikunja-api.cabal | 134 + 48 files changed, 32959 insertions(+) create mode 100644 .github/workflows/haskell.yml create mode 100644 .gitignore create mode 100644 .openapi-generator-ignore create mode 100644 .openapi-generator/VERSION create mode 100644 ChangeLog.md create mode 100644 LICENSE create mode 100644 README.md create mode 100644 Setup.hs create mode 100644 generator/README.md create mode 100644 generator/default.nix create mode 100644 generator/docs-0.24.6.json create mode 100644 generator/openapi-hs-generator/default.nix create mode 100644 generator/openapi-hs-generator/github.json create mode 100644 generator/reflex-platform/default.nix create mode 100644 generator/reflex-platform/github.json create mode 100644 generator/reflex-platform/thunk.nix create mode 100644 lib/Vikunja.hs create mode 100644 lib/Vikunja/API.hs create mode 100644 lib/Vikunja/API/Api.hs create mode 100644 lib/Vikunja/API/Assignees.hs create mode 100644 lib/Vikunja/API/Auth.hs create mode 100644 lib/Vikunja/API/Filter.hs create mode 100644 lib/Vikunja/API/Labels.hs create mode 100644 lib/Vikunja/API/Migration.hs create mode 100644 lib/Vikunja/API/Project.hs create mode 100644 lib/Vikunja/API/Service.hs create mode 100644 lib/Vikunja/API/Sharing.hs create mode 100644 lib/Vikunja/API/Subscriptions.hs create mode 100644 lib/Vikunja/API/Task.hs create mode 100644 lib/Vikunja/API/Team.hs create mode 100644 lib/Vikunja/API/Testing.hs create mode 100644 lib/Vikunja/API/User.hs create mode 100644 lib/Vikunja/API/Webhooks.hs create mode 100644 lib/Vikunja/Client.hs create mode 100644 lib/Vikunja/Core.hs create mode 100644 lib/Vikunja/Logging.hs create mode 100644 lib/Vikunja/LoggingKatip.hs create mode 100644 lib/Vikunja/LoggingMonadLogger.hs create mode 100644 lib/Vikunja/MimeTypes.hs create mode 100644 lib/Vikunja/Model.hs create mode 100644 lib/Vikunja/ModelLens.hs create mode 100644 openapi.yaml create mode 100644 stack.yaml create mode 100644 tests/ApproxEq.hs create mode 100644 tests/Instances.hs create mode 100644 tests/PropMime.hs create mode 100644 tests/Test.hs create mode 100644 vikunja-api.cabal diff --git a/.github/workflows/haskell.yml b/.github/workflows/haskell.yml new file mode 100644 index 0000000..fb3eb58 --- /dev/null +++ b/.github/workflows/haskell.yml @@ -0,0 +1,38 @@ +name: github-action + +on: [push, pull_request] + +jobs: + build: + strategy: + matrix: + ghc: ['8.10.7', '9.2.8'] + os: ['ubuntu-latest'] + runs-on: ${{ matrix.os }} + + name: GHC ${{ matrix.ghc }} on ${{ matrix.os }} + steps: + - uses: actions/checkout@v3 + - uses: haskell-actions/setup@v2 + with: + ghc-version: ${{ matrix.ghc }} + - name: Cache + uses: actions/cache@v1 + env: + cache-name: cache-cabal + with: + path: ~/.cabal + key: ${{ runner.os }}-${{ matrix.ghc }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/cabal.project') }} + restore-keys: | + ${{ runner.os }}-${{ matrix.ghc }}-build-${{ env.cache-name }}- + ${{ runner.os }}-${{ matrix.ghc }}-build- + ${{ runner.os }}-${{ matrix.ghc }}- + ${{ runner.os }} + - name: Install dependencies + run: | + cabal update + cabal build --only-dependencies --enable-tests --enable-benchmarks + - name: Build + run: cabal build --enable-tests --enable-benchmarks all + - name: Run tests + run: cabal test all diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e7a84ce --- /dev/null +++ b/.gitignore @@ -0,0 +1,11 @@ +.stack-work +src/highlight.js +src/style.css +dist +dist-newstyle +cabal.project.local +.cabal-sandbox +cabal.sandbox.config +generator/result +result +*~ diff --git a/.openapi-generator-ignore b/.openapi-generator-ignore new file mode 100644 index 0000000..7484ee5 --- /dev/null +++ b/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# 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 OpenAPI Generator 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/.openapi-generator/VERSION b/.openapi-generator/VERSION new file mode 100644 index 0000000..99eba4d --- /dev/null +++ b/.openapi-generator/VERSION @@ -0,0 +1 @@ +4.1.0 \ No newline at end of file diff --git a/ChangeLog.md b/ChangeLog.md new file mode 100644 index 0000000..1f39ccc --- /dev/null +++ b/ChangeLog.md @@ -0,0 +1,5 @@ +# Revision history for vikunja-api + +## 0.24.6.0 + +* Autogenerated api bindings for Vikunja API version 0.24.6 diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..d9e0925 --- /dev/null +++ b/LICENSE @@ -0,0 +1,30 @@ +Copyright (c) 2018, Obsidian Systems LLC + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * Neither the name of Obsidian Systems LLC nor the names of other + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..a880b13 --- /dev/null +++ b/README.md @@ -0,0 +1,203 @@ +## OpenAPI Auto-Generated [http-client](https://www.stackage.org/lts-10.0/package/http-client-0.5.7.1) Bindings to `Vikunja API` + +The library in `lib` provides auto-generated-from-OpenAPI [http-client](https://www.stackage.org/lts-10.0/package/http-client-0.5.7.1) bindings to the Vikunja API API. + +OpenApi Version: 3.0.1 + +## Installation + +Installation follows the standard approach to installing Stack-based projects. + +1. Install the [Haskell `stack` tool](http://docs.haskellstack.org/en/stable/README). +2. To build the package, and generate the documentation (recommended): +``` +stack haddock +``` +which will generate docs for this lib in the `docs` folder. + +To generate the docs in the normal location (to enable hyperlinks to external libs), remove +``` +build: + haddock-arguments: + haddock-args: + - "--odir=./docs" +``` +from the stack.yaml file and run `stack haddock` again. + +3. To run unit tests: +``` +stack test +``` + +## OpenAPI-Generator + +The code generator that produced this library, and which explains how +to obtain and use the openapi-generator cli tool lives at + +https://openapi-generator.tech + +The _generator-name_ argument (`--generator-name`) passed to the cli tool used should be + +``` +haskell-http-client +``` + +### Unsupported OpenAPI Features + +* Model Inheritance + +This is beta software; other cases may not be supported. + +### Codegen "additional properties" parameters + +These options allow some customization of the code generation process. + +**haskell-http-client additional properties:** + +| OPTION | DESCRIPTION | DEFAULT | ACTUAL | +|---------------------------------|-------------------------------------------------------------------------------------------------------------------------------|----------|---------------------------------------| +| allowFromJsonNulls | allow JSON Null during model decoding from JSON | true | true | +| allowNonUniqueOperationIds | allow *different* API modules to contain the same operationId. Each API must be imported qualified | false | false | +| allowToJsonNulls | allow emitting JSON Null during model encoding to JSON | false | false | +| baseModule | Set the base module namespace | | Vikunja | +| cabalPackage | Set the cabal package name, which consists of one or more alphanumeric words separated by hyphens | | vikunja-api | +| cabalVersion | Set the cabal version number, consisting of a sequence of one or more integers separated by dots | 0.1.0.0 | 0.24.6.0 | +| customTestInstanceModule | test module used to provide typeclass instances for types not known by the generator | | | +| configType | Set the name of the type used for configuration | | VikunjaConfig | +| dateFormat | format string used to parse/render a date | %Y-%m-%d | %Y-%m-%d | +| dateTimeFormat | format string used to parse/render a datetime. (Defaults to [formatISO8601Millis][1] when not provided) | | | +| dateTimeParseFormat | overrides the format string used to parse a datetime | | | +| generateEnums | Generate specific datatypes for OpenAPI enums | true | true | +| generateFormUrlEncodedInstances | Generate FromForm/ToForm instances for models used by x-www-form-urlencoded operations (model fields must be primitive types) | true | true | +| generateLenses | Generate Lens optics for Models | true | true | +| generateModelConstructors | Generate smart constructors (only supply required fields) for models | true | true | +| inlineMimeTypes | Inline (hardcode) the content-type and accept parameters on operations, when there is only 1 option | true | true | +| modelDeriving | Additional classes to include in the deriving() clause of Models | | | +| requestType | Set the name of the type used to generate requests | | VikunjaRequest | +| strictFields | Add strictness annotations to all model fields | true | true | +| useKatip | Sets the default value for the UseKatip cabal flag. If true, the katip package provides logging instead of monad-logger | true | true | +| queryExtraUnreserved | Configures additional querystring characters which must not be URI encoded, e.g. '+' or ':' | | | + +[1]: https://www.stackage.org/haddock/lts-9.0/iso8601-time-0.1.4/Data-Time-ISO8601.html#v:formatISO8601Millis + +An example setting _dateTimeFormat_ and _strictFields_: + +``` +java -jar openapi-generator-cli.jar generate -i petstore.yaml -g haskell-http-client -o output/haskell-http-client --additional-properties=dateTimeFormat="%Y-%m-%dT%H:%M:%S%Q%z" --additional-properties=strictFields=false +``` + +View the full list of Codegen "config option" parameters with the command: + +``` +java -jar openapi-generator-cli.jar config-help -g haskell-http-client +``` + +## Usage Notes + +### Example Petstore Haddock documentation + +An example of the generated haddock documentation targeting the server http://petstore.swagger.io/ (Petstore) can be found [here][2] + +[2]: https://hackage.haskell.org/package/swagger-petstore + +### Example Petstore App + +An example application using the auto-generated haskell-http-client bindings for the server http://petstore.swagger.io/ can be found [here][3] + +[3]: https://github.com/openapitools/openapi-generator/tree/master/samples/client/petstore/haskell-http-client/example-app + +This library is intended to be imported qualified. + +### Modules + +| MODULE | NOTES | +| ------------------- | --------------------------------------------------- | +| Vikunja.Client | use the "dispatch" functions to send requests | +| Vikunja.Core | core functions, config and request types | +| Vikunja.API | construct api requests | +| Vikunja.Model | describes api models | +| Vikunja.MimeTypes | encoding/decoding MIME types (content-types/accept) | +| Vikunja.ModelLens | lenses for model fields | +| Vikunja.Logging | logging functions and utils | + + +### MimeTypes + +This library adds type safety around what OpenAPI specifies as +Produces and Consumes for each Operation (e.g. the list of MIME types an +Operation can Produce (using 'accept' headers) and Consume (using 'content-type' headers). + +For example, if there is an Operation named _addFoo_, there will be a +data type generated named _AddFoo_ (note the capitalization), which +describes additional constraints and actions on the _addFoo_ operation +via its typeclass instances. These typeclass instances can be viewed +in GHCi or via the Haddocks. + +* required parameters are included as function arguments to _addFoo_ +* optional non-body parameters are included by using `applyOptionalParam` +* optional body parameters are set by using `setBodyParam` + +Example code generated for pretend _addFoo_ operation: + +```haskell +data AddFoo +instance Consumes AddFoo MimeJSON +instance Produces AddFoo MimeJSON +instance Produces AddFoo MimeXML +instance HasBodyParam AddFoo FooModel +instance HasOptionalParam AddFoo FooName +instance HasOptionalParam AddFoo FooId +``` + +this would indicate that: + +* the _addFoo_ operation can consume JSON +* the _addFoo_ operation produces JSON or XML, depending on the argument passed to the dispatch function +* the _addFoo_ operation can set it's body param of _FooModel_ via `setBodyParam` +* the _addFoo_ operation can set 2 different optional parameters via `applyOptionalParam` + +If the OpenAPI spec doesn't declare it can accept or produce a certain +MIME type for a given Operation, you should either add a Produces or +Consumes instance for the desired MIME types (assuming the server +supports it), use `dispatchLbsUnsafe` or modify the OpenAPI spec and +run the generator again. + +New MIME type instances can be added via MimeType/MimeRender/MimeUnrender + +Only JSON instances are generated by default, and in some case +x-www-form-urlencoded instances (FromFrom, ToForm) will also be +generated if the model fields are primitive types, and there are +Operations using x-www-form-urlencoded which use those models. + +### Authentication + +A haskell data type will be generated for each OpenAPI authentication type. + +If for example the AuthMethod `AuthOAuthFoo` is generated for OAuth operations, then +`addAuthMethod` should be used to add the AuthMethod config. + +When a request is dispatched, if a matching auth method is found in +the config, it will be applied to the request. + +### Example + +```haskell +mgr <- newManager defaultManagerSettings +config0 <- withStdoutLogging =<< newConfig +let config = config0 + `addAuthMethod` AuthOAuthFoo "secret-key" + +let addFooRequest = + addFoo + (ContentType MimeJSON) + (Accept MimeXML) + (ParamBar paramBar) + (ParamQux paramQux) + modelBaz + `applyOptionalParam` FooId 1 + `applyOptionalParam` FooName "name" + `setHeader` [("qux_header","xxyy")] +addFooResult <- dispatchMime mgr config addFooRequest +``` + +See the example app and the haddocks for details. diff --git a/Setup.hs b/Setup.hs new file mode 100644 index 0000000..9a994af --- /dev/null +++ b/Setup.hs @@ -0,0 +1,2 @@ +import Distribution.Simple +main = defaultMain diff --git a/generator/README.md b/generator/README.md new file mode 100644 index 0000000..33b66d9 --- /dev/null +++ b/generator/README.md @@ -0,0 +1,9 @@ +# Updating the API + +Get the OpenAPI docs json file from the Vikunja API doc site. Let's say it's called `docs-0.99.9.json`. + +```bash +nix-build default.nix --arg specFile './docs-0.99.9.json' + +cp -r result/* ../ +``` diff --git a/generator/default.nix b/generator/default.nix new file mode 100644 index 0000000..68a2073 --- /dev/null +++ b/generator/default.nix @@ -0,0 +1,29 @@ +{ specFile ? ./docs-0.24.6.json }: +{ gitea-api = import ./openapi-hs-generator { + pkgs = (import ./reflex-platform {}).nixpkgs; + inherit specFile; + packageName = "vikunja-api"; + baseModule = "Vikunja"; + versionFn = x: x + ".0"; + cabalFileReplacements = { + "Author Name Here" = "Obsidian Systems LLC"; + "author.name@email.com" = "maintainer@obsidian.systems"; + "YEAR - AUTHOR" = "2024 Obsidian Systems LLC"; + "UnspecifiedLicense" = "BSD3"; + "extra-source-files:" = "extra-source-files:\n ChangeLog.md"; + "cabal-version: >= 1.10" = '' + cabal-version: >= 1.10 + tested-with: GHC ==8.10.7 + license-file: LICENSE + ''; + # Package version changes: + "http-media >= 0.4 && < 0.8" = "http-media >= 0.4 && < 0.9"; + "http-client >=0.5 && <0.6" = "http-client >=0.5 && <0.7"; + }; + cabalFileAppendix = '' + source-repository head + type: git + location: https://github.com/obsidiansystems/vikunja-api + ''; + }; +} diff --git a/generator/docs-0.24.6.json b/generator/docs-0.24.6.json new file mode 100644 index 0000000..4c93289 --- /dev/null +++ b/generator/docs-0.24.6.json @@ -0,0 +1,9755 @@ +{ + "schemes": [], + "swagger": "2.0", + "info": { + "description": "# Pagination\nEvery endpoint capable of pagination will return two headers:\n* `x-pagination-total-pages`: The total number of available pages for this request\n* `x-pagination-result-count`: The number of items returned for this request.\n# Rights\nAll endpoints which return a single item (project, task, etc.) - no array - will also return a `x-max-right` header with the max right the user has on this item as an int where `0` is `Read Only`, `1` is `Read & Write` and `2` is `Admin`.\nThis can be used to show or hide ui elements based on the rights the user has.\n# Errors\nAll errors have an error code and a human-readable error message in addition to the http status code. You should always check for the status code in the response, not only the http status code.\nDue to limitations in the swagger library we're using for this document, only one error per http status code is documented here. Make sure to check the [error docs](https://vikunja.io/docs/errors/) in Vikunja's documentation for a full list of available error codes.\n# Authorization\n**JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully.\n\n**API Token:** You can create scoped API tokens for your user and use the token to make authenticated requests in the context of that user. The token must be provided via an `Authorization: Bearer ` header, similar to jwt auth. See the documentation for the `api` group to manage token creation and revocation.\n\n**BasicAuth:** Only used when requesting tasks via CalDAV.\n", + "title": "Vikunja API", + "contact": { + "name": "General Vikunja contact", + "url": "https://vikunja.io/contact/", + "email": "hello@vikunja.io" + }, + "license": { + "name": "AGPL-3.0-or-later", + "url": "https://code.vikunja.io/api/src/branch/main/LICENSE" + }, + "version": "0.24.6" + }, + "host": "", + "basePath": "/api/v1", + "paths": { + "/auth/openid/{provider}/callback": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "After a redirect from the OpenID Connect provider to the frontend has been made with the authentication `code`, this endpoint can be used to obtain a jwt token for that user and thus log them in.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "auth" + ], + "summary": "Authenticate a user with OpenID Connect", + "operationId": "get-token-openid", + "parameters": [ + { + "description": "The openid callback", + "name": "callback", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/openid.Callback" + } + }, + { + "type": "integer", + "description": "The OpenID Connect provider key as returned by the /info endpoint", + "name": "provider", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/auth.Token" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/backgrounds/unsplash/image/{image}": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Get an unsplash image. **Returns json on error.**", + "produces": [ + "application/octet-stream" + ], + "tags": [ + "project" + ], + "summary": "Get an unsplash image", + "parameters": [ + { + "type": "integer", + "description": "Unsplash Image ID", + "name": "image", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The image", + "schema": { + "type": "file" + } + }, + "404": { + "description": "The image does not exist.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/backgrounds/unsplash/image/{image}/thumb": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Get an unsplash thumbnail image. The thumbnail is cropped to a max width of 200px. **Returns json on error.**", + "produces": [ + "application/octet-stream" + ], + "tags": [ + "project" + ], + "summary": "Get an unsplash thumbnail image", + "parameters": [ + { + "type": "integer", + "description": "Unsplash Image ID", + "name": "image", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The thumbnail", + "schema": { + "type": "file" + } + }, + "404": { + "description": "The image does not exist.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/backgrounds/unsplash/search": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Search for a project background from unsplash", + "produces": [ + "application/json" + ], + "tags": [ + "project" + ], + "summary": "Search for a background from unsplash", + "parameters": [ + { + "type": "string", + "description": "Search backgrounds from unsplash with this search term.", + "name": "s", + "in": "query" + }, + { + "type": "integer", + "description": "The page number. Used for pagination. If not provided, the first page of results is returned.", + "name": "p", + "in": "query" + } + ], + "responses": { + "200": { + "description": "An array with photos", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/background.Image" + } + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/filters": { + "put": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Creates a new saved filter", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "filter" + ], + "summary": "Creates a new saved filter", + "responses": { + "201": { + "description": "The Saved Filter", + "schema": { + "$ref": "#/definitions/models.SavedFilter" + } + }, + "403": { + "description": "The user does not have access to that saved filter.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/filters/{id}": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns a saved filter by its ID.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "filter" + ], + "summary": "Gets one saved filter", + "parameters": [ + { + "type": "integer", + "description": "Filter ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The Saved Filter", + "schema": { + "$ref": "#/definitions/models.SavedFilter" + } + }, + "403": { + "description": "The user does not have access to that saved filter.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Updates a saved filter by its ID.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "filter" + ], + "summary": "Updates a saved filter", + "parameters": [ + { + "type": "integer", + "description": "Filter ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The Saved Filter", + "schema": { + "$ref": "#/definitions/models.SavedFilter" + } + }, + "403": { + "description": "The user does not have access to that saved filter.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "The saved filter does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "delete": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Removes a saved filter by its ID.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "filter" + ], + "summary": "Removes a saved filter", + "parameters": [ + { + "type": "integer", + "description": "Filter ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The Saved Filter", + "schema": { + "$ref": "#/definitions/models.SavedFilter" + } + }, + "403": { + "description": "The user does not have access to that saved filter.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "The saved filter does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/info": { + "get": { + "description": "Returns the version, frontendurl, motd and various settings of Vikunja", + "produces": [ + "application/json" + ], + "tags": [ + "service" + ], + "summary": "Info", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.vikunjaInfos" + } + } + } + } + }, + "/labels": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "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" + ], + "tags": [ + "labels" + ], + "summary": "Get all labels a user has access to", + "parameters": [ + { + "type": "integer", + "description": "The page number. Used for pagination. If not provided, the first page of results is returned.", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page.", + "name": "per_page", + "in": "query" + }, + { + "type": "string", + "description": "Search labels by label text.", + "name": "s", + "in": "query" + } + ], + "responses": { + "200": { + "description": "The labels", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/models.Label" + } + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "put": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Creates a new label.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "labels" + ], + "summary": "Create a label", + "parameters": [ + { + "description": "The label object", + "name": "label", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.Label" + } + } + ], + "responses": { + "201": { + "description": "The created label object.", + "schema": { + "$ref": "#/definitions/models.Label" + } + }, + "400": { + "description": "Invalid label object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/labels/{id}": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns one label by its ID.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "labels" + ], + "summary": "Gets one label", + "parameters": [ + { + "type": "integer", + "description": "Label ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The label", + "schema": { + "$ref": "#/definitions/models.Label" + } + }, + "403": { + "description": "The user does not have access to the label", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "Label not found", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "put": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "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" + ], + "tags": [ + "labels" + ], + "summary": "Update a label", + "parameters": [ + { + "type": "integer", + "description": "Label ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "The label object", + "name": "label", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.Label" + } + } + ], + "responses": { + "200": { + "description": "The created label object.", + "schema": { + "$ref": "#/definitions/models.Label" + } + }, + "400": { + "description": "Invalid label object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "403": { + "description": "Not allowed to update the label.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "Label not found.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "delete": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "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" + ], + "tags": [ + "labels" + ], + "summary": "Delete a label", + "parameters": [ + { + "type": "integer", + "description": "Label ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The label was successfully deleted.", + "schema": { + "$ref": "#/definitions/models.Label" + } + }, + "403": { + "description": "Not allowed to delete the label.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "Label not found.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/login": { + "post": { + "description": "Logs a user in. Returns a JWT-Token to authenticate further requests.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "auth" + ], + "summary": "Login", + "parameters": [ + { + "description": "The login credentials", + "name": "credentials", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/user.Login" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/auth.Token" + } + }, + "400": { + "description": "Invalid user password model.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "403": { + "description": "Invalid username or password.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "412": { + "description": "Invalid totp passcode.", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/migration/microsoft-todo/auth": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns the auth url where the user needs to get its auth code. This code can then be used to migrate everything from Microsoft Todo to Vikunja.", + "produces": [ + "application/json" + ], + "tags": [ + "migration" + ], + "summary": "Get the auth url from Microsoft Todo", + "responses": { + "200": { + "description": "The auth url.", + "schema": { + "$ref": "#/definitions/handler.AuthURL" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/migration/microsoft-todo/migrate": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Migrates all tasklinsts, tasks, notes and reminders from Microsoft Todo to Vikunja.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "migration" + ], + "summary": "Migrate all projects, tasks etc. from Microsoft Todo", + "parameters": [ + { + "description": "The auth token previously obtained from the auth url. See the docs for /migration/microsoft-todo/auth.", + "name": "migrationCode", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/microsofttodo.Migration" + } + } + ], + "responses": { + "200": { + "description": "A message telling you everything was migrated successfully.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/migration/microsoft-todo/status": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns if the current user already did the migation or not. This is useful to show a confirmation message in the frontend if the user is trying to do the same migration again.", + "produces": [ + "application/json" + ], + "tags": [ + "migration" + ], + "summary": "Get migration status", + "responses": { + "200": { + "description": "The migration status", + "schema": { + "$ref": "#/definitions/migration.Status" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/migration/ticktick/migrate": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Imports all projects, tasks, notes, reminders, subtasks and files from a TickTick backup export into Vikunja.", + "consumes": [ + "application/x-www-form-urlencoded" + ], + "produces": [ + "application/json" + ], + "tags": [ + "migration" + ], + "summary": "Import all projects, tasks etc. from a TickTick backup export", + "parameters": [ + { + "type": "string", + "description": "The TickTick backup csv file.", + "name": "import", + "in": "formData", + "required": true + } + ], + "responses": { + "200": { + "description": "A message telling you everything was migrated successfully.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/migration/ticktick/status": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns if the current user already did the migation or not. This is useful to show a confirmation message in the frontend if the user is trying to do the same migration again.", + "produces": [ + "application/json" + ], + "tags": [ + "migration" + ], + "summary": "Get migration status", + "responses": { + "200": { + "description": "The migration status", + "schema": { + "$ref": "#/definitions/migration.Status" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/migration/todoist/auth": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns the auth url where the user needs to get its auth code. This code can then be used to migrate everything from todoist to Vikunja.", + "produces": [ + "application/json" + ], + "tags": [ + "migration" + ], + "summary": "Get the auth url from todoist", + "responses": { + "200": { + "description": "The auth url.", + "schema": { + "$ref": "#/definitions/handler.AuthURL" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/migration/todoist/migrate": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Migrates all projects, tasks, notes, reminders, subtasks and files from todoist to vikunja.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "migration" + ], + "summary": "Migrate all lists, tasks etc. from todoist", + "parameters": [ + { + "description": "The auth code previously obtained from the auth url. See the docs for /migration/todoist/auth.", + "name": "migrationCode", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/todoist.Migration" + } + } + ], + "responses": { + "200": { + "description": "A message telling you everything was migrated successfully.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/migration/todoist/status": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns if the current user already did the migation or not. This is useful to show a confirmation message in the frontend if the user is trying to do the same migration again.", + "produces": [ + "application/json" + ], + "tags": [ + "migration" + ], + "summary": "Get migration status", + "responses": { + "200": { + "description": "The migration status", + "schema": { + "$ref": "#/definitions/migration.Status" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/migration/trello/auth": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns the auth url where the user needs to get its auth code. This code can then be used to migrate everything from trello to Vikunja.", + "produces": [ + "application/json" + ], + "tags": [ + "migration" + ], + "summary": "Get the auth url from trello", + "responses": { + "200": { + "description": "The auth url.", + "schema": { + "$ref": "#/definitions/handler.AuthURL" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/migration/trello/migrate": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Migrates all projects, tasks, notes, reminders, subtasks and files from trello to vikunja.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "migration" + ], + "summary": "Migrate all projects, tasks etc. from trello", + "parameters": [ + { + "description": "The auth token previously obtained from the auth url. See the docs for /migration/trello/auth.", + "name": "migrationCode", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/trello.Migration" + } + } + ], + "responses": { + "200": { + "description": "A message telling you everything was migrated successfully.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/migration/trello/status": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns if the current user already did the migation or not. This is useful to show a confirmation message in the frontend if the user is trying to do the same migration again.", + "produces": [ + "application/json" + ], + "tags": [ + "migration" + ], + "summary": "Get migration status", + "responses": { + "200": { + "description": "The migration status", + "schema": { + "$ref": "#/definitions/migration.Status" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/migration/vikunja-file/migrate": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Imports all projects, tasks, notes, reminders, subtasks and files from a Vikunjda data export into Vikunja.", + "consumes": [ + "application/x-www-form-urlencoded" + ], + "produces": [ + "application/json" + ], + "tags": [ + "migration" + ], + "summary": "Import all projects, tasks etc. from a Vikunja data export", + "parameters": [ + { + "type": "string", + "description": "The Vikunja export zip file.", + "name": "import", + "in": "formData", + "required": true + } + ], + "responses": { + "200": { + "description": "A message telling you everything was migrated successfully.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/migration/vikunja-file/status": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns if the current user already did the migation or not. This is useful to show a confirmation message in the frontend if the user is trying to do the same migration again.", + "produces": [ + "application/json" + ], + "tags": [ + "migration" + ], + "summary": "Get migration status", + "responses": { + "200": { + "description": "The migration status", + "schema": { + "$ref": "#/definitions/migration.Status" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/notifications": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns an array with all notifications for the current user.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "subscriptions" + ], + "summary": "Get all notifications for the current user", + "parameters": [ + { + "type": "integer", + "description": "The page number. Used for pagination. If not provided, the first page of results is returned.", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page.", + "name": "per_page", + "in": "query" + } + ], + "responses": { + "200": { + "description": "The notifications", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/notifications.DatabaseNotification" + } + } + }, + "403": { + "description": "Link shares cannot have notifications.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "sharing" + ], + "summary": "Mark all notifications of a user as read", + "responses": { + "200": { + "description": "All notifications marked as read.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/notifications/{id}": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Marks a notification as either read or unread. A user can only mark their own notifications as read.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "subscriptions" + ], + "summary": "Mark a notification as (un-)read", + "parameters": [ + { + "type": "integer", + "description": "Notification ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The notification to mark as read.", + "schema": { + "$ref": "#/definitions/models.DatabaseNotifications" + } + }, + "403": { + "description": "Link shares cannot have notifications.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "The notification does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/projects": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns all projects a user has access to.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "project" + ], + "summary": "Get all projects a user has access to", + "parameters": [ + { + "type": "integer", + "description": "The page number. Used for pagination. If not provided, the first page of results is returned.", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page.", + "name": "per_page", + "in": "query" + }, + { + "type": "string", + "description": "Search projects by title.", + "name": "s", + "in": "query" + }, + { + "type": "boolean", + "description": "If true, also returns all archived projects.", + "name": "is_archived", + "in": "query" + } + ], + "responses": { + "200": { + "description": "The projects", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/models.Project" + } + } + }, + "403": { + "description": "The user does not have access to the project", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "put": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Creates a new project. If a parent project is provided the user needs to have write access to that project.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "project" + ], + "summary": "Creates a new project", + "parameters": [ + { + "description": "The project you want to create.", + "name": "project", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.Project" + } + } + ], + "responses": { + "201": { + "description": "The created project.", + "schema": { + "$ref": "#/definitions/models.Project" + } + }, + "400": { + "description": "Invalid project object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "403": { + "description": "The user does not have access to the project", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/projects/{id}": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns a project by its ID.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "project" + ], + "summary": "Gets one project", + "parameters": [ + { + "type": "integer", + "description": "Project ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The project", + "schema": { + "$ref": "#/definitions/models.Project" + } + }, + "403": { + "description": "The user does not have access to the project", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Updates a project. This does not include adding a task (see below).", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "project" + ], + "summary": "Updates a project", + "parameters": [ + { + "type": "integer", + "description": "Project ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "The project with updated values you want to update.", + "name": "project", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.Project" + } + } + ], + "responses": { + "200": { + "description": "The updated project.", + "schema": { + "$ref": "#/definitions/models.Project" + } + }, + "400": { + "description": "Invalid project object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "403": { + "description": "The user does not have access to the project", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "delete": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Delets a project", + "produces": [ + "application/json" + ], + "tags": [ + "project" + ], + "summary": "Deletes a project", + "parameters": [ + { + "type": "integer", + "description": "Project ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The project was successfully deleted.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "400": { + "description": "Invalid project object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "403": { + "description": "The user does not have access to the project", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/projects/{id}/background": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Get the project background of a specific project. **Returns json on error.**", + "produces": [ + "application/octet-stream" + ], + "tags": [ + "project" + ], + "summary": "Get the project background", + "parameters": [ + { + "type": "integer", + "description": "Project ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The project background file.", + "schema": { + "type": "file" + } + }, + "403": { + "description": "No access to this project.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "404": { + "description": "The project does not exist.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "delete": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Removes a previously set project background, regardless of the project provider used to set the background. It does not throw an error if the project does not have a background.", + "produces": [ + "application/json" + ], + "tags": [ + "project" + ], + "summary": "Remove a project background", + "parameters": [ + { + "type": "integer", + "description": "Project ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The project", + "schema": { + "$ref": "#/definitions/models.Project" + } + }, + "403": { + "description": "No access to this project.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "404": { + "description": "The project does not exist.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/projects/{id}/backgrounds/unsplash": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Sets a photo from unsplash as project background.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "project" + ], + "summary": "Set an unsplash photo as project background", + "parameters": [ + { + "type": "integer", + "description": "Project ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "The image you want to set as background", + "name": "project", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/background.Image" + } + } + ], + "responses": { + "200": { + "description": "The background has been successfully set.", + "schema": { + "$ref": "#/definitions/models.Project" + } + }, + "400": { + "description": "Invalid image object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "403": { + "description": "The user does not have access to the project", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/projects/{id}/backgrounds/upload": { + "put": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Upload a project background.", + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "tags": [ + "project" + ], + "summary": "Upload a project background", + "parameters": [ + { + "type": "integer", + "description": "Project ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "The file as single file.", + "name": "background", + "in": "formData", + "required": true + } + ], + "responses": { + "200": { + "description": "The background was set successfully.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "400": { + "description": "File is no image.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "403": { + "description": "File too large.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "404": { + "description": "The project does not exist.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/projects/{id}/projectusers": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Lists all users (without emailadresses). Also possible to search for a specific user.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "project" + ], + "summary": "Get users", + "parameters": [ + { + "type": "string", + "description": "Search for a user by its name.", + "name": "s", + "in": "query" + }, + { + "type": "integer", + "description": "Project ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "All (found) users.", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/user.User" + } + } + }, + "400": { + "description": "Something's invalid.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "401": { + "description": "The user does not have the right to see the project.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal server error.", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/projects/{id}/tasks": { + "put": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Inserts a task into a project.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "Create a task", + "parameters": [ + { + "type": "integer", + "description": "Project ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "The task object", + "name": "task", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.Task" + } + } + ], + "responses": { + "201": { + "description": "The created task object.", + "schema": { + "$ref": "#/definitions/models.Task" + } + }, + "400": { + "description": "Invalid task object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "403": { + "description": "The user does not have access to the project", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/projects/{id}/teams": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns a project with all teams which have access on a given project.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "sharing" + ], + "summary": "Get teams on a project", + "parameters": [ + { + "type": "integer", + "description": "Project ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "The page number. Used for pagination. If not provided, the first page of results is returned.", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page.", + "name": "per_page", + "in": "query" + }, + { + "type": "string", + "description": "Search teams by its name.", + "name": "s", + "in": "query" + } + ], + "responses": { + "200": { + "description": "The teams with their right.", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/models.TeamWithRight" + } + } + }, + "403": { + "description": "No right to see the project.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "put": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Gives a team access to a project.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "sharing" + ], + "summary": "Add a team to a project", + "parameters": [ + { + "type": "integer", + "description": "Project ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "The team you want to add to the project.", + "name": "project", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.TeamProject" + } + } + ], + "responses": { + "201": { + "description": "The created team\u003c-\u003eproject relation.", + "schema": { + "$ref": "#/definitions/models.TeamProject" + } + }, + "400": { + "description": "Invalid team project object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "403": { + "description": "The user does not have access to the project", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "The team does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/projects/{id}/users": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns a project with all users which have access on a given project.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "sharing" + ], + "summary": "Get users on a project", + "parameters": [ + { + "type": "integer", + "description": "Project ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "The page number. Used for pagination. If not provided, the first page of results is returned.", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page.", + "name": "per_page", + "in": "query" + }, + { + "type": "string", + "description": "Search users by its name.", + "name": "s", + "in": "query" + } + ], + "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 project.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "put": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Gives a user access to a project.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "sharing" + ], + "summary": "Add a user to a project", + "parameters": [ + { + "type": "integer", + "description": "Project ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "The user you want to add to the project.", + "name": "project", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.ProjectUser" + } + } + ], + "responses": { + "201": { + "description": "The created user\u003c-\u003eproject relation.", + "schema": { + "$ref": "#/definitions/models.ProjectUser" + } + }, + "400": { + "description": "Invalid user project object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "403": { + "description": "The user does not have access to the project", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "The user does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/projects/{id}/views/{view}/buckets": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns all kanban buckets which belong to that project. Buckets are always sorted by their `position` in ascending order. To get all buckets with their tasks, use the tasks endpoint with a kanban view.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "project" + ], + "summary": "Get all kanban buckets of a project", + "parameters": [ + { + "type": "integer", + "description": "Project ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Project view ID", + "name": "view", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The buckets", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/models.Bucket" + } + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "put": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Creates a new kanban bucket on a project.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "project" + ], + "summary": "Create a new bucket", + "parameters": [ + { + "type": "integer", + "description": "Project Id", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Project view ID", + "name": "view", + "in": "path", + "required": true + }, + { + "description": "The bucket object", + "name": "bucket", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.Bucket" + } + } + ], + "responses": { + "200": { + "description": "The created bucket object.", + "schema": { + "$ref": "#/definitions/models.Bucket" + } + }, + "400": { + "description": "Invalid bucket object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "The project does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/projects/{id}/views/{view}/tasks": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns all tasks for the current project.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "Get tasks in a project", + "parameters": [ + { + "type": "integer", + "description": "The project ID.", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "The project view ID.", + "name": "view", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "The page number. Used for pagination. If not provided, the first page of results is returned.", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page.", + "name": "per_page", + "in": "query" + }, + { + "type": "string", + "description": "Search tasks by task text.", + "name": "s", + "in": "query" + }, + { + "type": "string", + "description": "The sorting parameter. You can pass this multiple times to get the tasks ordered by multiple different parametes, along with `order_by`. Possible values to sort by are `id`, `title`, `description`, `done`, `done_at`, `due_date`, `created_by_id`, `project_id`, `repeat_after`, `priority`, `start_date`, `end_date`, `hex_color`, `percent_done`, `uid`, `created`, `updated`. Default is `id`.", + "name": "sort_by", + "in": "query" + }, + { + "type": "string", + "description": "The ordering parameter. Possible values to order by are `asc` or `desc`. Default is `asc`.", + "name": "order_by", + "in": "query" + }, + { + "type": "string", + "description": "The filter query to match tasks by. Check out https://vikunja.io/docs/filters for a full explanation of the feature.", + "name": "filter", + "in": "query" + }, + { + "type": "string", + "description": "The time zone which should be used for date match (statements like ", + "name": "filter_timezone", + "in": "query" + }, + { + "type": "string", + "description": "If set to true the result will include filtered fields whose value is set to `null`. Available values are `true` or `false`. Defaults to `false`.", + "name": "filter_include_nulls", + "in": "query" + }, + { + "type": "string", + "description": "If set to `subtasks`, Vikunja will fetch only tasks which do not have subtasks and then in a second step, will fetch all of these subtasks. This may result in more tasks than the pagination limit being returned, but all subtasks will be present in the response. You can only set this to `subtasks`.", + "name": "expand", + "in": "query" + } + ], + "responses": { + "200": { + "description": "The tasks", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/models.Task" + } + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/projects/{id}/webhooks": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Get all api webhook targets for the specified project.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "webhooks" + ], + "summary": "Get all api webhook targets for the specified project", + "parameters": [ + { + "type": "integer", + "description": "The page number. Used for pagination. If not provided, the first page of results is returned.", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "The maximum number of items per bucket per page. This parameter is limited by the configured maximum of items per page.", + "name": "per_page", + "in": "query" + }, + { + "type": "integer", + "description": "Project ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The list of all webhook targets", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/models.Webhook" + } + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "put": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Create a webhook target which receives POST requests about specified events from a project.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "webhooks" + ], + "summary": "Create a webhook target", + "parameters": [ + { + "type": "integer", + "description": "Project ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "The webhook target object with required fields", + "name": "webhook", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.Webhook" + } + } + ], + "responses": { + "200": { + "description": "The created webhook target.", + "schema": { + "$ref": "#/definitions/models.Webhook" + } + }, + "400": { + "description": "Invalid webhook object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/projects/{id}/webhooks/{webhookID}": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Change a webhook target's events. You cannot change other values of a webhook.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "webhooks" + ], + "summary": "Change a webhook target's events.", + "parameters": [ + { + "type": "integer", + "description": "Project ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Webhook ID", + "name": "webhookID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Updated webhook target", + "schema": { + "$ref": "#/definitions/models.Webhook" + } + }, + "404": { + "description": "The webhok target does not exist", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "delete": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Delete any of the project's webhook targets.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "webhooks" + ], + "summary": "Deletes an existing webhook target", + "parameters": [ + { + "type": "integer", + "description": "Project ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Webhook ID", + "name": "webhookID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully deleted.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "404": { + "description": "The webhok target does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/projects/{projectID}/duplicate": { + "put": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Copies the project, tasks, files, kanban data, assignees, comments, attachments, lables, relations, backgrounds, user/team rights and link shares from one project to a new one. The user needs read access in the project and write access in the parent of the new project.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "project" + ], + "summary": "Duplicate an existing project", + "parameters": [ + { + "type": "integer", + "description": "The project ID to duplicate", + "name": "projectID", + "in": "path", + "required": true + }, + { + "description": "The target parent project which should hold the copied project.", + "name": "project", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.ProjectDuplicate" + } + } + ], + "responses": { + "201": { + "description": "The created project.", + "schema": { + "$ref": "#/definitions/models.ProjectDuplicate" + } + }, + "400": { + "description": "Invalid project duplicate object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "403": { + "description": "The user does not have access to the project or its parent.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/projects/{projectID}/teams/{teamID}": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Update a team \u003c-\u003e project relation. Mostly used to update the right that team has.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "sharing" + ], + "summary": "Update a team \u003c-\u003e project relation", + "parameters": [ + { + "type": "integer", + "description": "Project ID", + "name": "projectID", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Team ID", + "name": "teamID", + "in": "path", + "required": true + }, + { + "description": "The team you want to update.", + "name": "project", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.TeamProject" + } + } + ], + "responses": { + "200": { + "description": "The updated team \u003c-\u003e project relation.", + "schema": { + "$ref": "#/definitions/models.TeamProject" + } + }, + "403": { + "description": "The user does not have admin-access to the project", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "Team or project does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "delete": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Delets a team from a project. The team won't have access to the project anymore.", + "produces": [ + "application/json" + ], + "tags": [ + "sharing" + ], + "summary": "Delete a team from a project", + "parameters": [ + { + "type": "integer", + "description": "Project ID", + "name": "projectID", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Team ID", + "name": "teamID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The team was successfully deleted.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "403": { + "description": "The user does not have access to the project", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "Team or project does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/projects/{projectID}/users/{userID}": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Update a user \u003c-\u003e project relation. Mostly used to update the right that user has.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "sharing" + ], + "summary": "Update a user \u003c-\u003e project relation", + "parameters": [ + { + "type": "integer", + "description": "Project ID", + "name": "projectID", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "User ID", + "name": "userID", + "in": "path", + "required": true + }, + { + "description": "The user you want to update.", + "name": "project", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.ProjectUser" + } + } + ], + "responses": { + "200": { + "description": "The updated user \u003c-\u003e project relation.", + "schema": { + "$ref": "#/definitions/models.ProjectUser" + } + }, + "403": { + "description": "The user does not have admin-access to the project", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "User or project does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "delete": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Delets a user from a project. The user won't have access to the project anymore.", + "produces": [ + "application/json" + ], + "tags": [ + "sharing" + ], + "summary": "Delete a user from a project", + "parameters": [ + { + "type": "integer", + "description": "Project ID", + "name": "projectID", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "User ID", + "name": "userID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The user was successfully removed from the project.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "403": { + "description": "The user does not have access to the project", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "user or project does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/projects/{projectID}/views/{view}/buckets/{bucketID}": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Updates an existing kanban bucket.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "project" + ], + "summary": "Update an existing bucket", + "parameters": [ + { + "type": "integer", + "description": "Project Id", + "name": "projectID", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Bucket Id", + "name": "bucketID", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Project view ID", + "name": "view", + "in": "path", + "required": true + }, + { + "description": "The bucket object", + "name": "bucket", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.Bucket" + } + } + ], + "responses": { + "200": { + "description": "The created bucket object.", + "schema": { + "$ref": "#/definitions/models.Bucket" + } + }, + "400": { + "description": "Invalid bucket object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "The bucket does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "delete": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Deletes an existing kanban bucket and dissociates all of its task. It does not delete any tasks. You cannot delete the last bucket on a project.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "project" + ], + "summary": "Deletes an existing bucket", + "parameters": [ + { + "type": "integer", + "description": "Project Id", + "name": "projectID", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Bucket Id", + "name": "bucketID", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Project view ID", + "name": "view", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully deleted.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "404": { + "description": "The bucket does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/projects/{project}/shares": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns all link shares which exist for a given project", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "sharing" + ], + "summary": "Get all link shares for a project", + "parameters": [ + { + "type": "integer", + "description": "Project ID", + "name": "project", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "The page number. Used for pagination. If not provided, the first page of results is returned.", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page.", + "name": "per_page", + "in": "query" + }, + { + "type": "string", + "description": "Search shares by hash.", + "name": "s", + "in": "query" + } + ], + "responses": { + "200": { + "description": "The share links", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/models.LinkSharing" + } + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "put": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Share a project via link. The user needs to have write-access to the project to be able do this.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "sharing" + ], + "summary": "Share a project via link", + "parameters": [ + { + "type": "integer", + "description": "Project ID", + "name": "project", + "in": "path", + "required": true + }, + { + "description": "The new link share object", + "name": "label", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.LinkSharing" + } + } + ], + "responses": { + "201": { + "description": "The created link share object.", + "schema": { + "$ref": "#/definitions/models.LinkSharing" + } + }, + "400": { + "description": "Invalid link share object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "403": { + "description": "Not allowed to add the project share.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "The project does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/projects/{project}/shares/{share}": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns one link share by its ID.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "sharing" + ], + "summary": "Get one link shares for a project", + "parameters": [ + { + "type": "integer", + "description": "Project ID", + "name": "project", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Share ID", + "name": "share", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The share links", + "schema": { + "$ref": "#/definitions/models.LinkSharing" + } + }, + "403": { + "description": "No access to the project", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "Share Link not found.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "delete": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Remove a link share. The user needs to have write-access to the project to be able do this.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "sharing" + ], + "summary": "Remove a link share", + "parameters": [ + { + "type": "integer", + "description": "Project ID", + "name": "project", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Share Link ID", + "name": "share", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The link was successfully removed.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "403": { + "description": "Not allowed to remove the link.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "Share Link not found.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/projects/{project}/views": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns all project views for a sepcific project", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "project" + ], + "summary": "Get all project views for a project", + "parameters": [ + { + "type": "integer", + "description": "Project ID", + "name": "project", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The project views", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/models.ProjectView" + } + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "put": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Create a project view in a specific project.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "project" + ], + "summary": "Create a project view", + "parameters": [ + { + "type": "integer", + "description": "Project ID", + "name": "project", + "in": "path", + "required": true + }, + { + "description": "The project view you want to create.", + "name": "view", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.ProjectView" + } + } + ], + "responses": { + "200": { + "description": "The created project view", + "schema": { + "$ref": "#/definitions/models.ProjectView" + } + }, + "403": { + "description": "The user does not have access to create a project view", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/projects/{project}/views/{id}": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns a project view by its ID.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "project" + ], + "summary": "Get one project view", + "parameters": [ + { + "type": "integer", + "description": "Project ID", + "name": "project", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Project View ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The project view", + "schema": { + "$ref": "#/definitions/models.ProjectView" + } + }, + "403": { + "description": "The user does not have access to this project view", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Updates a project view.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "project" + ], + "summary": "Updates a project view", + "parameters": [ + { + "type": "integer", + "description": "Project ID", + "name": "project", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Project View ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "The project view with updated values you want to change.", + "name": "view", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.ProjectView" + } + } + ], + "responses": { + "200": { + "description": "The updated project view.", + "schema": { + "$ref": "#/definitions/models.ProjectView" + } + }, + "400": { + "description": "Invalid project view object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "delete": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Deletes a project view.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "project" + ], + "summary": "Delete a project view", + "parameters": [ + { + "type": "integer", + "description": "Project ID", + "name": "project", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Project View ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The project view was successfully deleted.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "403": { + "description": "The user does not have access to the project view", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/projects/{project}/views/{view}/buckets/{bucket}/tasks": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Updates a task in a bucket", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "Update a task bucket", + "parameters": [ + { + "type": "integer", + "description": "Project ID", + "name": "project", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Project View ID", + "name": "view", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Bucket ID", + "name": "bucket", + "in": "path", + "required": true + }, + { + "description": "The id of the task you want to move into the bucket.", + "name": "taskBucket", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.TaskBucket" + } + } + ], + "responses": { + "200": { + "description": "The updated task bucket.", + "schema": { + "$ref": "#/definitions/models.TaskBucket" + } + }, + "400": { + "description": "Invalid task bucket object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/register": { + "post": { + "description": "Creates a new user account.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "auth" + ], + "summary": "Register", + "parameters": [ + { + "description": "The user credentials", + "name": "credentials", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/user.APIUserPassword" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/user.User" + } + }, + "400": { + "description": "No or invalid user register object provided / User already exists.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/routes": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns a list of all API routes which are available to use with an api token, not a user login.", + "produces": [ + "application/json" + ], + "tags": [ + "api" + ], + "summary": "Get a list of all token api routes", + "responses": { + "200": { + "description": "The list of all routes.", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/models.APITokenRoute" + } + } + } + } + } + }, + "/shares/{share}/auth": { + "post": { + "description": "Get a jwt auth token for a shared project from a share hash.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "sharing" + ], + "summary": "Get an auth token for a share", + "parameters": [ + { + "description": "The password for link shares which require one.", + "name": "password", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.LinkShareAuth" + } + }, + { + "type": "string", + "description": "The share hash", + "name": "share", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The valid jwt auth token.", + "schema": { + "$ref": "#/definitions/auth.Token" + } + }, + "400": { + "description": "Invalid link share object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/subscriptions/{entity}/{entityID}": { + "put": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Subscribes the current user to an entity.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "subscriptions" + ], + "summary": "Subscribes the current user to an entity.", + "parameters": [ + { + "type": "string", + "description": "The entity the user subscribes to. Can be either `project` or `task`.", + "name": "entity", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "The numeric id of the entity to subscribe to.", + "name": "entityID", + "in": "path", + "required": true + } + ], + "responses": { + "201": { + "description": "The subscription", + "schema": { + "$ref": "#/definitions/models.Subscription" + } + }, + "403": { + "description": "The user does not have access to subscribe to this entity.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "412": { + "description": "The subscription entity is invalid.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "delete": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Unsubscribes the current user to an entity.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "subscriptions" + ], + "summary": "Unsubscribe the current user from an entity.", + "parameters": [ + { + "type": "string", + "description": "The entity the user subscribed to. Can be either `project` or `task`.", + "name": "entity", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "The numeric id of the subscribed entity to.", + "name": "entityID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The subscription", + "schema": { + "$ref": "#/definitions/models.Subscription" + } + }, + "403": { + "description": "The user does not have access to subscribe to this entity.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "The subscription does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/tasks/all": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns all tasks on any project the user has access to.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "Get tasks", + "parameters": [ + { + "type": "integer", + "description": "The page number. Used for pagination. If not provided, the first page of results is returned.", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page.", + "name": "per_page", + "in": "query" + }, + { + "type": "string", + "description": "Search tasks by task text.", + "name": "s", + "in": "query" + }, + { + "type": "string", + "description": "The sorting parameter. You can pass this multiple times to get the tasks ordered by multiple different parametes, along with `order_by`. Possible values to sort by are `id`, `title`, `description`, `done`, `done_at`, `due_date`, `created_by_id`, `project_id`, `repeat_after`, `priority`, `start_date`, `end_date`, `hex_color`, `percent_done`, `uid`, `created`, `updated`. Default is `id`.", + "name": "sort_by", + "in": "query" + }, + { + "type": "string", + "description": "The ordering parameter. Possible values to order by are `asc` or `desc`. Default is `asc`.", + "name": "order_by", + "in": "query" + }, + { + "type": "string", + "description": "The filter query to match tasks by. Check out https://vikunja.io/docs/filters for a full explanation of the feature.", + "name": "filter", + "in": "query" + }, + { + "type": "string", + "description": "The time zone which should be used for date match (statements like ", + "name": "filter_timezone", + "in": "query" + }, + { + "type": "string", + "description": "If set to true the result will include filtered fields whose value is set to `null`. Available values are `true` or `false`. Defaults to `false`.", + "name": "filter_include_nulls", + "in": "query" + }, + { + "type": "string", + "description": "If set to `subtasks`, Vikunja will fetch only tasks which do not have subtasks and then in a second step, will fetch all of these subtasks. This may result in more tasks than the pagination limit being returned, but all subtasks will be present in the response. You can only set this to `subtasks`.", + "name": "expand", + "in": "query" + } + ], + "responses": { + "200": { + "description": "The tasks", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/models.Task" + } + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/tasks/bulk": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "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" + ], + "tags": [ + "task" + ], + "summary": "Update a bunch of tasks at once", + "parameters": [ + { + "description": "The task object. Looks like a normal task, the only difference is it uses an array of project_ids to update.", + "name": "task", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.BulkTask" + } + } + ], + "responses": { + "200": { + "description": "The updated task object.", + "schema": { + "$ref": "#/definitions/models.Task" + } + }, + "400": { + "description": "Invalid task object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "403": { + "description": "The user does not have access to the task (aka its project)", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/tasks/{id}": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns one task by its ID", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "Get one task", + "parameters": [ + { + "type": "integer", + "description": "The task ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The task", + "schema": { + "$ref": "#/definitions/models.Task" + } + }, + "404": { + "description": "Task not found", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "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" + ], + "tags": [ + "task" + ], + "summary": "Update a task", + "parameters": [ + { + "type": "integer", + "description": "The Task ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "The task object", + "name": "task", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.Task" + } + } + ], + "responses": { + "200": { + "description": "The updated task object.", + "schema": { + "$ref": "#/definitions/models.Task" + } + }, + "400": { + "description": "Invalid task object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "403": { + "description": "The user does not have access to the task (aka its project)", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "delete": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Deletes a task from a project. This does not mean \"mark it done\".", + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "Delete a task", + "parameters": [ + { + "type": "integer", + "description": "Task ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The created task object.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "400": { + "description": "Invalid task ID provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "403": { + "description": "The user does not have access to the project", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/tasks/{id}/attachments": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Get all task attachments for one task.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "Get all attachments for one task.", + "parameters": [ + { + "type": "integer", + "description": "Task ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "The page number. Used for pagination. If not provided, the first page of results is returned.", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page.", + "name": "per_page", + "in": "query" + } + ], + "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" + } + } + } + }, + "put": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Upload a task attachment. You can pass multiple files with the files form param.", + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "Upload a task attachment", + "parameters": [ + { + "type": "integer", + "description": "Task ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "The file, as multipart form file. You can pass multiple.", + "name": "files", + "in": "formData", + "required": true + } + ], + "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" + } + } + } + } + }, + "/tasks/{id}/attachments/{attachmentID}": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Get one attachment for download. **Returns json on error.**", + "produces": [ + "application/octet-stream" + ], + "tags": [ + "task" + ], + "summary": "Get one attachment.", + "parameters": [ + { + "type": "integer", + "description": "Task ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Attachment ID", + "name": "attachmentID", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "The size of the preview image. Can be sm = 100px, md = 200px, lg = 400px or xl = 800px. If provided, a preview image will be returned if the attachment is an image.", + "name": "preview_size", + "in": "query" + } + ], + "responses": { + "200": { + "description": "The attachment file.", + "schema": { + "type": "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" + } + } + } + }, + "delete": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Delete an attachment.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "Delete an attachment", + "parameters": [ + { + "type": "integer", + "description": "Task ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Attachment ID", + "name": "attachmentID", + "in": "path", + "required": true + } + ], + "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" + } + } + } + } + }, + "/tasks/{id}/position": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Updates a task position.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "Updates a task position", + "parameters": [ + { + "type": "integer", + "description": "Task ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "The task position with updated values you want to change.", + "name": "view", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.TaskPosition" + } + } + ], + "responses": { + "200": { + "description": "The updated task position.", + "schema": { + "$ref": "#/definitions/models.TaskPosition" + } + }, + "400": { + "description": "Invalid task position object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/tasks/{taskID}/assignees": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns an array with all assignees for this task.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "assignees" + ], + "summary": "Get all assignees for a task", + "parameters": [ + { + "type": "integer", + "description": "The page number. Used for pagination. If not provided, the first page of results is returned.", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page.", + "name": "per_page", + "in": "query" + }, + { + "type": "string", + "description": "Search assignees by their username.", + "name": "s", + "in": "query" + }, + { + "type": "integer", + "description": "Task ID", + "name": "taskID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The assignees", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/user.User" + } + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "put": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Adds a new assignee to a task. The assignee needs to have access to the project, the doer must be able to edit this task.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "assignees" + ], + "summary": "Add a new assignee to a task", + "parameters": [ + { + "description": "The assingee object", + "name": "assignee", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.TaskAssginee" + } + }, + { + "type": "integer", + "description": "Task ID", + "name": "taskID", + "in": "path", + "required": true + } + ], + "responses": { + "201": { + "description": "The created assingee object.", + "schema": { + "$ref": "#/definitions/models.TaskAssginee" + } + }, + "400": { + "description": "Invalid assignee object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/tasks/{taskID}/assignees/bulk": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Adds multiple new assignees to a task. The assignee needs to have access to the project, the doer must be able to edit this task. Every user not in the project will be unassigned from the task, pass an empty array to unassign everyone.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "assignees" + ], + "summary": "Add multiple new assignees to a task", + "parameters": [ + { + "description": "The array of assignees", + "name": "assignee", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.BulkAssignees" + } + }, + { + "type": "integer", + "description": "Task ID", + "name": "taskID", + "in": "path", + "required": true + } + ], + "responses": { + "201": { + "description": "The created assingees object.", + "schema": { + "$ref": "#/definitions/models.TaskAssginee" + } + }, + "400": { + "description": "Invalid assignee object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/tasks/{taskID}/assignees/{userID}": { + "delete": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Un-assign a user from a task.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "assignees" + ], + "summary": "Delete an assignee", + "parameters": [ + { + "type": "integer", + "description": "Task ID", + "name": "taskID", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Assignee user ID", + "name": "userID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The assignee was successfully deleted.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "403": { + "description": "Not allowed to delete the assignee.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/tasks/{taskID}/comments": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Get all task comments. The user doing this need to have at least read access to the task.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "Get all task comments", + "parameters": [ + { + "type": "integer", + "description": "Task ID", + "name": "taskID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The array with all task comments", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/models.TaskComment" + } + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "put": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Create a new task comment. The user doing this need to have at least write access to the task this comment should belong to.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "Create a new task comment", + "parameters": [ + { + "description": "The task comment object", + "name": "relation", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.TaskComment" + } + }, + { + "type": "integer", + "description": "Task ID", + "name": "taskID", + "in": "path", + "required": true + } + ], + "responses": { + "201": { + "description": "The created task comment object.", + "schema": { + "$ref": "#/definitions/models.TaskComment" + } + }, + "400": { + "description": "Invalid task comment object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/tasks/{taskID}/comments/{commentID}": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Remove a task comment. The user doing this need to have at least read access to the task this comment belongs to.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "Remove a task comment", + "parameters": [ + { + "type": "integer", + "description": "Task ID", + "name": "taskID", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Comment ID", + "name": "commentID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The task comment object.", + "schema": { + "$ref": "#/definitions/models.TaskComment" + } + }, + "400": { + "description": "Invalid task comment object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "The task comment was not found.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Update an existing task comment. The user doing this need to have at least write access to the task this comment belongs to.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "Update an existing task comment", + "parameters": [ + { + "type": "integer", + "description": "Task ID", + "name": "taskID", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Comment ID", + "name": "commentID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The updated task comment object.", + "schema": { + "$ref": "#/definitions/models.TaskComment" + } + }, + "400": { + "description": "Invalid task comment object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "The task comment was not found.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "delete": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Remove a task comment. The user doing this need to have at least write access to the task this comment belongs to.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "Remove a task comment", + "parameters": [ + { + "type": "integer", + "description": "Task ID", + "name": "taskID", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Comment ID", + "name": "commentID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The task comment was successfully deleted.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "400": { + "description": "Invalid task comment object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "The task comment was not found.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/tasks/{taskID}/labels/bulk": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "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" + ], + "tags": [ + "labels" + ], + "summary": "Update all labels on a task.", + "parameters": [ + { + "description": "The array of labels", + "name": "label", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.LabelTaskBulk" + } + }, + { + "type": "integer", + "description": "Task ID", + "name": "taskID", + "in": "path", + "required": true + } + ], + "responses": { + "201": { + "description": "The updated labels object.", + "schema": { + "$ref": "#/definitions/models.LabelTaskBulk" + } + }, + "400": { + "description": "Invalid label object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/tasks/{taskID}/relations": { + "put": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "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 project. Take a look at the docs for available task relation kinds.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "Create a new relation between two tasks", + "parameters": [ + { + "description": "The relation object", + "name": "relation", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.TaskRelation" + } + }, + { + "type": "integer", + "description": "Task ID", + "name": "taskID", + "in": "path", + "required": true + } + ], + "responses": { + "201": { + "description": "The created task relation object.", + "schema": { + "$ref": "#/definitions/models.TaskRelation" + } + }, + "400": { + "description": "Invalid task relation object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/tasks/{taskID}/relations/{relationKind}/{otherTaskID}": { + "delete": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "Remove a task relation", + "parameters": [ + { + "description": "The relation object", + "name": "relation", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.TaskRelation" + } + }, + { + "type": "integer", + "description": "Task ID", + "name": "taskID", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "The kind of the relation. See the TaskRelation type for more info.", + "name": "relationKind", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "The id of the other task.", + "name": "otherTaskID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The task relation was successfully deleted.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "400": { + "description": "Invalid task relation object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "The task relation was not found.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/tasks/{task}/labels": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns all labels which are assicociated with a given task.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "labels" + ], + "summary": "Get all labels on a task", + "parameters": [ + { + "type": "integer", + "description": "Task ID", + "name": "task", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "The page number. Used for pagination. If not provided, the first page of results is returned.", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page.", + "name": "per_page", + "in": "query" + }, + { + "type": "string", + "description": "Search labels by label text.", + "name": "s", + "in": "query" + } + ], + "responses": { + "200": { + "description": "The labels", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/models.Label" + } + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "put": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Add a label to a task. The user needs to have write-access to the project to be able do this.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "labels" + ], + "summary": "Add a label to a task", + "parameters": [ + { + "type": "integer", + "description": "Task ID", + "name": "task", + "in": "path", + "required": true + }, + { + "description": "The label object", + "name": "label", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.LabelTask" + } + } + ], + "responses": { + "201": { + "description": "The created label relation object.", + "schema": { + "$ref": "#/definitions/models.LabelTask" + } + }, + "400": { + "description": "Invalid label object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "403": { + "description": "Not allowed to add the label.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "The label does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/tasks/{task}/labels/{label}": { + "delete": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Remove a label from a task. The user needs to have write-access to the project to be able do this.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "labels" + ], + "summary": "Remove a label from a task", + "parameters": [ + { + "type": "integer", + "description": "Task ID", + "name": "task", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Label ID", + "name": "label", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The label was successfully removed.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "403": { + "description": "Not allowed to remove the label.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "Label not found.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/teams": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns all teams the current user is part of.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "team" + ], + "summary": "Get teams", + "parameters": [ + { + "type": "integer", + "description": "The page number. Used for pagination. If not provided, the first page of results is returned.", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page.", + "name": "per_page", + "in": "query" + }, + { + "type": "string", + "description": "Search teams by its name.", + "name": "s", + "in": "query" + } + ], + "responses": { + "200": { + "description": "The teams.", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/models.Team" + } + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "put": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Creates a new team.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "team" + ], + "summary": "Creates a new team", + "parameters": [ + { + "description": "The team you want to create.", + "name": "team", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.Team" + } + } + ], + "responses": { + "201": { + "description": "The created team.", + "schema": { + "$ref": "#/definitions/models.Team" + } + }, + "400": { + "description": "Invalid team object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/teams/{id}": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns a team by its ID.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "team" + ], + "summary": "Gets one team", + "parameters": [ + { + "type": "integer", + "description": "Team ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The team", + "schema": { + "$ref": "#/definitions/models.Team" + } + }, + "403": { + "description": "The user does not have access to the team", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Updates a team.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "team" + ], + "summary": "Updates a team", + "parameters": [ + { + "type": "integer", + "description": "Team ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "The team with updated values you want to update.", + "name": "team", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.Team" + } + } + ], + "responses": { + "200": { + "description": "The updated team.", + "schema": { + "$ref": "#/definitions/models.Team" + } + }, + "400": { + "description": "Invalid team object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "delete": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Delets a team. This will also remove the access for all users in that team.", + "produces": [ + "application/json" + ], + "tags": [ + "team" + ], + "summary": "Deletes a team", + "parameters": [ + { + "type": "integer", + "description": "Team ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The team was successfully deleted.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "400": { + "description": "Invalid team object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/teams/{id}/members": { + "put": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Add a user to a team.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "team" + ], + "summary": "Add a user to a team", + "parameters": [ + { + "type": "integer", + "description": "Team ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "The user to be added to a team.", + "name": "team", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.TeamMember" + } + } + ], + "responses": { + "201": { + "description": "The newly created member object", + "schema": { + "$ref": "#/definitions/models.TeamMember" + } + }, + "400": { + "description": "Invalid member object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "403": { + "description": "The user does not have access to the team", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/teams/{id}/members/{userID}": { + "delete": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Remove a user from a team. This will also revoke any access this user might have via that team. A user can remove themselves from the team if they are not the last user in the team.", + "produces": [ + "application/json" + ], + "tags": [ + "team" + ], + "summary": "Remove a user from a team", + "parameters": [ + { + "type": "integer", + "description": "Team ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "User ID", + "name": "userID", + "in": "path", + "required": true + } + ], + "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" + } + } + } + } + }, + "/teams/{id}/members/{userID}/admin": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "If a user is team admin, this will make them member and vise-versa.", + "produces": [ + "application/json" + ], + "tags": [ + "team" + ], + "summary": "Toggle a team member's admin status", + "parameters": [ + { + "type": "integer", + "description": "Team ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "User ID", + "name": "userID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The member right was successfully changed.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/test/{table}": { + "patch": { + "description": "Fills the specified table with the content provided in the payload. You need to enable the testing endpoint before doing this and provide the `Authorization: \u003ctoken\u003e` secret when making requests to this endpoint. See docs for more details.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "testing" + ], + "summary": "Reset the db to a defined state", + "parameters": [ + { + "type": "string", + "description": "The table to reset", + "name": "table", + "in": "path", + "required": true + } + ], + "responses": { + "201": { + "description": "Everything has been imported successfully.", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/user.User" + } + } + }, + "500": { + "description": "Internal server error.", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/tokens": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns all api tokens the current user has created.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "api" + ], + "summary": "Get all api tokens of the current user", + "parameters": [ + { + "type": "integer", + "description": "The page number, used for pagination. If not provided, the first page of results is returned.", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "The maximum number of tokens per page. This parameter is limited by the configured maximum of items per page.", + "name": "per_page", + "in": "query" + }, + { + "type": "string", + "description": "Search tokens by their title.", + "name": "s", + "in": "query" + } + ], + "responses": { + "200": { + "description": "The list of all tokens", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/models.APIToken" + } + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "put": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Create a new api token to use on behalf of the user creating it.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "api" + ], + "summary": "Create a new api token", + "parameters": [ + { + "description": "The token object with required fields", + "name": "token", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.APIToken" + } + } + ], + "responses": { + "200": { + "description": "The created token.", + "schema": { + "$ref": "#/definitions/models.APIToken" + } + }, + "400": { + "description": "Invalid token object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/tokens/{tokenID}": { + "delete": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Delete any of the user's api tokens.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "api" + ], + "summary": "Deletes an existing api token", + "parameters": [ + { + "type": "integer", + "description": "Token ID", + "name": "tokenID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully deleted.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "404": { + "description": "The token does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/user": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns the current user object with their settings.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Get user information", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.UserWithSettings" + } + }, + "404": { + "description": "User does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal server error.", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/user/confirm": { + "post": { + "description": "Confirms the email of a newly registered user.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Confirm the email of a new user", + "parameters": [ + { + "description": "The token.", + "name": "credentials", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/user.EmailConfirm" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "412": { + "description": "Bad token provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/user/deletion/cancel": { + "post": { + "description": "Aborts an in-progress user deletion.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Abort a user deletion request", + "parameters": [ + { + "description": "The user password to confirm.", + "name": "credentials", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.UserPasswordConfirmation" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "412": { + "description": "Bad password provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/user/deletion/confirm": { + "post": { + "description": "Confirms the deletion request of a user sent via email.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Confirm a user deletion request", + "parameters": [ + { + "description": "The token.", + "name": "credentials", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.UserDeletionRequestConfirm" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "412": { + "description": "Bad token provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/user/deletion/request": { + "post": { + "description": "Requests the deletion of the current user. It will trigger an email which has to be confirmed to start the deletion.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Request the deletion of the user", + "parameters": [ + { + "description": "The user password.", + "name": "credentials", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.UserPasswordConfirmation" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "412": { + "description": "Bad password provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/user/export/download": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Download a user data export.", + "parameters": [ + { + "description": "User password to confirm the download.", + "name": "password", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.UserPasswordConfirmation" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "400": { + "description": "Something's invalid.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal server error.", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/user/export/request": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Request a user data export.", + "parameters": [ + { + "description": "User password to confirm the data export request.", + "name": "password", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.UserPasswordConfirmation" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "400": { + "description": "Something's invalid.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal server error.", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/user/password": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Lets the current user change its password.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Change password", + "parameters": [ + { + "description": "The current and new password.", + "name": "userPassword", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.UserPassword" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "400": { + "description": "Something's invalid.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "User does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal server error.", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/user/password/reset": { + "post": { + "description": "Resets a user email with a previously reset token.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Resets a password", + "parameters": [ + { + "description": "The token with the new password.", + "name": "credentials", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/user.PasswordReset" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "400": { + "description": "Bad token provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/user/password/token": { + "post": { + "description": "Requests a token to reset a users password. The token is sent via email.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Request password reset token", + "parameters": [ + { + "description": "The username of the user to request a token for.", + "name": "credentials", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/user.PasswordTokenRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "404": { + "description": "The user does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/user/settings/avatar": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns the current user's avatar setting.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Return user avatar setting", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.UserAvatarProvider" + } + }, + "400": { + "description": "Something's invalid.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal server error.", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Changes the user avatar. Valid types are gravatar (uses the user email), upload, initials, default.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Set the user's avatar", + "parameters": [ + { + "description": "The user's avatar setting", + "name": "avatar", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.UserAvatarProvider" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "400": { + "description": "Something's invalid.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal server error.", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/user/settings/avatar/upload": { + "put": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Upload a user avatar. This will also set the user's avatar provider to \"upload\"", + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Upload a user avatar", + "parameters": [ + { + "type": "string", + "description": "The avatar as single file.", + "name": "avatar", + "in": "formData", + "required": true + } + ], + "responses": { + "200": { + "description": "The avatar was set successfully.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "400": { + "description": "File is no image.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "403": { + "description": "File too large.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/user/settings/email": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Lets the current user change their email address.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Update email address", + "parameters": [ + { + "description": "The new email address and current password.", + "name": "userEmailUpdate", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/user.EmailUpdate" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "400": { + "description": "Something's invalid.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "User does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal server error.", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/user/settings/general": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Change general user settings of the current user.", + "parameters": [ + { + "description": "The updated user settings", + "name": "avatar", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.UserSettings" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "400": { + "description": "Something's invalid.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal server error.", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/user/settings/token/caldav": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Return the IDs and created dates of all caldav tokens for the current user.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Returns the caldav tokens for the current user", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/user.Token" + } + } + }, + "400": { + "description": "Something's invalid.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "User does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal server error.", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "put": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Generates a caldav token which can be used for the caldav api. It is not possible to see the token again after it was generated.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Generate a caldav token", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/user.Token" + } + }, + "400": { + "description": "Something's invalid.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "User does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal server error.", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/user/settings/token/caldav/{id}": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Delete a caldav token by id", + "parameters": [ + { + "type": "integer", + "description": "Token ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "400": { + "description": "Something's invalid.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "User does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal server error.", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/user/settings/totp": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns the current user totp setting or an error if it is not enabled.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Totp setting for the current user", + "responses": { + "200": { + "description": "The totp settings.", + "schema": { + "$ref": "#/definitions/user.TOTP" + } + }, + "500": { + "description": "Internal server error.", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/user/settings/totp/disable": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Disables any totp settings for the current user.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Disable totp settings", + "parameters": [ + { + "description": "The current user's password (only password is enough).", + "name": "totp", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/user.Login" + } + } + ], + "responses": { + "200": { + "description": "Successfully disabled", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "400": { + "description": "Something's invalid.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "User does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal server error.", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/user/settings/totp/enable": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Enables a previously enrolled totp setting by providing a totp passcode.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Enable a previously enrolled totp setting.", + "parameters": [ + { + "description": "The totp passcode.", + "name": "totp", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/user.TOTPPasscode" + } + } + ], + "responses": { + "200": { + "description": "Successfully enabled", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "400": { + "description": "Something's invalid.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "User does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "412": { + "description": "TOTP is not enrolled.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal server error.", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/user/settings/totp/enroll": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Creates an initial setup for the user in the db. After this step, the user needs to verify they have a working totp setup with the \"enable totp\" endpoint.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Enroll a user into totp", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/user.TOTP" + } + }, + "400": { + "description": "Something's invalid.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "User does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal server error.", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/user/settings/totp/qrcode": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns a qr code for easier setup at end user's devices.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Totp QR Code", + "responses": { + "200": { + "description": "The qr code as jpeg image", + "schema": { + "type": "file" + } + }, + "500": { + "description": "Internal server error.", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/user/timezones": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Because available time zones depend on the system Vikunja is running on, this endpoint returns a project of all valid time zones this particular Vikunja instance can handle. The project of time zones is not sorted, you should sort it on the client.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Get all available time zones on this vikunja instance", + "responses": { + "200": { + "description": "All available time zones.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "500": { + "description": "Internal server error.", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/user/token": { + "post": { + "description": "Returns a new valid jwt user token with an extended length.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Renew user token", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/auth.Token" + } + }, + "400": { + "description": "Only user token are available for renew.", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/users": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Search for a user by its username, name or full email. Name (not username) or email require that the user has enabled this in their settings.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Get users", + "parameters": [ + { + "type": "string", + "description": "The search criteria.", + "name": "s", + "in": "query" + } + ], + "responses": { + "200": { + "description": "All (found) users.", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/user.User" + } + } + }, + "400": { + "description": "Something's invalid.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal server error.", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/webhooks/events": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Get all possible webhook events to use when creating or updating a webhook target.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "webhooks" + ], + "summary": "Get all possible webhook events", + "responses": { + "200": { + "description": "The list of all possible webhook events", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/{kind}/{id}/reactions": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns all reactions for an entity", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "Get all reactions for an entity", + "parameters": [ + { + "type": "integer", + "description": "Entity ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "The kind of the entity. Can be either `tasks` or `comments` for task comments", + "name": "kind", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The reactions", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/models.ReactionMap" + } + } + }, + "403": { + "description": "The user does not have access to the entity", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "put": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Add a reaction to an entity. Will do nothing if the reaction already exists.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "Add a reaction to an entity", + "parameters": [ + { + "type": "integer", + "description": "Entity ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "The kind of the entity. Can be either `tasks` or `comments` for task comments", + "name": "kind", + "in": "path", + "required": true + }, + { + "description": "The reaction you want to add to the entity.", + "name": "project", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.Reaction" + } + } + ], + "responses": { + "200": { + "description": "The created reaction", + "schema": { + "$ref": "#/definitions/models.Reaction" + } + }, + "403": { + "description": "The user does not have access to the entity", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/{kind}/{id}/reactions/delete": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Removes the reaction of that user on that entity.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "Removes the user's reaction", + "parameters": [ + { + "type": "integer", + "description": "Entity ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "The kind of the entity. Can be either `tasks` or `comments` for task comments", + "name": "kind", + "in": "path", + "required": true + }, + { + "description": "The reaction you want to add to the entity.", + "name": "project", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.Reaction" + } + } + ], + "responses": { + "200": { + "description": "The reaction was successfully removed.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "403": { + "description": "The user does not have access to the entity", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/{username}/avatar": { + "get": { + "description": "Returns the user avatar as image.", + "produces": [ + "application/octet-stream" + ], + "tags": [ + "user" + ], + "summary": "User Avatar", + "parameters": [ + { + "type": "string", + "description": "The username of the user who's avatar you want to get", + "name": "username", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "The size of the avatar you want to get. If bigger than the max configured size this will be adjusted to the maximum size.", + "name": "size", + "in": "query" + } + ], + "responses": { + "200": { + "description": "The avatar", + "schema": { + "type": "file" + } + }, + "404": { + "description": "The user does not exist.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + } + }, + "definitions": { + "auth.Token": { + "type": "object", + "properties": { + "token": { + "type": "string", + "example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" + } + } + }, + "background.Image": { + "type": "object", + "properties": { + "blur_hash": { + "type": "string" + }, + "id": { + "type": "string" + }, + "info": { + "description": "This can be used to supply extra information from an image provider to clients" + }, + "thumb": { + "type": "string" + }, + "url": { + "type": "string" + } + } + }, + "files.File": { + "type": "object", + "properties": { + "created": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "mime": { + "type": "string" + }, + "name": { + "type": "string" + }, + "size": { + "type": "integer" + } + } + }, + "handler.AuthURL": { + "type": "object", + "properties": { + "url": { + "type": "string" + } + } + }, + "microsofttodo.Migration": { + "type": "object", + "properties": { + "code": { + "type": "string" + } + } + }, + "migration.Status": { + "type": "object", + "properties": { + "finished_at": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "migrator_name": { + "type": "string" + }, + "started_at": { + "type": "string" + } + } + }, + "models.APIPermissions": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "models.APIToken": { + "type": "object", + "properties": { + "created": { + "description": "A timestamp when this api key was created. You cannot change this value.", + "type": "string" + }, + "expires_at": { + "description": "The date when this key expires.", + "type": "string" + }, + "id": { + "description": "The unique, numeric id of this api key.", + "type": "integer" + }, + "permissions": { + "description": "The permissions this token has. Possible values are available via the /routes endpoint and consist of the keys of the list from that endpoint. For example, if the token should be able to read all tasks as well as update existing tasks, you should add `{\"tasks\":[\"read_all\",\"update\"]}`.", + "allOf": [ + { + "$ref": "#/definitions/models.APIPermissions" + } + ] + }, + "title": { + "description": "A human-readable name for this token", + "type": "string" + }, + "token": { + "description": "The actual api key. Only visible after creation.", + "type": "string" + } + } + }, + "models.APITokenRoute": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/models.RouteDetail" + } + }, + "models.Bucket": { + "type": "object", + "properties": { + "count": { + "description": "The number of tasks currently in this bucket", + "type": "integer" + }, + "created": { + "description": "A timestamp when this bucket was created. You cannot change this value.", + "type": "string" + }, + "created_by": { + "description": "The user who initially created the bucket.", + "allOf": [ + { + "$ref": "#/definitions/user.User" + } + ] + }, + "id": { + "description": "The unique, numeric id of this bucket.", + "type": "integer" + }, + "limit": { + "description": "How many tasks can be at the same time on this board max", + "type": "integer", + "minimum": 0 + }, + "position": { + "description": "The position this bucket has when querying all buckets. See the tasks.position property on how to use this.", + "type": "number" + }, + "project_view_id": { + "description": "The project view this bucket belongs to.", + "type": "integer" + }, + "tasks": { + "description": "All tasks which belong to this bucket.", + "type": "array", + "items": { + "$ref": "#/definitions/models.Task" + } + }, + "title": { + "description": "The title of this bucket.", + "type": "string", + "minLength": 1 + }, + "updated": { + "description": "A timestamp when this bucket was last updated. You cannot change this value.", + "type": "string" + } + } + }, + "models.BucketConfigurationModeKind": { + "type": "integer", + "enum": [ + 0, + 1, + 2 + ], + "x-enum-varnames": [ + "BucketConfigurationModeNone", + "BucketConfigurationModeManual", + "BucketConfigurationModeFilter" + ] + }, + "models.BulkAssignees": { + "type": "object", + "properties": { + "assignees": { + "description": "A project with all assignees", + "type": "array", + "items": { + "$ref": "#/definitions/user.User" + } + } + } + }, + "models.BulkTask": { + "type": "object", + "properties": { + "assignees": { + "description": "An array of users who are assigned to this task", + "type": "array", + "items": { + "$ref": "#/definitions/user.User" + } + }, + "attachments": { + "description": "All attachments this task has. This property is read-onlym, you must use the separate endpoint to add attachments to a task.", + "type": "array", + "items": { + "$ref": "#/definitions/models.TaskAttachment" + } + }, + "bucket_id": { + "description": "The bucket id. Will only be populated when the task is accessed via a view with buckets.\nCan be used to move a task between buckets. In that case, the new bucket must be in the same view as the old one.", + "type": "integer" + }, + "cover_image_attachment_id": { + "description": "If this task has a cover image, the field will return the id of the attachment that is the cover image.", + "type": "integer" + }, + "created": { + "description": "A timestamp when this task was created. You cannot change this value.", + "type": "string" + }, + "created_by": { + "description": "The user who initially created the task.", + "allOf": [ + { + "$ref": "#/definitions/user.User" + } + ] + }, + "description": { + "description": "The task description.", + "type": "string" + }, + "done": { + "description": "Whether a task is done or not.", + "type": "boolean" + }, + "done_at": { + "description": "The time when a task was marked as done.", + "type": "string" + }, + "due_date": { + "description": "The time when the task is due.", + "type": "string" + }, + "end_date": { + "description": "When this task ends.", + "type": "string" + }, + "hex_color": { + "description": "The task color in hex", + "type": "string", + "maxLength": 7 + }, + "id": { + "description": "The unique, numeric id of this task.", + "type": "integer" + }, + "identifier": { + "description": "The task identifier, based on the project identifier and the task's index", + "type": "string" + }, + "index": { + "description": "The task index, calculated per project", + "type": "integer" + }, + "is_favorite": { + "description": "True if a task is a favorite task. Favorite tasks show up in a separate \"Important\" project. This value depends on the user making the call to the api.", + "type": "boolean" + }, + "labels": { + "description": "An array of labels which are associated with this task. This property is read-only, you must use the separate endpoint to add labels to a task.", + "type": "array", + "items": { + "$ref": "#/definitions/models.Label" + } + }, + "percent_done": { + "description": "Determines how far a task is left from being done", + "type": "number" + }, + "position": { + "description": "The position of the task - any task project can be sorted as usual by this parameter.\nWhen accessing tasks via views with buckets, this is primarily used to sort them based on a range.\nPositions are always saved per view. They will automatically be set if you request the tasks through a view\nendpoint, otherwise they will always be 0. To update them, take a look at the Task Position endpoint.", + "type": "number" + }, + "priority": { + "description": "The task priority. Can be anything you want, it is possible to sort by this later.", + "type": "integer" + }, + "project_id": { + "description": "The project this task belongs to.", + "type": "integer" + }, + "reactions": { + "description": "Reactions on that task.", + "allOf": [ + { + "$ref": "#/definitions/models.ReactionMap" + } + ] + }, + "related_tasks": { + "description": "All related tasks, grouped by their relation kind", + "allOf": [ + { + "$ref": "#/definitions/models.RelatedTaskMap" + } + ] + }, + "reminders": { + "description": "An array of reminders that are associated with this task.", + "type": "array", + "items": { + "$ref": "#/definitions/models.TaskReminder" + } + }, + "repeat_after": { + "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.", + "type": "integer" + }, + "repeat_mode": { + "description": "Can have three possible values which will trigger when the task is marked as done: 0 = repeats after the amount specified in repeat_after, 1 = repeats all dates each months (ignoring repeat_after), 3 = repeats from the current date rather than the last set date.", + "allOf": [ + { + "$ref": "#/definitions/models.TaskRepeatMode" + } + ] + }, + "start_date": { + "description": "When this task starts.", + "type": "string" + }, + "subscription": { + "description": "The subscription status for the user reading this task. You can only read this property, use the subscription endpoints to modify it.\nWill only returned when retrieving one task.", + "allOf": [ + { + "$ref": "#/definitions/models.Subscription" + } + ] + }, + "task_ids": { + "description": "A project of task ids to update", + "type": "array", + "items": { + "type": "integer" + } + }, + "title": { + "description": "The task text. This is what you'll see in the project.", + "type": "string", + "minLength": 1 + }, + "updated": { + "description": "A timestamp when this task was last updated. You cannot change this value.", + "type": "string" + } + } + }, + "models.DatabaseNotifications": { + "type": "object", + "properties": { + "created": { + "description": "A timestamp when this notification was created. You cannot change this value.", + "type": "string" + }, + "id": { + "description": "The unique, numeric id of this notification.", + "type": "integer" + }, + "name": { + "description": "The name of the notification", + "type": "string" + }, + "notification": { + "description": "The actual content of the notification." + }, + "read": { + "description": "Whether or not to mark this notification as read or unread.\nTrue is read, false is unread.", + "type": "boolean" + }, + "read_at": { + "description": "When this notification is marked as read, this will be updated with the current timestamp.", + "type": "string" + } + } + }, + "models.Label": { + "type": "object", + "properties": { + "created": { + "description": "A timestamp when this label was created. You cannot change this value.", + "type": "string" + }, + "created_by": { + "description": "The user who created this label", + "allOf": [ + { + "$ref": "#/definitions/user.User" + } + ] + }, + "description": { + "description": "The label description.", + "type": "string" + }, + "hex_color": { + "description": "The color this label has in hex format.", + "type": "string", + "maxLength": 7 + }, + "id": { + "description": "The unique, numeric id of this label.", + "type": "integer" + }, + "title": { + "description": "The title of the lable. You'll see this one on tasks associated with it.", + "type": "string", + "maxLength": 250, + "minLength": 1 + }, + "updated": { + "description": "A timestamp when this label was last updated. You cannot change this value.", + "type": "string" + } + } + }, + "models.LabelTask": { + "type": "object", + "properties": { + "created": { + "description": "A timestamp when this task was created. You cannot change this value.", + "type": "string" + }, + "label_id": { + "description": "The label id you want to associate with a task.", + "type": "integer" + } + } + }, + "models.LabelTaskBulk": { + "type": "object", + "properties": { + "labels": { + "description": "All labels you want to update at once.", + "type": "array", + "items": { + "$ref": "#/definitions/models.Label" + } + } + } + }, + "models.LinkSharing": { + "type": "object", + "properties": { + "created": { + "description": "A timestamp when this project was shared. You cannot change this value.", + "type": "string" + }, + "hash": { + "description": "The public id to get this shared project", + "type": "string" + }, + "id": { + "description": "The ID of the shared thing", + "type": "integer" + }, + "name": { + "description": "The name of this link share. All actions someone takes while being authenticated with that link will appear with that name.", + "type": "string" + }, + "password": { + "description": "The password of this link share. You can only set it, not retrieve it after the link share has been created.", + "type": "string" + }, + "right": { + "description": "The right this project is shared with. 0 = Read only, 1 = Read \u0026 Write, 2 = Admin. See the docs for more details.", + "default": 0, + "maximum": 2, + "allOf": [ + { + "$ref": "#/definitions/models.Right" + } + ] + }, + "shared_by": { + "description": "The user who shared this project", + "allOf": [ + { + "$ref": "#/definitions/user.User" + } + ] + }, + "sharing_type": { + "description": "The kind of this link. 0 = undefined, 1 = without password, 2 = with password.", + "default": 0, + "maximum": 2, + "allOf": [ + { + "$ref": "#/definitions/models.SharingType" + } + ] + }, + "updated": { + "description": "A timestamp when this share was last updated. You cannot change this value.", + "type": "string" + } + } + }, + "models.Message": { + "type": "object", + "properties": { + "message": { + "description": "A standard message.", + "type": "string" + } + } + }, + "models.Project": { + "type": "object", + "properties": { + "background_blur_hash": { + "description": "Contains a very small version of the project background to use as a blurry preview until the actual background is loaded. Check out https://blurha.sh/ to learn how it works.", + "type": "string" + }, + "background_information": { + "description": "Holds extra information about the background set since some background providers require attribution or similar. If not null, the background can be accessed at /projects/{projectID}/background" + }, + "created": { + "description": "A timestamp when this project was created. You cannot change this value.", + "type": "string" + }, + "description": { + "description": "The description of the project.", + "type": "string" + }, + "hex_color": { + "description": "The hex color of this project", + "type": "string", + "maxLength": 7 + }, + "id": { + "description": "The unique, numeric id of this project.", + "type": "integer" + }, + "identifier": { + "description": "The unique project short identifier. Used to build task identifiers.", + "type": "string", + "maxLength": 10, + "minLength": 0 + }, + "is_archived": { + "description": "Whether a project is archived.", + "type": "boolean" + }, + "is_favorite": { + "description": "True if a project is a favorite. Favorite projects show up in a separate parent project. This value depends on the user making the call to the api.", + "type": "boolean" + }, + "owner": { + "description": "The user who created this project.", + "allOf": [ + { + "$ref": "#/definitions/user.User" + } + ] + }, + "parent_project_id": { + "type": "integer" + }, + "position": { + "description": "The position this project has when querying all projects. See the tasks.position property on how to use this.", + "type": "number" + }, + "subscription": { + "description": "The subscription status for the user reading this project. You can only read this property, use the subscription endpoints to modify it.\nWill only returned when retreiving one project.", + "allOf": [ + { + "$ref": "#/definitions/models.Subscription" + } + ] + }, + "title": { + "description": "The title of the project. You'll see this in the overview.", + "type": "string", + "maxLength": 250, + "minLength": 1 + }, + "updated": { + "description": "A timestamp when this project was last updated. You cannot change this value.", + "type": "string" + }, + "views": { + "type": "array", + "items": { + "$ref": "#/definitions/models.ProjectView" + } + } + } + }, + "models.ProjectDuplicate": { + "type": "object", + "properties": { + "duplicated_project": { + "description": "The copied project", + "allOf": [ + { + "$ref": "#/definitions/models.Project" + } + ] + }, + "parent_project_id": { + "description": "The target parent project", + "type": "integer" + } + } + }, + "models.ProjectUser": { + "type": "object", + "properties": { + "created": { + "description": "A timestamp when this relation was created. You cannot change this value.", + "type": "string" + }, + "id": { + "description": "The unique, numeric id of this project \u003c-\u003e user relation.", + "type": "integer" + }, + "right": { + "description": "The right this user has. 0 = Read only, 1 = Read \u0026 Write, 2 = Admin. See the docs for more details.", + "default": 0, + "maximum": 2, + "allOf": [ + { + "$ref": "#/definitions/models.Right" + } + ] + }, + "updated": { + "description": "A timestamp when this relation was last updated. You cannot change this value.", + "type": "string" + }, + "user_id": { + "description": "The username.", + "type": "string" + } + } + }, + "models.ProjectView": { + "type": "object", + "properties": { + "bucket_configuration": { + "description": "When the bucket configuration mode is not `manual`, this field holds the options of that configuration.", + "type": "array", + "items": { + "$ref": "#/definitions/models.ProjectViewBucketConfiguration" + } + }, + "bucket_configuration_mode": { + "description": "The bucket configuration mode. Can be `none`, `manual` or `filter`. `manual` allows to move tasks between buckets as you normally would. `filter` creates buckets based on a filter for each bucket.", + "allOf": [ + { + "$ref": "#/definitions/models.BucketConfigurationModeKind" + } + ] + }, + "created": { + "description": "A timestamp when this reaction was created. You cannot change this value.", + "type": "string" + }, + "default_bucket_id": { + "description": "The ID of the bucket where new tasks without a bucket are added to. By default, this is the leftmost bucket in a view.", + "type": "integer" + }, + "done_bucket_id": { + "description": "If tasks are moved to the done bucket, they are marked as done. If they are marked as done individually, they are moved into the done bucket.", + "type": "integer" + }, + "filter": { + "description": "The filter query to match tasks by. Check out https://vikunja.io/docs/filters for a full explanation.", + "type": "string" + }, + "id": { + "description": "The unique numeric id of this view", + "type": "integer" + }, + "position": { + "description": "The position of this view in the list. The list of all views will be sorted by this parameter.", + "type": "number" + }, + "project_id": { + "description": "The project this view belongs to", + "type": "integer" + }, + "title": { + "description": "The title of this view", + "type": "string" + }, + "updated": { + "description": "A timestamp when this view was updated. You cannot change this value.", + "type": "string" + }, + "view_kind": { + "description": "The kind of this view. Can be `list`, `gantt`, `table` or `kanban`.", + "allOf": [ + { + "$ref": "#/definitions/models.ProjectViewKind" + } + ] + } + } + }, + "models.ProjectViewBucketConfiguration": { + "type": "object", + "properties": { + "filter": { + "type": "string" + }, + "title": { + "type": "string" + } + } + }, + "models.ProjectViewKind": { + "type": "integer", + "enum": [ + 0, + 1, + 2, + 3 + ], + "x-enum-varnames": [ + "ProjectViewKindList", + "ProjectViewKindGantt", + "ProjectViewKindTable", + "ProjectViewKindKanban" + ] + }, + "models.Reaction": { + "type": "object", + "properties": { + "created": { + "description": "A timestamp when this reaction was created. You cannot change this value.", + "type": "string" + }, + "user": { + "description": "The user who reacted", + "allOf": [ + { + "$ref": "#/definitions/user.User" + } + ] + }, + "value": { + "description": "The actual reaction. This can be any valid utf character or text, up to a length of 20.", + "type": "string" + } + } + }, + "models.ReactionMap": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "$ref": "#/definitions/user.User" + } + } + }, + "models.RelatedTaskMap": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "$ref": "#/definitions/models.Task" + } + } + }, + "models.RelationKind": { + "type": "string", + "enum": [ + "unknown", + "subtask", + "parenttask", + "related", + "duplicateof", + "duplicates", + "blocking", + "blocked", + "precedes", + "follows", + "copiedfrom", + "copiedto" + ], + "x-enum-varnames": [ + "RelationKindUnknown", + "RelationKindSubtask", + "RelationKindParenttask", + "RelationKindRelated", + "RelationKindDuplicateOf", + "RelationKindDuplicates", + "RelationKindBlocking", + "RelationKindBlocked", + "RelationKindPreceeds", + "RelationKindFollows", + "RelationKindCopiedFrom", + "RelationKindCopiedTo" + ] + }, + "models.ReminderRelation": { + "type": "string", + "enum": [ + "due_date", + "start_date", + "end_date" + ], + "x-enum-varnames": [ + "ReminderRelationDueDate", + "ReminderRelationStartDate", + "ReminderRelationEndDate" + ] + }, + "models.Right": { + "type": "integer", + "enum": [ + 0, + 1, + 2 + ], + "x-enum-varnames": [ + "RightRead", + "RightWrite", + "RightAdmin" + ] + }, + "models.RouteDetail": { + "type": "object", + "properties": { + "method": { + "type": "string" + }, + "path": { + "type": "string" + } + } + }, + "models.SavedFilter": { + "type": "object", + "properties": { + "created": { + "description": "A timestamp when this filter was created. You cannot change this value.", + "type": "string" + }, + "description": { + "description": "The description of the filter", + "type": "string" + }, + "filters": { + "description": "The actual filters this filter contains", + "allOf": [ + { + "$ref": "#/definitions/models.TaskCollection" + } + ] + }, + "id": { + "description": "The unique numeric id of this saved filter", + "type": "integer" + }, + "is_favorite": { + "description": "True if the filter is a favorite. Favorite filters show up in a separate parent project together with favorite projects.", + "type": "boolean" + }, + "owner": { + "description": "The user who owns this filter", + "allOf": [ + { + "$ref": "#/definitions/user.User" + } + ] + }, + "title": { + "description": "The title of the filter.", + "type": "string", + "maxLength": 250, + "minLength": 1 + }, + "updated": { + "description": "A timestamp when this filter was last updated. You cannot change this value.", + "type": "string" + } + } + }, + "models.SharingType": { + "type": "integer", + "enum": [ + 0, + 1, + 2 + ], + "x-enum-varnames": [ + "SharingTypeUnknown", + "SharingTypeWithoutPassword", + "SharingTypeWithPassword" + ] + }, + "models.Subscription": { + "type": "object", + "properties": { + "created": { + "description": "A timestamp when this subscription was created. You cannot change this value.", + "type": "string" + }, + "entity": { + "type": "integer" + }, + "entity_id": { + "description": "The id of the entity to subscribe to.", + "type": "integer" + }, + "id": { + "description": "The numeric ID of the subscription", + "type": "integer" + } + } + }, + "models.Task": { + "type": "object", + "properties": { + "assignees": { + "description": "An array of users who are assigned to this task", + "type": "array", + "items": { + "$ref": "#/definitions/user.User" + } + }, + "attachments": { + "description": "All attachments this task has. This property is read-onlym, you must use the separate endpoint to add attachments to a task.", + "type": "array", + "items": { + "$ref": "#/definitions/models.TaskAttachment" + } + }, + "bucket_id": { + "description": "The bucket id. Will only be populated when the task is accessed via a view with buckets.\nCan be used to move a task between buckets. In that case, the new bucket must be in the same view as the old one.", + "type": "integer" + }, + "cover_image_attachment_id": { + "description": "If this task has a cover image, the field will return the id of the attachment that is the cover image.", + "type": "integer" + }, + "created": { + "description": "A timestamp when this task was created. You cannot change this value.", + "type": "string" + }, + "created_by": { + "description": "The user who initially created the task.", + "allOf": [ + { + "$ref": "#/definitions/user.User" + } + ] + }, + "description": { + "description": "The task description.", + "type": "string" + }, + "done": { + "description": "Whether a task is done or not.", + "type": "boolean" + }, + "done_at": { + "description": "The time when a task was marked as done.", + "type": "string" + }, + "due_date": { + "description": "The time when the task is due.", + "type": "string" + }, + "end_date": { + "description": "When this task ends.", + "type": "string" + }, + "hex_color": { + "description": "The task color in hex", + "type": "string", + "maxLength": 7 + }, + "id": { + "description": "The unique, numeric id of this task.", + "type": "integer" + }, + "identifier": { + "description": "The task identifier, based on the project identifier and the task's index", + "type": "string" + }, + "index": { + "description": "The task index, calculated per project", + "type": "integer" + }, + "is_favorite": { + "description": "True if a task is a favorite task. Favorite tasks show up in a separate \"Important\" project. This value depends on the user making the call to the api.", + "type": "boolean" + }, + "labels": { + "description": "An array of labels which are associated with this task. This property is read-only, you must use the separate endpoint to add labels to a task.", + "type": "array", + "items": { + "$ref": "#/definitions/models.Label" + } + }, + "percent_done": { + "description": "Determines how far a task is left from being done", + "type": "number" + }, + "position": { + "description": "The position of the task - any task project can be sorted as usual by this parameter.\nWhen accessing tasks via views with buckets, this is primarily used to sort them based on a range.\nPositions are always saved per view. They will automatically be set if you request the tasks through a view\nendpoint, otherwise they will always be 0. To update them, take a look at the Task Position endpoint.", + "type": "number" + }, + "priority": { + "description": "The task priority. Can be anything you want, it is possible to sort by this later.", + "type": "integer" + }, + "project_id": { + "description": "The project this task belongs to.", + "type": "integer" + }, + "reactions": { + "description": "Reactions on that task.", + "allOf": [ + { + "$ref": "#/definitions/models.ReactionMap" + } + ] + }, + "related_tasks": { + "description": "All related tasks, grouped by their relation kind", + "allOf": [ + { + "$ref": "#/definitions/models.RelatedTaskMap" + } + ] + }, + "reminders": { + "description": "An array of reminders that are associated with this task.", + "type": "array", + "items": { + "$ref": "#/definitions/models.TaskReminder" + } + }, + "repeat_after": { + "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.", + "type": "integer" + }, + "repeat_mode": { + "description": "Can have three possible values which will trigger when the task is marked as done: 0 = repeats after the amount specified in repeat_after, 1 = repeats all dates each months (ignoring repeat_after), 3 = repeats from the current date rather than the last set date.", + "allOf": [ + { + "$ref": "#/definitions/models.TaskRepeatMode" + } + ] + }, + "start_date": { + "description": "When this task starts.", + "type": "string" + }, + "subscription": { + "description": "The subscription status for the user reading this task. You can only read this property, use the subscription endpoints to modify it.\nWill only returned when retrieving one task.", + "allOf": [ + { + "$ref": "#/definitions/models.Subscription" + } + ] + }, + "title": { + "description": "The task text. This is what you'll see in the project.", + "type": "string", + "minLength": 1 + }, + "updated": { + "description": "A timestamp when this task was last updated. You cannot change this value.", + "type": "string" + } + } + }, + "models.TaskAssginee": { + "type": "object", + "properties": { + "created": { + "type": "string" + }, + "user_id": { + "type": "integer" + } + } + }, + "models.TaskAttachment": { + "type": "object", + "properties": { + "created": { + "type": "string" + }, + "created_by": { + "$ref": "#/definitions/user.User" + }, + "file": { + "$ref": "#/definitions/files.File" + }, + "id": { + "type": "integer" + }, + "task_id": { + "type": "integer" + } + } + }, + "models.TaskBucket": { + "type": "object", + "properties": { + "bucket_id": { + "type": "integer" + }, + "project_view_id": { + "type": "integer" + }, + "task_done": { + "type": "boolean" + }, + "task_id": { + "type": "integer" + } + } + }, + "models.TaskCollection": { + "type": "object", + "properties": { + "filter": { + "description": "The filter query to match tasks by. Check out https://vikunja.io/docs/filters for a full explanation.", + "type": "string" + }, + "filter_include_nulls": { + "description": "If set to true, the result will also include null values", + "type": "boolean" + }, + "order_by": { + "description": "The query parameter to order the items by. This can be either asc or desc, with asc being the default.", + "type": "array", + "items": { + "type": "string" + } + }, + "sort_by": { + "description": "The query parameter to sort by. This is for ex. done, priority, etc.", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "models.TaskComment": { + "type": "object", + "properties": { + "author": { + "$ref": "#/definitions/user.User" + }, + "comment": { + "type": "string" + }, + "created": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "reactions": { + "$ref": "#/definitions/models.ReactionMap" + }, + "updated": { + "type": "string" + } + } + }, + "models.TaskPosition": { + "type": "object", + "properties": { + "position": { + "description": "The position of the task - any task project can be sorted as usual by this parameter.\nWhen accessing tasks via kanban buckets, this is primarily used to sort them based on a range\nWe're using a float64 here to make it possible to put any task within any two other tasks (by changing the number).\nYou would calculate the new position between two tasks with something like task3.position = (task2.position - task1.position) / 2.\nA 64-Bit float leaves plenty of room to initially give tasks a position with 2^16 difference to the previous task\nwhich also leaves a lot of room for rearranging and sorting later.\nPositions are always saved per view. They will automatically be set if you request the tasks through a view\nendpoint, otherwise they will always be 0. To update them, take a look at the Task Position endpoint.", + "type": "number" + }, + "project_view_id": { + "description": "The project view this task is related to", + "type": "integer" + }, + "task_id": { + "description": "The ID of the task this position is for", + "type": "integer" + } + } + }, + "models.TaskRelation": { + "type": "object", + "properties": { + "created": { + "description": "A timestamp when this label was created. You cannot change this value.", + "type": "string" + }, + "created_by": { + "description": "The user who created this relation", + "allOf": [ + { + "$ref": "#/definitions/user.User" + } + ] + }, + "other_task_id": { + "description": "The ID of the other task, the task which is being related.", + "type": "integer" + }, + "relation_kind": { + "description": "The kind of the relation.", + "allOf": [ + { + "$ref": "#/definitions/models.RelationKind" + } + ] + }, + "task_id": { + "description": "The ID of the \"base\" task, the task which has a relation to another.", + "type": "integer" + } + } + }, + "models.TaskReminder": { + "type": "object", + "properties": { + "relative_period": { + "description": "A period in seconds relative to another date argument. Negative values mean the reminder triggers before the date. Default: 0, tiggers when RelativeTo is due.", + "type": "integer" + }, + "relative_to": { + "description": "The name of the date field to which the relative period refers to.", + "allOf": [ + { + "$ref": "#/definitions/models.ReminderRelation" + } + ] + }, + "reminder": { + "description": "The absolute time when the user wants to be reminded of the task.", + "type": "string" + } + } + }, + "models.TaskRepeatMode": { + "type": "integer", + "enum": [ + 0, + 1, + 2 + ], + "x-enum-varnames": [ + "TaskRepeatModeDefault", + "TaskRepeatModeMonth", + "TaskRepeatModeFromCurrentDate" + ] + }, + "models.Team": { + "type": "object", + "properties": { + "created": { + "description": "A timestamp when this relation was created. You cannot change this value.", + "type": "string" + }, + "created_by": { + "description": "The user who created this team.", + "allOf": [ + { + "$ref": "#/definitions/user.User" + } + ] + }, + "description": { + "description": "The team's description.", + "type": "string" + }, + "id": { + "description": "The unique, numeric id of this team.", + "type": "integer" + }, + "include_public": { + "description": "Query parameter controlling whether to include public projects or not", + "type": "boolean" + }, + "is_public": { + "description": "Defines wether the team should be publicly discoverable when sharing a project", + "type": "boolean" + }, + "members": { + "description": "An array of all members in this team.", + "type": "array", + "items": { + "$ref": "#/definitions/models.TeamUser" + } + }, + "name": { + "description": "The name of this team.", + "type": "string", + "maxLength": 250, + "minLength": 1 + }, + "oidc_id": { + "description": "The team's oidc id delivered by the oidc provider", + "type": "string", + "maxLength": 250 + }, + "updated": { + "description": "A timestamp when this relation was last updated. You cannot change this value.", + "type": "string" + } + } + }, + "models.TeamMember": { + "type": "object", + "properties": { + "admin": { + "description": "Whether or not the member is an admin of the team. See the docs for more about what a team admin can do", + "type": "boolean" + }, + "created": { + "description": "A timestamp when this relation was created. You cannot change this value.", + "type": "string" + }, + "id": { + "description": "The unique, numeric id of this team member relation.", + "type": "integer" + }, + "username": { + "description": "The username of the member. We use this to prevent automated user id entering.", + "type": "string" + } + } + }, + "models.TeamProject": { + "type": "object", + "properties": { + "created": { + "description": "A timestamp when this relation was created. You cannot change this value.", + "type": "string" + }, + "id": { + "description": "The unique, numeric id of this project \u003c-\u003e team relation.", + "type": "integer" + }, + "right": { + "description": "The right this team has. 0 = Read only, 1 = Read \u0026 Write, 2 = Admin. See the docs for more details.", + "default": 0, + "maximum": 2, + "allOf": [ + { + "$ref": "#/definitions/models.Right" + } + ] + }, + "team_id": { + "description": "The team id.", + "type": "integer" + }, + "updated": { + "description": "A timestamp when this relation was last updated. You cannot change this value.", + "type": "string" + } + } + }, + "models.TeamUser": { + "type": "object", + "properties": { + "admin": { + "description": "Whether the member is an admin of the team. See the docs for more about what a team admin can do", + "type": "boolean" + }, + "created": { + "description": "A timestamp when this task was created. You cannot change this value.", + "type": "string" + }, + "email": { + "description": "The user's email address.", + "type": "string", + "maxLength": 250 + }, + "id": { + "description": "The unique, numeric id of this user.", + "type": "integer" + }, + "name": { + "description": "The full name of the user.", + "type": "string" + }, + "updated": { + "description": "A timestamp when this task was last updated. You cannot change this value.", + "type": "string" + }, + "username": { + "description": "The username of the user. Is always unique.", + "type": "string", + "maxLength": 250, + "minLength": 1 + } + } + }, + "models.TeamWithRight": { + "type": "object", + "properties": { + "created": { + "description": "A timestamp when this relation was created. You cannot change this value.", + "type": "string" + }, + "created_by": { + "description": "The user who created this team.", + "allOf": [ + { + "$ref": "#/definitions/user.User" + } + ] + }, + "description": { + "description": "The team's description.", + "type": "string" + }, + "id": { + "description": "The unique, numeric id of this team.", + "type": "integer" + }, + "include_public": { + "description": "Query parameter controlling whether to include public projects or not", + "type": "boolean" + }, + "is_public": { + "description": "Defines wether the team should be publicly discoverable when sharing a project", + "type": "boolean" + }, + "members": { + "description": "An array of all members in this team.", + "type": "array", + "items": { + "$ref": "#/definitions/models.TeamUser" + } + }, + "name": { + "description": "The name of this team.", + "type": "string", + "maxLength": 250, + "minLength": 1 + }, + "oidc_id": { + "description": "The team's oidc id delivered by the oidc provider", + "type": "string", + "maxLength": 250 + }, + "right": { + "$ref": "#/definitions/models.Right" + }, + "updated": { + "description": "A timestamp when this relation was last updated. You cannot change this value.", + "type": "string" + } + } + }, + "models.UserWithRight": { + "type": "object", + "properties": { + "created": { + "description": "A timestamp when this task was created. You cannot change this value.", + "type": "string" + }, + "email": { + "description": "The user's email address.", + "type": "string", + "maxLength": 250 + }, + "id": { + "description": "The unique, numeric id of this user.", + "type": "integer" + }, + "name": { + "description": "The full name of the user.", + "type": "string" + }, + "right": { + "$ref": "#/definitions/models.Right" + }, + "updated": { + "description": "A timestamp when this task was last updated. You cannot change this value.", + "type": "string" + }, + "username": { + "description": "The username of the user. Is always unique.", + "type": "string", + "maxLength": 250, + "minLength": 1 + } + } + }, + "models.Webhook": { + "type": "object", + "properties": { + "created": { + "description": "A timestamp when this webhook target was created. You cannot change this value.", + "type": "string" + }, + "created_by": { + "description": "The user who initially created the webhook target.", + "allOf": [ + { + "$ref": "#/definitions/user.User" + } + ] + }, + "events": { + "description": "The webhook events which should fire this webhook target", + "type": "array", + "items": { + "type": "string" + } + }, + "id": { + "description": "The generated ID of this webhook target", + "type": "integer" + }, + "project_id": { + "description": "The project ID of the project this webhook target belongs to", + "type": "integer" + }, + "secret": { + "description": "If provided, webhook requests will be signed using HMAC. Check out the docs about how to use this: https://vikunja.io/docs/webhooks/#signing", + "type": "string" + }, + "target_url": { + "description": "The target URL where the POST request with the webhook payload will be made", + "type": "string" + }, + "updated": { + "description": "A timestamp when this webhook target was last updated. You cannot change this value.", + "type": "string" + } + } + }, + "notifications.DatabaseNotification": { + "type": "object", + "properties": { + "created": { + "description": "A timestamp when this notification was created. You cannot change this value.", + "type": "string" + }, + "id": { + "description": "The unique, numeric id of this notification.", + "type": "integer" + }, + "name": { + "description": "The name of the notification", + "type": "string" + }, + "notification": { + "description": "The actual content of the notification." + }, + "read_at": { + "description": "When this notification is marked as read, this will be updated with the current timestamp.", + "type": "string" + } + } + }, + "openid.Callback": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "redirect_url": { + "type": "string" + }, + "scope": { + "type": "string" + } + } + }, + "openid.Provider": { + "type": "object", + "properties": { + "auth_url": { + "type": "string" + }, + "client_id": { + "type": "string" + }, + "key": { + "type": "string" + }, + "logout_url": { + "type": "string" + }, + "name": { + "type": "string" + }, + "scope": { + "type": "string" + } + } + }, + "todoist.Migration": { + "type": "object", + "properties": { + "code": { + "type": "string" + } + } + }, + "trello.Migration": { + "type": "object", + "properties": { + "code": { + "type": "string" + } + } + }, + "user.APIUserPassword": { + "type": "object", + "properties": { + "email": { + "description": "The user's email address", + "type": "string", + "maxLength": 250 + }, + "id": { + "description": "The unique, numeric id of this user.", + "type": "integer" + }, + "password": { + "description": "The user's password in clear text. Only used when registering the user. The maximum limi is 72 bytes, which may be less than 72 characters. This is due to the limit in the bcrypt hashing algorithm used to store passwords in Vikunja.", + "type": "string", + "maxLength": 72, + "minLength": 8 + }, + "username": { + "description": "The user's username. Cannot contain anything that looks like an url or whitespaces.", + "type": "string", + "maxLength": 250, + "minLength": 3 + } + } + }, + "user.EmailConfirm": { + "type": "object", + "properties": { + "token": { + "description": "The email confirm token sent via email.", + "type": "string" + } + } + }, + "user.EmailUpdate": { + "type": "object", + "properties": { + "new_email": { + "description": "The new email address. Needs to be a valid email address.", + "type": "string" + }, + "password": { + "description": "The password of the user for confirmation.", + "type": "string" + } + } + }, + "user.Login": { + "type": "object", + "properties": { + "long_token": { + "description": "If true, the token returned will be valid a lot longer than default. Useful for \"remember me\" style logins.", + "type": "boolean" + }, + "password": { + "description": "The password for the user.", + "type": "string" + }, + "totp_passcode": { + "description": "The totp passcode of a user. Only needs to be provided when enabled.", + "type": "string" + }, + "username": { + "description": "The username used to log in.", + "type": "string" + } + } + }, + "user.PasswordReset": { + "type": "object", + "properties": { + "new_password": { + "description": "The new password for this user.", + "type": "string" + }, + "token": { + "description": "The previously issued reset token.", + "type": "string" + } + } + }, + "user.PasswordTokenRequest": { + "type": "object", + "properties": { + "email": { + "type": "string", + "maxLength": 250 + } + } + }, + "user.TOTP": { + "type": "object", + "properties": { + "enabled": { + "description": "The totp entry will only be enabled after the user verified they have a working totp setup.", + "type": "boolean" + }, + "secret": { + "type": "string" + }, + "url": { + "description": "The totp url used to be able to enroll the user later", + "type": "string" + } + } + }, + "user.TOTPPasscode": { + "type": "object", + "properties": { + "passcode": { + "type": "string" + } + } + }, + "user.Token": { + "type": "object", + "properties": { + "created": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "token": { + "type": "string" + } + } + }, + "user.User": { + "type": "object", + "properties": { + "created": { + "description": "A timestamp when this task was created. You cannot change this value.", + "type": "string" + }, + "email": { + "description": "The user's email address.", + "type": "string", + "maxLength": 250 + }, + "id": { + "description": "The unique, numeric id of this user.", + "type": "integer" + }, + "name": { + "description": "The full name of the user.", + "type": "string" + }, + "updated": { + "description": "A timestamp when this task was last updated. You cannot change this value.", + "type": "string" + }, + "username": { + "description": "The username of the user. Is always unique.", + "type": "string", + "maxLength": 250, + "minLength": 1 + } + } + }, + "v1.LinkShareAuth": { + "type": "object", + "properties": { + "password": { + "type": "string" + } + } + }, + "v1.UserAvatarProvider": { + "type": "object", + "properties": { + "avatar_provider": { + "description": "The avatar provider. Valid types are `gravatar` (uses the user email), `upload`, `initials`, `marble` (generates a random avatar for each user), `default`.", + "type": "string" + } + } + }, + "v1.UserDeletionRequestConfirm": { + "type": "object", + "properties": { + "token": { + "type": "string" + } + } + }, + "v1.UserPassword": { + "type": "object", + "properties": { + "new_password": { + "type": "string" + }, + "old_password": { + "type": "string" + } + } + }, + "v1.UserPasswordConfirmation": { + "type": "object", + "properties": { + "password": { + "type": "string" + } + } + }, + "v1.UserSettings": { + "type": "object", + "properties": { + "default_project_id": { + "description": "If a task is created without a specified project this value should be used. Applies\nto tasks made directly in API and from clients.", + "type": "integer" + }, + "discoverable_by_email": { + "description": "If true, the user can be found when searching for their exact email.", + "type": "boolean" + }, + "discoverable_by_name": { + "description": "If true, this user can be found by their name or parts of it when searching for it.", + "type": "boolean" + }, + "email_reminders_enabled": { + "description": "If enabled, sends email reminders of tasks to the user.", + "type": "boolean" + }, + "frontend_settings": { + "description": "Additional settings only used by the frontend" + }, + "language": { + "description": "The user's language", + "type": "string" + }, + "name": { + "description": "The new name of the current user.", + "type": "string" + }, + "overdue_tasks_reminders_enabled": { + "description": "If enabled, the user will get an email for their overdue tasks each morning.", + "type": "boolean" + }, + "overdue_tasks_reminders_time": { + "description": "The time when the daily summary of overdue tasks will be sent via email.", + "type": "string" + }, + "timezone": { + "description": "The user's time zone. Used to send task reminders in the time zone of the user.", + "type": "string" + }, + "week_start": { + "description": "The day when the week starts for this user. 0 = sunday, 1 = monday, etc.", + "type": "integer" + } + } + }, + "v1.UserWithSettings": { + "type": "object", + "properties": { + "created": { + "description": "A timestamp when this task was created. You cannot change this value.", + "type": "string" + }, + "deletion_scheduled_at": { + "type": "string" + }, + "email": { + "description": "The user's email address.", + "type": "string", + "maxLength": 250 + }, + "id": { + "description": "The unique, numeric id of this user.", + "type": "integer" + }, + "is_local_user": { + "type": "boolean" + }, + "name": { + "description": "The full name of the user.", + "type": "string" + }, + "settings": { + "$ref": "#/definitions/v1.UserSettings" + }, + "updated": { + "description": "A timestamp when this task was last updated. You cannot change this value.", + "type": "string" + }, + "username": { + "description": "The username of the user. Is always unique.", + "type": "string", + "maxLength": 250, + "minLength": 1 + } + } + }, + "v1.authInfo": { + "type": "object", + "properties": { + "local": { + "$ref": "#/definitions/v1.localAuthInfo" + }, + "openid_connect": { + "$ref": "#/definitions/v1.openIDAuthInfo" + } + } + }, + "v1.legalInfo": { + "type": "object", + "properties": { + "imprint_url": { + "type": "string" + }, + "privacy_policy_url": { + "type": "string" + } + } + }, + "v1.localAuthInfo": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + } + } + }, + "v1.openIDAuthInfo": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "providers": { + "type": "array", + "items": { + "$ref": "#/definitions/openid.Provider" + } + } + } + }, + "v1.vikunjaInfos": { + "type": "object", + "properties": { + "auth": { + "$ref": "#/definitions/v1.authInfo" + }, + "available_migrators": { + "type": "array", + "items": { + "type": "string" + } + }, + "caldav_enabled": { + "type": "boolean" + }, + "demo_mode_enabled": { + "type": "boolean" + }, + "email_reminders_enabled": { + "type": "boolean" + }, + "enabled_background_providers": { + "type": "array", + "items": { + "type": "string" + } + }, + "frontend_url": { + "type": "string" + }, + "legal": { + "$ref": "#/definitions/v1.legalInfo" + }, + "link_sharing_enabled": { + "type": "boolean" + }, + "max_file_size": { + "type": "string" + }, + "motd": { + "type": "string" + }, + "public_teams_enabled": { + "type": "boolean" + }, + "registration_enabled": { + "type": "boolean" + }, + "task_attachments_enabled": { + "type": "boolean" + }, + "task_comments_enabled": { + "type": "boolean" + }, + "totp_enabled": { + "type": "boolean" + }, + "user_deletion_enabled": { + "type": "boolean" + }, + "version": { + "type": "string" + }, + "webhooks_enabled": { + "type": "boolean" + } + } + }, + "web.HTTPError": { + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "message": { + "type": "string" + } + } + } + }, + "securityDefinitions": { + "BasicAuth": { + "type": "basic" + }, + "JWTKeyAuth": { + "type": "apiKey", + "name": "Authorization", + "in": "header" + } + } +} \ No newline at end of file diff --git a/generator/openapi-hs-generator/default.nix b/generator/openapi-hs-generator/default.nix new file mode 100644 index 0000000..7a04778 --- /dev/null +++ b/generator/openapi-hs-generator/default.nix @@ -0,0 +1,7 @@ +# DO NOT HAND-EDIT THIS FILE +import ((import {}).fetchFromGitHub ( + let json = builtins.fromJSON (builtins.readFile ./github.json); + in { inherit (json) owner repo rev sha256; + private = json.private or false; + } +)) diff --git a/generator/openapi-hs-generator/github.json b/generator/openapi-hs-generator/github.json new file mode 100644 index 0000000..57f987e --- /dev/null +++ b/generator/openapi-hs-generator/github.json @@ -0,0 +1,7 @@ +{ + "owner": "obsidiansystems", + "repo": "openapi-hs-generator", + "branch": "develop", + "rev": "01ab06ed66af529336294a9293942d456a66fef5", + "sha256": "0m0zzqxihmqv7ax1p6p2achi590vfnb201hkmqvcmgfq2jcjgs0c" +} diff --git a/generator/reflex-platform/default.nix b/generator/reflex-platform/default.nix new file mode 100644 index 0000000..2b4d4ab --- /dev/null +++ b/generator/reflex-platform/default.nix @@ -0,0 +1,2 @@ +# DO NOT HAND-EDIT THIS FILE +import (import ./thunk.nix) \ No newline at end of file diff --git a/generator/reflex-platform/github.json b/generator/reflex-platform/github.json new file mode 100644 index 0000000..6c30647 --- /dev/null +++ b/generator/reflex-platform/github.json @@ -0,0 +1,8 @@ +{ + "owner": "reflex-frp", + "repo": "reflex-platform", + "branch": "develop", + "private": false, + "rev": "2e0d31bc1b565eed02a3848cde0e0dbc4f33a2d4", + "sha256": "1vna7iyhl62sqicib34hs7haaaysxlpbj021qqp2v6fmsx25iyin" +} diff --git a/generator/reflex-platform/thunk.nix b/generator/reflex-platform/thunk.nix new file mode 100644 index 0000000..20f2d28 --- /dev/null +++ b/generator/reflex-platform/thunk.nix @@ -0,0 +1,12 @@ +# DO NOT HAND-EDIT THIS FILE +let fetch = { private ? false, fetchSubmodules ? false, owner, repo, rev, sha256, ... }: + if !fetchSubmodules && !private then builtins.fetchTarball { + url = "https://github.com/${owner}/${repo}/archive/${rev}.tar.gz"; inherit sha256; + } else (import (builtins.fetchTarball { + url = "https://github.com/NixOS/nixpkgs/archive/3aad50c30c826430b0270fcf8264c8c41b005403.tar.gz"; + sha256 = "0xwqsf08sywd23x0xvw4c4ghq0l28w2ki22h0bdn766i16z9q2gr"; +}) {}).fetchFromGitHub { + inherit owner repo rev sha256 fetchSubmodules private; + }; + json = builtins.fromJSON (builtins.readFile ./github.json); +in fetch json \ No newline at end of file diff --git a/lib/Vikunja.hs b/lib/Vikunja.hs new file mode 100644 index 0000000..2104042 --- /dev/null +++ b/lib/Vikunja.hs @@ -0,0 +1,32 @@ +{- + Vikunja API + + # Pagination Every endpoint capable of pagination will return two headers: * `x-pagination-total-pages`: The total number of available pages for this request * `x-pagination-result-count`: The number of items returned for this request. # Rights All endpoints which return a single item (project, task, etc.) - no array - will also return a `x-max-right` header with the max right the user has on this item as an int where `0` is `Read Only`, `1` is `Read & Write` and `2` is `Admin`. This can be used to show or hide ui elements based on the rights the user has. # Errors All errors have an error code and a human-readable error message in addition to the http status code. You should always check for the status code in the response, not only the http status code. Due to limitations in the swagger library we're using for this document, only one error per http status code is documented here. Make sure to check the [error docs](https://vikunja.io/docs/errors/) in Vikunja's documentation for a full list of available error codes. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **API Token:** You can create scoped API tokens for your user and use the token to make authenticated requests in the context of that user. The token must be provided via an `Authorization: Bearer ` header, similar to jwt auth. See the documentation for the `api` group to manage token creation and revocation. **BasicAuth:** Only used when requesting tasks via CalDAV. + + OpenAPI Version: 3.0.1 + Vikunja API API version: 0.24.6 + Contact: hello@vikunja.io + Generated by OpenAPI Generator (https://openapi-generator.tech) +-} + +{-| +Module : Vikunja +-} + +module Vikunja + ( module Vikunja.API + , module Vikunja.Client + , module Vikunja.Core + , module Vikunja.Logging + , module Vikunja.MimeTypes + , module Vikunja.Model + , module Vikunja.ModelLens + ) where + +import Vikunja.API +import Vikunja.Client +import Vikunja.Core +import Vikunja.Logging +import Vikunja.MimeTypes +import Vikunja.Model +import Vikunja.ModelLens \ No newline at end of file diff --git a/lib/Vikunja/API.hs b/lib/Vikunja/API.hs new file mode 100644 index 0000000..8a41d8b --- /dev/null +++ b/lib/Vikunja/API.hs @@ -0,0 +1,48 @@ +{- + Vikunja API + + # Pagination Every endpoint capable of pagination will return two headers: * `x-pagination-total-pages`: The total number of available pages for this request * `x-pagination-result-count`: The number of items returned for this request. # Rights All endpoints which return a single item (project, task, etc.) - no array - will also return a `x-max-right` header with the max right the user has on this item as an int where `0` is `Read Only`, `1` is `Read & Write` and `2` is `Admin`. This can be used to show or hide ui elements based on the rights the user has. # Errors All errors have an error code and a human-readable error message in addition to the http status code. You should always check for the status code in the response, not only the http status code. Due to limitations in the swagger library we're using for this document, only one error per http status code is documented here. Make sure to check the [error docs](https://vikunja.io/docs/errors/) in Vikunja's documentation for a full list of available error codes. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **API Token:** You can create scoped API tokens for your user and use the token to make authenticated requests in the context of that user. The token must be provided via an `Authorization: Bearer ` header, similar to jwt auth. See the documentation for the `api` group to manage token creation and revocation. **BasicAuth:** Only used when requesting tasks via CalDAV. + + OpenAPI Version: 3.0.1 + Vikunja API API version: 0.24.6 + Contact: hello@vikunja.io + Generated by OpenAPI Generator (https://openapi-generator.tech) +-} + +{-| +Module : Vikunja.API +-} + +module Vikunja.API + ( module Vikunja.API.Api + , module Vikunja.API.Assignees + , module Vikunja.API.Auth + , module Vikunja.API.Filter + , module Vikunja.API.Labels + , module Vikunja.API.Migration + , module Vikunja.API.Project + , module Vikunja.API.Service + , module Vikunja.API.Sharing + , module Vikunja.API.Subscriptions + , module Vikunja.API.Task + , module Vikunja.API.Team + , module Vikunja.API.Testing + , module Vikunja.API.User + , module Vikunja.API.Webhooks + ) where + +import Vikunja.API.Api +import Vikunja.API.Assignees +import Vikunja.API.Auth +import Vikunja.API.Filter +import Vikunja.API.Labels +import Vikunja.API.Migration +import Vikunja.API.Project +import Vikunja.API.Service +import Vikunja.API.Sharing +import Vikunja.API.Subscriptions +import Vikunja.API.Task +import Vikunja.API.Team +import Vikunja.API.Testing +import Vikunja.API.User +import Vikunja.API.Webhooks \ No newline at end of file diff --git a/lib/Vikunja/API/Api.hs b/lib/Vikunja/API/Api.hs new file mode 100644 index 0000000..ad13e3c --- /dev/null +++ b/lib/Vikunja/API/Api.hs @@ -0,0 +1,169 @@ +{- + Vikunja API + + # Pagination Every endpoint capable of pagination will return two headers: * `x-pagination-total-pages`: The total number of available pages for this request * `x-pagination-result-count`: The number of items returned for this request. # Rights All endpoints which return a single item (project, task, etc.) - no array - will also return a `x-max-right` header with the max right the user has on this item as an int where `0` is `Read Only`, `1` is `Read & Write` and `2` is `Admin`. This can be used to show or hide ui elements based on the rights the user has. # Errors All errors have an error code and a human-readable error message in addition to the http status code. You should always check for the status code in the response, not only the http status code. Due to limitations in the swagger library we're using for this document, only one error per http status code is documented here. Make sure to check the [error docs](https://vikunja.io/docs/errors/) in Vikunja's documentation for a full list of available error codes. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **API Token:** You can create scoped API tokens for your user and use the token to make authenticated requests in the context of that user. The token must be provided via an `Authorization: Bearer ` header, similar to jwt auth. See the documentation for the `api` group to manage token creation and revocation. **BasicAuth:** Only used when requesting tasks via CalDAV. + + OpenAPI Version: 3.0.1 + Vikunja API API version: 0.24.6 + Contact: hello@vikunja.io + Generated by OpenAPI Generator (https://openapi-generator.tech) +-} + +{-| +Module : Vikunja.API.Api +-} + +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE MonoLocalBinds #-} +{-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE OverloadedStrings #-} +{-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-binds -fno-warn-unused-imports #-} + +module Vikunja.API.Api where + +import Vikunja.Core +import Vikunja.MimeTypes +import Vikunja.Model as M + +import qualified Data.Aeson as A +import qualified Data.ByteString as B +import qualified Data.ByteString.Lazy as BL +import qualified Data.Data as P (Typeable, TypeRep, typeOf, typeRep) +import qualified Data.Foldable as P +import qualified Data.Map as Map +import qualified Data.Maybe as P +import qualified Data.Proxy as P (Proxy(..)) +import qualified Data.Set as Set +import qualified Data.String as P +import qualified Data.Text as T +import qualified Data.Text.Encoding as T +import qualified Data.Text.Lazy as TL +import qualified Data.Text.Lazy.Encoding as TL +import qualified Data.Time as TI +import qualified Network.HTTP.Client.MultipartFormData as NH +import qualified Network.HTTP.Media as ME +import qualified Network.HTTP.Types as NH +import qualified Web.FormUrlEncoded as WH +import qualified Web.HttpApiData as WH + +import Data.Text (Text) +import GHC.Base ((<|>)) + +import Prelude ((==),(/=),($), (.),(<$>),(<*>),(>>=),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty,maybe,pure,Monad,Applicative,Functor) +import qualified Prelude as P + +-- * Operations + + +-- ** Api + +-- *** routesGet + +-- | @GET \/routes@ +-- +-- Get a list of all token api routes +-- +-- Returns a list of all API routes which are available to use with an api token, not a user login. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +routesGet + :: VikunjaRequest RoutesGet MimeNoContent [Map] MimeJSON +routesGet = + _mkRequest "GET" ["/routes"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data RoutesGet +-- | @application/json@ +instance Produces RoutesGet MimeJSON + + +-- *** tokensGet + +-- | @GET \/tokens@ +-- +-- Get all api tokens of the current user +-- +-- Returns all api tokens the current user has created. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +tokensGet + :: VikunjaRequest TokensGet MimeNoContent [ModelsAPIToken] MimeJSON +tokensGet = + _mkRequest "GET" ["/tokens"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data TokensGet + +-- | /Optional Param/ "page" - The page number, used for pagination. If not provided, the first page of results is returned. +instance HasOptionalParam TokensGet Page where + applyOptionalParam req (Page xs) = + req `addQuery` toQuery ("page", Just xs) + +-- | /Optional Param/ "per_page" - The maximum number of tokens per page. This parameter is limited by the configured maximum of items per page. +instance HasOptionalParam TokensGet PerPage where + applyOptionalParam req (PerPage xs) = + req `addQuery` toQuery ("per_page", Just xs) + +-- | /Optional Param/ "s" - Search tokens by their title. +instance HasOptionalParam TokensGet S where + applyOptionalParam req (S xs) = + req `addQuery` toQuery ("s", Just xs) +-- | @application/json@ +instance Produces TokensGet MimeJSON + + +-- *** tokensPut + +-- | @PUT \/tokens@ +-- +-- Create a new api token +-- +-- Create a new api token to use on behalf of the user creating it. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +tokensPut + :: (Consumes TokensPut MimeJSON, MimeRender MimeJSON ModelsAPIToken) + => ModelsAPIToken -- ^ "token" - The token object with required fields + -> VikunjaRequest TokensPut MimeJSON ModelsAPIToken MimeJSON +tokensPut token = + _mkRequest "PUT" ["/tokens"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + `setBodyParam` token + +data TokensPut + +-- | /Body Param/ "token" - The token object with required fields +instance HasBodyParam TokensPut ModelsAPIToken + +-- | @application/json@ +instance Consumes TokensPut MimeJSON + +-- | @application/json@ +instance Produces TokensPut MimeJSON + + +-- *** tokensTokenIDDelete + +-- | @DELETE \/tokens\/{tokenID}@ +-- +-- Deletes an existing api token +-- +-- Delete any of the user's api tokens. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +tokensTokenIDDelete + :: TokenId -- ^ "tokenId" - Token ID + -> VikunjaRequest TokensTokenIDDelete MimeNoContent ModelsMessage MimeJSON +tokensTokenIDDelete (TokenId tokenId) = + _mkRequest "DELETE" ["/tokens/",toPath tokenId] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data TokensTokenIDDelete +-- | @application/json@ +instance Produces TokensTokenIDDelete MimeJSON + diff --git a/lib/Vikunja/API/Assignees.hs b/lib/Vikunja/API/Assignees.hs new file mode 100644 index 0000000..d85e8f1 --- /dev/null +++ b/lib/Vikunja/API/Assignees.hs @@ -0,0 +1,183 @@ +{- + Vikunja API + + # Pagination Every endpoint capable of pagination will return two headers: * `x-pagination-total-pages`: The total number of available pages for this request * `x-pagination-result-count`: The number of items returned for this request. # Rights All endpoints which return a single item (project, task, etc.) - no array - will also return a `x-max-right` header with the max right the user has on this item as an int where `0` is `Read Only`, `1` is `Read & Write` and `2` is `Admin`. This can be used to show or hide ui elements based on the rights the user has. # Errors All errors have an error code and a human-readable error message in addition to the http status code. You should always check for the status code in the response, not only the http status code. Due to limitations in the swagger library we're using for this document, only one error per http status code is documented here. Make sure to check the [error docs](https://vikunja.io/docs/errors/) in Vikunja's documentation for a full list of available error codes. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **API Token:** You can create scoped API tokens for your user and use the token to make authenticated requests in the context of that user. The token must be provided via an `Authorization: Bearer ` header, similar to jwt auth. See the documentation for the `api` group to manage token creation and revocation. **BasicAuth:** Only used when requesting tasks via CalDAV. + + OpenAPI Version: 3.0.1 + Vikunja API API version: 0.24.6 + Contact: hello@vikunja.io + Generated by OpenAPI Generator (https://openapi-generator.tech) +-} + +{-| +Module : Vikunja.API.Assignees +-} + +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE MonoLocalBinds #-} +{-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE OverloadedStrings #-} +{-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-binds -fno-warn-unused-imports #-} + +module Vikunja.API.Assignees where + +import Vikunja.Core +import Vikunja.MimeTypes +import Vikunja.Model as M + +import qualified Data.Aeson as A +import qualified Data.ByteString as B +import qualified Data.ByteString.Lazy as BL +import qualified Data.Data as P (Typeable, TypeRep, typeOf, typeRep) +import qualified Data.Foldable as P +import qualified Data.Map as Map +import qualified Data.Maybe as P +import qualified Data.Proxy as P (Proxy(..)) +import qualified Data.Set as Set +import qualified Data.String as P +import qualified Data.Text as T +import qualified Data.Text.Encoding as T +import qualified Data.Text.Lazy as TL +import qualified Data.Text.Lazy.Encoding as TL +import qualified Data.Time as TI +import qualified Network.HTTP.Client.MultipartFormData as NH +import qualified Network.HTTP.Media as ME +import qualified Network.HTTP.Types as NH +import qualified Web.FormUrlEncoded as WH +import qualified Web.HttpApiData as WH + +import Data.Text (Text) +import GHC.Base ((<|>)) + +import Prelude ((==),(/=),($), (.),(<$>),(<*>),(>>=),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty,maybe,pure,Monad,Applicative,Functor) +import qualified Prelude as P + +-- * Operations + + +-- ** Assignees + +-- *** tasksTaskIDAssigneesBulkPost + +-- | @POST \/tasks\/{taskID}\/assignees\/bulk@ +-- +-- Add multiple new assignees to a task +-- +-- Adds multiple new assignees to a task. The assignee needs to have access to the project, the doer must be able to edit this task. Every user not in the project will be unassigned from the task, pass an empty array to unassign everyone. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +tasksTaskIDAssigneesBulkPost + :: (Consumes TasksTaskIDAssigneesBulkPost MimeJSON, MimeRender MimeJSON ModelsBulkAssignees) + => ModelsBulkAssignees -- ^ "assignee" - The array of assignees + -> TaskId -- ^ "taskId" - Task ID + -> VikunjaRequest TasksTaskIDAssigneesBulkPost MimeJSON ModelsTaskAssginee MimeJSON +tasksTaskIDAssigneesBulkPost assignee (TaskId taskId) = + _mkRequest "POST" ["/tasks/",toPath taskId,"/assignees/bulk"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + `setBodyParam` assignee + +data TasksTaskIDAssigneesBulkPost + +-- | /Body Param/ "assignee" - The array of assignees +instance HasBodyParam TasksTaskIDAssigneesBulkPost ModelsBulkAssignees + +-- | @application/json@ +instance Consumes TasksTaskIDAssigneesBulkPost MimeJSON + +-- | @application/json@ +instance Produces TasksTaskIDAssigneesBulkPost MimeJSON + + +-- *** tasksTaskIDAssigneesGet + +-- | @GET \/tasks\/{taskID}\/assignees@ +-- +-- Get all assignees for a task +-- +-- Returns an array with all assignees for this task. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +tasksTaskIDAssigneesGet + :: TaskId -- ^ "taskId" - Task ID + -> VikunjaRequest TasksTaskIDAssigneesGet MimeNoContent [UserUser] MimeJSON +tasksTaskIDAssigneesGet (TaskId taskId) = + _mkRequest "GET" ["/tasks/",toPath taskId,"/assignees"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data TasksTaskIDAssigneesGet + +-- | /Optional Param/ "page" - The page number. Used for pagination. If not provided, the first page of results is returned. +instance HasOptionalParam TasksTaskIDAssigneesGet Page where + applyOptionalParam req (Page xs) = + req `addQuery` toQuery ("page", Just xs) + +-- | /Optional Param/ "per_page" - The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page. +instance HasOptionalParam TasksTaskIDAssigneesGet PerPage where + applyOptionalParam req (PerPage xs) = + req `addQuery` toQuery ("per_page", Just xs) + +-- | /Optional Param/ "s" - Search assignees by their username. +instance HasOptionalParam TasksTaskIDAssigneesGet S where + applyOptionalParam req (S xs) = + req `addQuery` toQuery ("s", Just xs) +-- | @application/json@ +instance Produces TasksTaskIDAssigneesGet MimeJSON + + +-- *** tasksTaskIDAssigneesPut + +-- | @PUT \/tasks\/{taskID}\/assignees@ +-- +-- Add a new assignee to a task +-- +-- Adds a new assignee to a task. The assignee needs to have access to the project, the doer must be able to edit this task. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +tasksTaskIDAssigneesPut + :: (Consumes TasksTaskIDAssigneesPut MimeJSON, MimeRender MimeJSON ModelsTaskAssginee) + => ModelsTaskAssginee -- ^ "assignee" - The assingee object + -> TaskId -- ^ "taskId" - Task ID + -> VikunjaRequest TasksTaskIDAssigneesPut MimeJSON ModelsTaskAssginee MimeJSON +tasksTaskIDAssigneesPut assignee (TaskId taskId) = + _mkRequest "PUT" ["/tasks/",toPath taskId,"/assignees"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + `setBodyParam` assignee + +data TasksTaskIDAssigneesPut + +-- | /Body Param/ "assignee" - The assingee object +instance HasBodyParam TasksTaskIDAssigneesPut ModelsTaskAssginee + +-- | @application/json@ +instance Consumes TasksTaskIDAssigneesPut MimeJSON + +-- | @application/json@ +instance Produces TasksTaskIDAssigneesPut MimeJSON + + +-- *** tasksTaskIDAssigneesUserIDDelete + +-- | @DELETE \/tasks\/{taskID}\/assignees\/{userID}@ +-- +-- Delete an assignee +-- +-- Un-assign a user from a task. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +tasksTaskIDAssigneesUserIDDelete + :: TaskId -- ^ "taskId" - Task ID + -> UserId -- ^ "userId" - Assignee user ID + -> VikunjaRequest TasksTaskIDAssigneesUserIDDelete MimeNoContent ModelsMessage MimeJSON +tasksTaskIDAssigneesUserIDDelete (TaskId taskId) (UserId userId) = + _mkRequest "DELETE" ["/tasks/",toPath taskId,"/assignees/",toPath userId] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data TasksTaskIDAssigneesUserIDDelete +-- | @application/json@ +instance Produces TasksTaskIDAssigneesUserIDDelete MimeJSON + diff --git a/lib/Vikunja/API/Auth.hs b/lib/Vikunja/API/Auth.hs new file mode 100644 index 0000000..580ae84 --- /dev/null +++ b/lib/Vikunja/API/Auth.hs @@ -0,0 +1,147 @@ +{- + Vikunja API + + # Pagination Every endpoint capable of pagination will return two headers: * `x-pagination-total-pages`: The total number of available pages for this request * `x-pagination-result-count`: The number of items returned for this request. # Rights All endpoints which return a single item (project, task, etc.) - no array - will also return a `x-max-right` header with the max right the user has on this item as an int where `0` is `Read Only`, `1` is `Read & Write` and `2` is `Admin`. This can be used to show or hide ui elements based on the rights the user has. # Errors All errors have an error code and a human-readable error message in addition to the http status code. You should always check for the status code in the response, not only the http status code. Due to limitations in the swagger library we're using for this document, only one error per http status code is documented here. Make sure to check the [error docs](https://vikunja.io/docs/errors/) in Vikunja's documentation for a full list of available error codes. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **API Token:** You can create scoped API tokens for your user and use the token to make authenticated requests in the context of that user. The token must be provided via an `Authorization: Bearer ` header, similar to jwt auth. See the documentation for the `api` group to manage token creation and revocation. **BasicAuth:** Only used when requesting tasks via CalDAV. + + OpenAPI Version: 3.0.1 + Vikunja API API version: 0.24.6 + Contact: hello@vikunja.io + Generated by OpenAPI Generator (https://openapi-generator.tech) +-} + +{-| +Module : Vikunja.API.Auth +-} + +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE MonoLocalBinds #-} +{-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE OverloadedStrings #-} +{-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-binds -fno-warn-unused-imports #-} + +module Vikunja.API.Auth where + +import Vikunja.Core +import Vikunja.MimeTypes +import Vikunja.Model as M + +import qualified Data.Aeson as A +import qualified Data.ByteString as B +import qualified Data.ByteString.Lazy as BL +import qualified Data.Data as P (Typeable, TypeRep, typeOf, typeRep) +import qualified Data.Foldable as P +import qualified Data.Map as Map +import qualified Data.Maybe as P +import qualified Data.Proxy as P (Proxy(..)) +import qualified Data.Set as Set +import qualified Data.String as P +import qualified Data.Text as T +import qualified Data.Text.Encoding as T +import qualified Data.Text.Lazy as TL +import qualified Data.Text.Lazy.Encoding as TL +import qualified Data.Time as TI +import qualified Network.HTTP.Client.MultipartFormData as NH +import qualified Network.HTTP.Media as ME +import qualified Network.HTTP.Types as NH +import qualified Web.FormUrlEncoded as WH +import qualified Web.HttpApiData as WH + +import Data.Text (Text) +import GHC.Base ((<|>)) + +import Prelude ((==),(/=),($), (.),(<$>),(<*>),(>>=),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty,maybe,pure,Monad,Applicative,Functor) +import qualified Prelude as P + +-- * Operations + + +-- ** Auth + +-- *** getTokenOpenid + +-- | @POST \/auth\/openid\/{provider}\/callback@ +-- +-- Authenticate a user with OpenID Connect +-- +-- After a redirect from the OpenID Connect provider to the frontend has been made with the authentication `code`, this endpoint can be used to obtain a jwt token for that user and thus log them in. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +getTokenOpenid + :: (Consumes GetTokenOpenid MimeJSON, MimeRender MimeJSON OpenidCallback) + => OpenidCallback -- ^ "callback" - The openid callback + -> Provider -- ^ "provider" - The OpenID Connect provider key as returned by the /info endpoint + -> VikunjaRequest GetTokenOpenid MimeJSON AuthToken MimeJSON +getTokenOpenid callback (Provider provider) = + _mkRequest "POST" ["/auth/openid/",toPath provider,"/callback"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + `setBodyParam` callback + +data GetTokenOpenid + +-- | /Body Param/ "callback" - The openid callback +instance HasBodyParam GetTokenOpenid OpenidCallback + +-- | @application/json@ +instance Consumes GetTokenOpenid MimeJSON + +-- | @application/json@ +instance Produces GetTokenOpenid MimeJSON + + +-- *** loginPost + +-- | @POST \/login@ +-- +-- Login +-- +-- Logs a user in. Returns a JWT-Token to authenticate further requests. +-- +loginPost + :: (Consumes LoginPost MimeJSON, MimeRender MimeJSON UserLogin) + => UserLogin -- ^ "credentials" - The login credentials + -> VikunjaRequest LoginPost MimeJSON AuthToken MimeJSON +loginPost credentials = + _mkRequest "POST" ["/login"] + `setBodyParam` credentials + +data LoginPost + +-- | /Body Param/ "credentials" - The login credentials +instance HasBodyParam LoginPost UserLogin + +-- | @application/json@ +instance Consumes LoginPost MimeJSON + +-- | @application/json@ +instance Produces LoginPost MimeJSON + + +-- *** registerPost + +-- | @POST \/register@ +-- +-- Register +-- +-- Creates a new user account. +-- +registerPost + :: (Consumes RegisterPost MimeJSON, MimeRender MimeJSON UserAPIUserPassword) + => UserAPIUserPassword -- ^ "credentials" - The user credentials + -> VikunjaRequest RegisterPost MimeJSON UserUser MimeJSON +registerPost credentials = + _mkRequest "POST" ["/register"] + `setBodyParam` credentials + +data RegisterPost + +-- | /Body Param/ "credentials" - The user credentials +instance HasBodyParam RegisterPost UserAPIUserPassword + +-- | @application/json@ +instance Consumes RegisterPost MimeJSON + +-- | @application/json@ +instance Produces RegisterPost MimeJSON + diff --git a/lib/Vikunja/API/Filter.hs b/lib/Vikunja/API/Filter.hs new file mode 100644 index 0000000..de0fde8 --- /dev/null +++ b/lib/Vikunja/API/Filter.hs @@ -0,0 +1,146 @@ +{- + Vikunja API + + # Pagination Every endpoint capable of pagination will return two headers: * `x-pagination-total-pages`: The total number of available pages for this request * `x-pagination-result-count`: The number of items returned for this request. # Rights All endpoints which return a single item (project, task, etc.) - no array - will also return a `x-max-right` header with the max right the user has on this item as an int where `0` is `Read Only`, `1` is `Read & Write` and `2` is `Admin`. This can be used to show or hide ui elements based on the rights the user has. # Errors All errors have an error code and a human-readable error message in addition to the http status code. You should always check for the status code in the response, not only the http status code. Due to limitations in the swagger library we're using for this document, only one error per http status code is documented here. Make sure to check the [error docs](https://vikunja.io/docs/errors/) in Vikunja's documentation for a full list of available error codes. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **API Token:** You can create scoped API tokens for your user and use the token to make authenticated requests in the context of that user. The token must be provided via an `Authorization: Bearer ` header, similar to jwt auth. See the documentation for the `api` group to manage token creation and revocation. **BasicAuth:** Only used when requesting tasks via CalDAV. + + OpenAPI Version: 3.0.1 + Vikunja API API version: 0.24.6 + Contact: hello@vikunja.io + Generated by OpenAPI Generator (https://openapi-generator.tech) +-} + +{-| +Module : Vikunja.API.Filter +-} + +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE MonoLocalBinds #-} +{-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE OverloadedStrings #-} +{-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-binds -fno-warn-unused-imports #-} + +module Vikunja.API.Filter where + +import Vikunja.Core +import Vikunja.MimeTypes +import Vikunja.Model as M + +import qualified Data.Aeson as A +import qualified Data.ByteString as B +import qualified Data.ByteString.Lazy as BL +import qualified Data.Data as P (Typeable, TypeRep, typeOf, typeRep) +import qualified Data.Foldable as P +import qualified Data.Map as Map +import qualified Data.Maybe as P +import qualified Data.Proxy as P (Proxy(..)) +import qualified Data.Set as Set +import qualified Data.String as P +import qualified Data.Text as T +import qualified Data.Text.Encoding as T +import qualified Data.Text.Lazy as TL +import qualified Data.Text.Lazy.Encoding as TL +import qualified Data.Time as TI +import qualified Network.HTTP.Client.MultipartFormData as NH +import qualified Network.HTTP.Media as ME +import qualified Network.HTTP.Types as NH +import qualified Web.FormUrlEncoded as WH +import qualified Web.HttpApiData as WH + +import Data.Text (Text) +import GHC.Base ((<|>)) + +import Prelude ((==),(/=),($), (.),(<$>),(<*>),(>>=),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty,maybe,pure,Monad,Applicative,Functor) +import qualified Prelude as P + +-- * Operations + + +-- ** Filter + +-- *** filtersIdDelete + +-- | @DELETE \/filters\/{id}@ +-- +-- Removes a saved filter +-- +-- Removes a saved filter by its ID. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +filtersIdDelete + :: Id -- ^ "id" - Filter ID + -> VikunjaRequest FiltersIdDelete MimeNoContent ModelsSavedFilter MimeJSON +filtersIdDelete (Id id) = + _mkRequest "DELETE" ["/filters/",toPath id] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data FiltersIdDelete +-- | @application/json@ +instance Produces FiltersIdDelete MimeJSON + + +-- *** filtersIdGet + +-- | @GET \/filters\/{id}@ +-- +-- Gets one saved filter +-- +-- Returns a saved filter by its ID. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +filtersIdGet + :: Id -- ^ "id" - Filter ID + -> VikunjaRequest FiltersIdGet MimeNoContent ModelsSavedFilter MimeJSON +filtersIdGet (Id id) = + _mkRequest "GET" ["/filters/",toPath id] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data FiltersIdGet +-- | @application/json@ +instance Produces FiltersIdGet MimeJSON + + +-- *** filtersIdPost + +-- | @POST \/filters\/{id}@ +-- +-- Updates a saved filter +-- +-- Updates a saved filter by its ID. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +filtersIdPost + :: Id -- ^ "id" - Filter ID + -> VikunjaRequest FiltersIdPost MimeNoContent ModelsSavedFilter MimeJSON +filtersIdPost (Id id) = + _mkRequest "POST" ["/filters/",toPath id] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data FiltersIdPost +-- | @application/json@ +instance Produces FiltersIdPost MimeJSON + + +-- *** filtersPut + +-- | @PUT \/filters@ +-- +-- Creates a new saved filter +-- +-- Creates a new saved filter +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +filtersPut + :: VikunjaRequest FiltersPut MimeNoContent ModelsSavedFilter MimeJSON +filtersPut = + _mkRequest "PUT" ["/filters"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data FiltersPut +-- | @application/json@ +instance Produces FiltersPut MimeJSON + diff --git a/lib/Vikunja/API/Labels.hs b/lib/Vikunja/API/Labels.hs new file mode 100644 index 0000000..46de79a --- /dev/null +++ b/lib/Vikunja/API/Labels.hs @@ -0,0 +1,326 @@ +{- + Vikunja API + + # Pagination Every endpoint capable of pagination will return two headers: * `x-pagination-total-pages`: The total number of available pages for this request * `x-pagination-result-count`: The number of items returned for this request. # Rights All endpoints which return a single item (project, task, etc.) - no array - will also return a `x-max-right` header with the max right the user has on this item as an int where `0` is `Read Only`, `1` is `Read & Write` and `2` is `Admin`. This can be used to show or hide ui elements based on the rights the user has. # Errors All errors have an error code and a human-readable error message in addition to the http status code. You should always check for the status code in the response, not only the http status code. Due to limitations in the swagger library we're using for this document, only one error per http status code is documented here. Make sure to check the [error docs](https://vikunja.io/docs/errors/) in Vikunja's documentation for a full list of available error codes. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **API Token:** You can create scoped API tokens for your user and use the token to make authenticated requests in the context of that user. The token must be provided via an `Authorization: Bearer ` header, similar to jwt auth. See the documentation for the `api` group to manage token creation and revocation. **BasicAuth:** Only used when requesting tasks via CalDAV. + + OpenAPI Version: 3.0.1 + Vikunja API API version: 0.24.6 + Contact: hello@vikunja.io + Generated by OpenAPI Generator (https://openapi-generator.tech) +-} + +{-| +Module : Vikunja.API.Labels +-} + +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE MonoLocalBinds #-} +{-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE OverloadedStrings #-} +{-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-binds -fno-warn-unused-imports #-} + +module Vikunja.API.Labels where + +import Vikunja.Core +import Vikunja.MimeTypes +import Vikunja.Model as M + +import qualified Data.Aeson as A +import qualified Data.ByteString as B +import qualified Data.ByteString.Lazy as BL +import qualified Data.Data as P (Typeable, TypeRep, typeOf, typeRep) +import qualified Data.Foldable as P +import qualified Data.Map as Map +import qualified Data.Maybe as P +import qualified Data.Proxy as P (Proxy(..)) +import qualified Data.Set as Set +import qualified Data.String as P +import qualified Data.Text as T +import qualified Data.Text.Encoding as T +import qualified Data.Text.Lazy as TL +import qualified Data.Text.Lazy.Encoding as TL +import qualified Data.Time as TI +import qualified Network.HTTP.Client.MultipartFormData as NH +import qualified Network.HTTP.Media as ME +import qualified Network.HTTP.Types as NH +import qualified Web.FormUrlEncoded as WH +import qualified Web.HttpApiData as WH + +import Data.Text (Text) +import GHC.Base ((<|>)) + +import Prelude ((==),(/=),($), (.),(<$>),(<*>),(>>=),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty,maybe,pure,Monad,Applicative,Functor) +import qualified Prelude as P + +-- * Operations + + +-- ** Labels + +-- *** labelsGet + +-- | @GET \/labels@ +-- +-- 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. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +labelsGet + :: VikunjaRequest LabelsGet MimeNoContent [ModelsLabel] MimeJSON +labelsGet = + _mkRequest "GET" ["/labels"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data LabelsGet + +-- | /Optional Param/ "page" - The page number. Used for pagination. If not provided, the first page of results is returned. +instance HasOptionalParam LabelsGet Page where + applyOptionalParam req (Page xs) = + req `addQuery` toQuery ("page", Just xs) + +-- | /Optional Param/ "per_page" - The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page. +instance HasOptionalParam LabelsGet PerPage where + applyOptionalParam req (PerPage xs) = + req `addQuery` toQuery ("per_page", Just xs) + +-- | /Optional Param/ "s" - Search labels by label text. +instance HasOptionalParam LabelsGet S where + applyOptionalParam req (S xs) = + req `addQuery` toQuery ("s", Just xs) +-- | @application/json@ +instance Produces LabelsGet MimeJSON + + +-- *** labelsIdDelete + +-- | @DELETE \/labels\/{id}@ +-- +-- Delete a label +-- +-- Delete an existing label. The user needs to be the creator of the label to be able to do this. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +labelsIdDelete + :: Id -- ^ "id" - Label ID + -> VikunjaRequest LabelsIdDelete MimeNoContent ModelsLabel MimeJSON +labelsIdDelete (Id id) = + _mkRequest "DELETE" ["/labels/",toPath id] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data LabelsIdDelete +-- | @application/json@ +instance Produces LabelsIdDelete MimeJSON + + +-- *** labelsIdGet + +-- | @GET \/labels\/{id}@ +-- +-- Gets one label +-- +-- Returns one label by its ID. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +labelsIdGet + :: Id -- ^ "id" - Label ID + -> VikunjaRequest LabelsIdGet MimeNoContent ModelsLabel MimeJSON +labelsIdGet (Id id) = + _mkRequest "GET" ["/labels/",toPath id] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data LabelsIdGet +-- | @application/json@ +instance Produces LabelsIdGet MimeJSON + + +-- *** labelsIdPut + +-- | @PUT \/labels\/{id}@ +-- +-- Update a label +-- +-- Update an existing label. The user needs to be the creator of the label to be able to do this. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +labelsIdPut + :: (Consumes LabelsIdPut MimeJSON, MimeRender MimeJSON ModelsLabel) + => ModelsLabel -- ^ "label" - The label object + -> Id -- ^ "id" - Label ID + -> VikunjaRequest LabelsIdPut MimeJSON ModelsLabel MimeJSON +labelsIdPut label (Id id) = + _mkRequest "PUT" ["/labels/",toPath id] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + `setBodyParam` label + +data LabelsIdPut + +-- | /Body Param/ "label" - The label object +instance HasBodyParam LabelsIdPut ModelsLabel + +-- | @application/json@ +instance Consumes LabelsIdPut MimeJSON + +-- | @application/json@ +instance Produces LabelsIdPut MimeJSON + + +-- *** labelsPut + +-- | @PUT \/labels@ +-- +-- Create a label +-- +-- Creates a new label. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +labelsPut + :: (Consumes LabelsPut MimeJSON, MimeRender MimeJSON ModelsLabel) + => ModelsLabel -- ^ "label" - The label object + -> VikunjaRequest LabelsPut MimeJSON ModelsLabel MimeJSON +labelsPut label = + _mkRequest "PUT" ["/labels"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + `setBodyParam` label + +data LabelsPut + +-- | /Body Param/ "label" - The label object +instance HasBodyParam LabelsPut ModelsLabel + +-- | @application/json@ +instance Consumes LabelsPut MimeJSON + +-- | @application/json@ +instance Produces LabelsPut MimeJSON + + +-- *** tasksTaskIDLabelsBulkPost + +-- | @POST \/tasks\/{taskID}\/labels\/bulk@ +-- +-- 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. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +tasksTaskIDLabelsBulkPost + :: (Consumes TasksTaskIDLabelsBulkPost MimeJSON, MimeRender MimeJSON ModelsLabelTaskBulk) + => ModelsLabelTaskBulk -- ^ "label" - The array of labels + -> TaskId -- ^ "taskId" - Task ID + -> VikunjaRequest TasksTaskIDLabelsBulkPost MimeJSON ModelsLabelTaskBulk MimeJSON +tasksTaskIDLabelsBulkPost label (TaskId taskId) = + _mkRequest "POST" ["/tasks/",toPath taskId,"/labels/bulk"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + `setBodyParam` label + +data TasksTaskIDLabelsBulkPost + +-- | /Body Param/ "label" - The array of labels +instance HasBodyParam TasksTaskIDLabelsBulkPost ModelsLabelTaskBulk + +-- | @application/json@ +instance Consumes TasksTaskIDLabelsBulkPost MimeJSON + +-- | @application/json@ +instance Produces TasksTaskIDLabelsBulkPost MimeJSON + + +-- *** tasksTaskLabelsGet + +-- | @GET \/tasks\/{task}\/labels@ +-- +-- Get all labels on a task +-- +-- Returns all labels which are assicociated with a given task. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +tasksTaskLabelsGet + :: Task -- ^ "task" - Task ID + -> VikunjaRequest TasksTaskLabelsGet MimeNoContent [ModelsLabel] MimeJSON +tasksTaskLabelsGet (Task task) = + _mkRequest "GET" ["/tasks/",toPath task,"/labels"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data TasksTaskLabelsGet + +-- | /Optional Param/ "page" - The page number. Used for pagination. If not provided, the first page of results is returned. +instance HasOptionalParam TasksTaskLabelsGet Page where + applyOptionalParam req (Page xs) = + req `addQuery` toQuery ("page", Just xs) + +-- | /Optional Param/ "per_page" - The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page. +instance HasOptionalParam TasksTaskLabelsGet PerPage where + applyOptionalParam req (PerPage xs) = + req `addQuery` toQuery ("per_page", Just xs) + +-- | /Optional Param/ "s" - Search labels by label text. +instance HasOptionalParam TasksTaskLabelsGet S where + applyOptionalParam req (S xs) = + req `addQuery` toQuery ("s", Just xs) +-- | @application/json@ +instance Produces TasksTaskLabelsGet MimeJSON + + +-- *** tasksTaskLabelsLabelDelete + +-- | @DELETE \/tasks\/{task}\/labels\/{label}@ +-- +-- Remove a label from a task +-- +-- Remove a label from a task. The user needs to have write-access to the project to be able do this. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +tasksTaskLabelsLabelDelete + :: Task -- ^ "task" - Task ID + -> Label -- ^ "label" - Label ID + -> VikunjaRequest TasksTaskLabelsLabelDelete MimeNoContent ModelsMessage MimeJSON +tasksTaskLabelsLabelDelete (Task task) (Label label) = + _mkRequest "DELETE" ["/tasks/",toPath task,"/labels/",toPath label] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data TasksTaskLabelsLabelDelete +-- | @application/json@ +instance Produces TasksTaskLabelsLabelDelete MimeJSON + + +-- *** tasksTaskLabelsPut + +-- | @PUT \/tasks\/{task}\/labels@ +-- +-- Add a label to a task +-- +-- Add a label to a task. The user needs to have write-access to the project to be able do this. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +tasksTaskLabelsPut + :: (Consumes TasksTaskLabelsPut MimeJSON, MimeRender MimeJSON ModelsLabelTask) + => ModelsLabelTask -- ^ "label" - The label object + -> Task -- ^ "task" - Task ID + -> VikunjaRequest TasksTaskLabelsPut MimeJSON ModelsLabelTask MimeJSON +tasksTaskLabelsPut label (Task task) = + _mkRequest "PUT" ["/tasks/",toPath task,"/labels"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + `setBodyParam` label + +data TasksTaskLabelsPut + +-- | /Body Param/ "label" - The label object +instance HasBodyParam TasksTaskLabelsPut ModelsLabelTask + +-- | @application/json@ +instance Consumes TasksTaskLabelsPut MimeJSON + +-- | @application/json@ +instance Produces TasksTaskLabelsPut MimeJSON + diff --git a/lib/Vikunja/API/Migration.hs b/lib/Vikunja/API/Migration.hs new file mode 100644 index 0000000..c9b508f --- /dev/null +++ b/lib/Vikunja/API/Migration.hs @@ -0,0 +1,376 @@ +{- + Vikunja API + + # Pagination Every endpoint capable of pagination will return two headers: * `x-pagination-total-pages`: The total number of available pages for this request * `x-pagination-result-count`: The number of items returned for this request. # Rights All endpoints which return a single item (project, task, etc.) - no array - will also return a `x-max-right` header with the max right the user has on this item as an int where `0` is `Read Only`, `1` is `Read & Write` and `2` is `Admin`. This can be used to show or hide ui elements based on the rights the user has. # Errors All errors have an error code and a human-readable error message in addition to the http status code. You should always check for the status code in the response, not only the http status code. Due to limitations in the swagger library we're using for this document, only one error per http status code is documented here. Make sure to check the [error docs](https://vikunja.io/docs/errors/) in Vikunja's documentation for a full list of available error codes. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **API Token:** You can create scoped API tokens for your user and use the token to make authenticated requests in the context of that user. The token must be provided via an `Authorization: Bearer ` header, similar to jwt auth. See the documentation for the `api` group to manage token creation and revocation. **BasicAuth:** Only used when requesting tasks via CalDAV. + + OpenAPI Version: 3.0.1 + Vikunja API API version: 0.24.6 + Contact: hello@vikunja.io + Generated by OpenAPI Generator (https://openapi-generator.tech) +-} + +{-| +Module : Vikunja.API.Migration +-} + +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE MonoLocalBinds #-} +{-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE OverloadedStrings #-} +{-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-binds -fno-warn-unused-imports #-} + +module Vikunja.API.Migration where + +import Vikunja.Core +import Vikunja.MimeTypes +import Vikunja.Model as M + +import qualified Data.Aeson as A +import qualified Data.ByteString as B +import qualified Data.ByteString.Lazy as BL +import qualified Data.Data as P (Typeable, TypeRep, typeOf, typeRep) +import qualified Data.Foldable as P +import qualified Data.Map as Map +import qualified Data.Maybe as P +import qualified Data.Proxy as P (Proxy(..)) +import qualified Data.Set as Set +import qualified Data.String as P +import qualified Data.Text as T +import qualified Data.Text.Encoding as T +import qualified Data.Text.Lazy as TL +import qualified Data.Text.Lazy.Encoding as TL +import qualified Data.Time as TI +import qualified Network.HTTP.Client.MultipartFormData as NH +import qualified Network.HTTP.Media as ME +import qualified Network.HTTP.Types as NH +import qualified Web.FormUrlEncoded as WH +import qualified Web.HttpApiData as WH + +import Data.Text (Text) +import GHC.Base ((<|>)) + +import Prelude ((==),(/=),($), (.),(<$>),(<*>),(>>=),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty,maybe,pure,Monad,Applicative,Functor) +import qualified Prelude as P + +-- * Operations + + +-- ** Migration + +-- *** migrationMicrosoftTodoAuthGet + +-- | @GET \/migration\/microsoft-todo\/auth@ +-- +-- Get the auth url from Microsoft Todo +-- +-- Returns the auth url where the user needs to get its auth code. This code can then be used to migrate everything from Microsoft Todo to Vikunja. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +migrationMicrosoftTodoAuthGet + :: VikunjaRequest MigrationMicrosoftTodoAuthGet MimeNoContent HandlerAuthURL MimeJSON +migrationMicrosoftTodoAuthGet = + _mkRequest "GET" ["/migration/microsoft-todo/auth"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data MigrationMicrosoftTodoAuthGet +-- | @application/json@ +instance Produces MigrationMicrosoftTodoAuthGet MimeJSON + + +-- *** migrationMicrosoftTodoMigratePost + +-- | @POST \/migration\/microsoft-todo\/migrate@ +-- +-- Migrate all projects, tasks etc. from Microsoft Todo +-- +-- Migrates all tasklinsts, tasks, notes and reminders from Microsoft Todo to Vikunja. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +migrationMicrosoftTodoMigratePost + :: (Consumes MigrationMicrosoftTodoMigratePost MimeJSON, MimeRender MimeJSON MicrosofttodoMigration) + => MicrosofttodoMigration -- ^ "migrationCode" - The auth token previously obtained from the auth url. See the docs for /migration/microsoft-todo/auth. + -> VikunjaRequest MigrationMicrosoftTodoMigratePost MimeJSON ModelsMessage MimeJSON +migrationMicrosoftTodoMigratePost migrationCode = + _mkRequest "POST" ["/migration/microsoft-todo/migrate"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + `setBodyParam` migrationCode + +data MigrationMicrosoftTodoMigratePost + +-- | /Body Param/ "migrationCode" - The auth token previously obtained from the auth url. See the docs for /migration/microsoft-todo/auth. +instance HasBodyParam MigrationMicrosoftTodoMigratePost MicrosofttodoMigration + +-- | @application/json@ +instance Consumes MigrationMicrosoftTodoMigratePost MimeJSON + +-- | @application/json@ +instance Produces MigrationMicrosoftTodoMigratePost MimeJSON + + +-- *** migrationMicrosoftTodoStatusGet + +-- | @GET \/migration\/microsoft-todo\/status@ +-- +-- Get migration status +-- +-- Returns if the current user already did the migation or not. This is useful to show a confirmation message in the frontend if the user is trying to do the same migration again. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +migrationMicrosoftTodoStatusGet + :: VikunjaRequest MigrationMicrosoftTodoStatusGet MimeNoContent MigrationStatus MimeJSON +migrationMicrosoftTodoStatusGet = + _mkRequest "GET" ["/migration/microsoft-todo/status"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data MigrationMicrosoftTodoStatusGet +-- | @application/json@ +instance Produces MigrationMicrosoftTodoStatusGet MimeJSON + + +-- *** migrationTicktickMigratePost + +-- | @POST \/migration\/ticktick\/migrate@ +-- +-- Import all projects, tasks etc. from a TickTick backup export +-- +-- Imports all projects, tasks, notes, reminders, subtasks and files from a TickTick backup export into Vikunja. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +migrationTicktickMigratePost + :: (Consumes MigrationTicktickMigratePost MimeFormUrlEncoded) + => ParamImport -- ^ "_import" - The TickTick backup csv file. + -> VikunjaRequest MigrationTicktickMigratePost MimeFormUrlEncoded ModelsMessage MimeJSON +migrationTicktickMigratePost (ParamImport _import) = + _mkRequest "POST" ["/migration/ticktick/migrate"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + `addForm` toForm ("import", _import) + +data MigrationTicktickMigratePost + +-- | @application/x-www-form-urlencoded@ +instance Consumes MigrationTicktickMigratePost MimeFormUrlEncoded + +-- | @application/json@ +instance Produces MigrationTicktickMigratePost MimeJSON + + +-- *** migrationTicktickStatusGet + +-- | @GET \/migration\/ticktick\/status@ +-- +-- Get migration status +-- +-- Returns if the current user already did the migation or not. This is useful to show a confirmation message in the frontend if the user is trying to do the same migration again. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +migrationTicktickStatusGet + :: VikunjaRequest MigrationTicktickStatusGet MimeNoContent MigrationStatus MimeJSON +migrationTicktickStatusGet = + _mkRequest "GET" ["/migration/ticktick/status"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data MigrationTicktickStatusGet +-- | @application/json@ +instance Produces MigrationTicktickStatusGet MimeJSON + + +-- *** migrationTodoistAuthGet + +-- | @GET \/migration\/todoist\/auth@ +-- +-- Get the auth url from todoist +-- +-- Returns the auth url where the user needs to get its auth code. This code can then be used to migrate everything from todoist to Vikunja. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +migrationTodoistAuthGet + :: VikunjaRequest MigrationTodoistAuthGet MimeNoContent HandlerAuthURL MimeJSON +migrationTodoistAuthGet = + _mkRequest "GET" ["/migration/todoist/auth"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data MigrationTodoistAuthGet +-- | @application/json@ +instance Produces MigrationTodoistAuthGet MimeJSON + + +-- *** migrationTodoistMigratePost + +-- | @POST \/migration\/todoist\/migrate@ +-- +-- Migrate all lists, tasks etc. from todoist +-- +-- Migrates all projects, tasks, notes, reminders, subtasks and files from todoist to vikunja. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +migrationTodoistMigratePost + :: (Consumes MigrationTodoistMigratePost MimeJSON, MimeRender MimeJSON TodoistMigration) + => TodoistMigration -- ^ "migrationCode" - The auth code previously obtained from the auth url. See the docs for /migration/todoist/auth. + -> VikunjaRequest MigrationTodoistMigratePost MimeJSON ModelsMessage MimeJSON +migrationTodoistMigratePost migrationCode = + _mkRequest "POST" ["/migration/todoist/migrate"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + `setBodyParam` migrationCode + +data MigrationTodoistMigratePost + +-- | /Body Param/ "migrationCode" - The auth code previously obtained from the auth url. See the docs for /migration/todoist/auth. +instance HasBodyParam MigrationTodoistMigratePost TodoistMigration + +-- | @application/json@ +instance Consumes MigrationTodoistMigratePost MimeJSON + +-- | @application/json@ +instance Produces MigrationTodoistMigratePost MimeJSON + + +-- *** migrationTodoistStatusGet + +-- | @GET \/migration\/todoist\/status@ +-- +-- Get migration status +-- +-- Returns if the current user already did the migation or not. This is useful to show a confirmation message in the frontend if the user is trying to do the same migration again. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +migrationTodoistStatusGet + :: VikunjaRequest MigrationTodoistStatusGet MimeNoContent MigrationStatus MimeJSON +migrationTodoistStatusGet = + _mkRequest "GET" ["/migration/todoist/status"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data MigrationTodoistStatusGet +-- | @application/json@ +instance Produces MigrationTodoistStatusGet MimeJSON + + +-- *** migrationTrelloAuthGet + +-- | @GET \/migration\/trello\/auth@ +-- +-- Get the auth url from trello +-- +-- Returns the auth url where the user needs to get its auth code. This code can then be used to migrate everything from trello to Vikunja. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +migrationTrelloAuthGet + :: VikunjaRequest MigrationTrelloAuthGet MimeNoContent HandlerAuthURL MimeJSON +migrationTrelloAuthGet = + _mkRequest "GET" ["/migration/trello/auth"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data MigrationTrelloAuthGet +-- | @application/json@ +instance Produces MigrationTrelloAuthGet MimeJSON + + +-- *** migrationTrelloMigratePost + +-- | @POST \/migration\/trello\/migrate@ +-- +-- Migrate all projects, tasks etc. from trello +-- +-- Migrates all projects, tasks, notes, reminders, subtasks and files from trello to vikunja. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +migrationTrelloMigratePost + :: (Consumes MigrationTrelloMigratePost MimeJSON, MimeRender MimeJSON TrelloMigration) + => TrelloMigration -- ^ "migrationCode" - The auth token previously obtained from the auth url. See the docs for /migration/trello/auth. + -> VikunjaRequest MigrationTrelloMigratePost MimeJSON ModelsMessage MimeJSON +migrationTrelloMigratePost migrationCode = + _mkRequest "POST" ["/migration/trello/migrate"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + `setBodyParam` migrationCode + +data MigrationTrelloMigratePost + +-- | /Body Param/ "migrationCode" - The auth token previously obtained from the auth url. See the docs for /migration/trello/auth. +instance HasBodyParam MigrationTrelloMigratePost TrelloMigration + +-- | @application/json@ +instance Consumes MigrationTrelloMigratePost MimeJSON + +-- | @application/json@ +instance Produces MigrationTrelloMigratePost MimeJSON + + +-- *** migrationTrelloStatusGet + +-- | @GET \/migration\/trello\/status@ +-- +-- Get migration status +-- +-- Returns if the current user already did the migation or not. This is useful to show a confirmation message in the frontend if the user is trying to do the same migration again. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +migrationTrelloStatusGet + :: VikunjaRequest MigrationTrelloStatusGet MimeNoContent MigrationStatus MimeJSON +migrationTrelloStatusGet = + _mkRequest "GET" ["/migration/trello/status"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data MigrationTrelloStatusGet +-- | @application/json@ +instance Produces MigrationTrelloStatusGet MimeJSON + + +-- *** migrationVikunjaFileMigratePost + +-- | @POST \/migration\/vikunja-file\/migrate@ +-- +-- Import all projects, tasks etc. from a Vikunja data export +-- +-- Imports all projects, tasks, notes, reminders, subtasks and files from a Vikunjda data export into Vikunja. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +migrationVikunjaFileMigratePost + :: (Consumes MigrationVikunjaFileMigratePost MimeFormUrlEncoded) + => ParamImport -- ^ "_import" - The Vikunja export zip file. + -> VikunjaRequest MigrationVikunjaFileMigratePost MimeFormUrlEncoded ModelsMessage MimeJSON +migrationVikunjaFileMigratePost (ParamImport _import) = + _mkRequest "POST" ["/migration/vikunja-file/migrate"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + `addForm` toForm ("import", _import) + +data MigrationVikunjaFileMigratePost + +-- | @application/x-www-form-urlencoded@ +instance Consumes MigrationVikunjaFileMigratePost MimeFormUrlEncoded + +-- | @application/json@ +instance Produces MigrationVikunjaFileMigratePost MimeJSON + + +-- *** migrationVikunjaFileStatusGet + +-- | @GET \/migration\/vikunja-file\/status@ +-- +-- Get migration status +-- +-- Returns if the current user already did the migation or not. This is useful to show a confirmation message in the frontend if the user is trying to do the same migration again. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +migrationVikunjaFileStatusGet + :: VikunjaRequest MigrationVikunjaFileStatusGet MimeNoContent MigrationStatus MimeJSON +migrationVikunjaFileStatusGet = + _mkRequest "GET" ["/migration/vikunja-file/status"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data MigrationVikunjaFileStatusGet +-- | @application/json@ +instance Produces MigrationVikunjaFileStatusGet MimeJSON + diff --git a/lib/Vikunja/API/Project.hs b/lib/Vikunja/API/Project.hs new file mode 100644 index 0000000..47ef220 --- /dev/null +++ b/lib/Vikunja/API/Project.hs @@ -0,0 +1,693 @@ +{- + Vikunja API + + # Pagination Every endpoint capable of pagination will return two headers: * `x-pagination-total-pages`: The total number of available pages for this request * `x-pagination-result-count`: The number of items returned for this request. # Rights All endpoints which return a single item (project, task, etc.) - no array - will also return a `x-max-right` header with the max right the user has on this item as an int where `0` is `Read Only`, `1` is `Read & Write` and `2` is `Admin`. This can be used to show or hide ui elements based on the rights the user has. # Errors All errors have an error code and a human-readable error message in addition to the http status code. You should always check for the status code in the response, not only the http status code. Due to limitations in the swagger library we're using for this document, only one error per http status code is documented here. Make sure to check the [error docs](https://vikunja.io/docs/errors/) in Vikunja's documentation for a full list of available error codes. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **API Token:** You can create scoped API tokens for your user and use the token to make authenticated requests in the context of that user. The token must be provided via an `Authorization: Bearer ` header, similar to jwt auth. See the documentation for the `api` group to manage token creation and revocation. **BasicAuth:** Only used when requesting tasks via CalDAV. + + OpenAPI Version: 3.0.1 + Vikunja API API version: 0.24.6 + Contact: hello@vikunja.io + Generated by OpenAPI Generator (https://openapi-generator.tech) +-} + +{-| +Module : Vikunja.API.Project +-} + +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE MonoLocalBinds #-} +{-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE OverloadedStrings #-} +{-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-binds -fno-warn-unused-imports #-} + +module Vikunja.API.Project where + +import Vikunja.Core +import Vikunja.MimeTypes +import Vikunja.Model as M + +import qualified Data.Aeson as A +import qualified Data.ByteString as B +import qualified Data.ByteString.Lazy as BL +import qualified Data.Data as P (Typeable, TypeRep, typeOf, typeRep) +import qualified Data.Foldable as P +import qualified Data.Map as Map +import qualified Data.Maybe as P +import qualified Data.Proxy as P (Proxy(..)) +import qualified Data.Set as Set +import qualified Data.String as P +import qualified Data.Text as T +import qualified Data.Text.Encoding as T +import qualified Data.Text.Lazy as TL +import qualified Data.Text.Lazy.Encoding as TL +import qualified Data.Time as TI +import qualified Network.HTTP.Client.MultipartFormData as NH +import qualified Network.HTTP.Media as ME +import qualified Network.HTTP.Types as NH +import qualified Web.FormUrlEncoded as WH +import qualified Web.HttpApiData as WH + +import Data.Text (Text) +import GHC.Base ((<|>)) + +import Prelude ((==),(/=),($), (.),(<$>),(<*>),(>>=),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty,maybe,pure,Monad,Applicative,Functor) +import qualified Prelude as P + +-- * Operations + + +-- ** Project + +-- *** backgroundsUnsplashImageImageGet + +-- | @GET \/backgrounds\/unsplash\/image\/{image}@ +-- +-- Get an unsplash image +-- +-- Get an unsplash image. **Returns json on error.** +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +backgroundsUnsplashImageImageGet + :: Image -- ^ "image" - Unsplash Image ID + -> VikunjaRequest BackgroundsUnsplashImageImageGet MimeNoContent FilePath MimeOctetStream +backgroundsUnsplashImageImageGet (Image image) = + _mkRequest "GET" ["/backgrounds/unsplash/image/",toPath image] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data BackgroundsUnsplashImageImageGet +-- | @application/octet-stream@ +instance Produces BackgroundsUnsplashImageImageGet MimeOctetStream + + +-- *** backgroundsUnsplashImageImageThumbGet + +-- | @GET \/backgrounds\/unsplash\/image\/{image}\/thumb@ +-- +-- Get an unsplash thumbnail image +-- +-- Get an unsplash thumbnail image. The thumbnail is cropped to a max width of 200px. **Returns json on error.** +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +backgroundsUnsplashImageImageThumbGet + :: Image -- ^ "image" - Unsplash Image ID + -> VikunjaRequest BackgroundsUnsplashImageImageThumbGet MimeNoContent FilePath MimeOctetStream +backgroundsUnsplashImageImageThumbGet (Image image) = + _mkRequest "GET" ["/backgrounds/unsplash/image/",toPath image,"/thumb"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data BackgroundsUnsplashImageImageThumbGet +-- | @application/octet-stream@ +instance Produces BackgroundsUnsplashImageImageThumbGet MimeOctetStream + + +-- *** backgroundsUnsplashSearchGet + +-- | @GET \/backgrounds\/unsplash\/search@ +-- +-- Search for a background from unsplash +-- +-- Search for a project background from unsplash +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +backgroundsUnsplashSearchGet + :: VikunjaRequest BackgroundsUnsplashSearchGet MimeNoContent [BackgroundImage] MimeJSON +backgroundsUnsplashSearchGet = + _mkRequest "GET" ["/backgrounds/unsplash/search"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data BackgroundsUnsplashSearchGet + +-- | /Optional Param/ "s" - Search backgrounds from unsplash with this search term. +instance HasOptionalParam BackgroundsUnsplashSearchGet S where + applyOptionalParam req (S xs) = + req `addQuery` toQuery ("s", Just xs) + +-- | /Optional Param/ "p" - The page number. Used for pagination. If not provided, the first page of results is returned. +instance HasOptionalParam BackgroundsUnsplashSearchGet P where + applyOptionalParam req (P xs) = + req `addQuery` toQuery ("p", Just xs) +-- | @application/json@ +instance Produces BackgroundsUnsplashSearchGet MimeJSON + + +-- *** projectsGet + +-- | @GET \/projects@ +-- +-- Get all projects a user has access to +-- +-- Returns all projects a user has access to. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +projectsGet + :: VikunjaRequest ProjectsGet MimeNoContent [ModelsProject] MimeJSON +projectsGet = + _mkRequest "GET" ["/projects"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data ProjectsGet + +-- | /Optional Param/ "page" - The page number. Used for pagination. If not provided, the first page of results is returned. +instance HasOptionalParam ProjectsGet Page where + applyOptionalParam req (Page xs) = + req `addQuery` toQuery ("page", Just xs) + +-- | /Optional Param/ "per_page" - The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page. +instance HasOptionalParam ProjectsGet PerPage where + applyOptionalParam req (PerPage xs) = + req `addQuery` toQuery ("per_page", Just xs) + +-- | /Optional Param/ "s" - Search projects by title. +instance HasOptionalParam ProjectsGet S where + applyOptionalParam req (S xs) = + req `addQuery` toQuery ("s", Just xs) + +-- | /Optional Param/ "is_archived" - If true, also returns all archived projects. +instance HasOptionalParam ProjectsGet IsArchived where + applyOptionalParam req (IsArchived xs) = + req `addQuery` toQuery ("is_archived", Just xs) +-- | @application/json@ +instance Produces ProjectsGet MimeJSON + + +-- *** projectsIdBackgroundDelete + +-- | @DELETE \/projects\/{id}\/background@ +-- +-- Remove a project background +-- +-- Removes a previously set project background, regardless of the project provider used to set the background. It does not throw an error if the project does not have a background. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +projectsIdBackgroundDelete + :: Id -- ^ "id" - Project ID + -> VikunjaRequest ProjectsIdBackgroundDelete MimeNoContent ModelsProject MimeJSON +projectsIdBackgroundDelete (Id id) = + _mkRequest "DELETE" ["/projects/",toPath id,"/background"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data ProjectsIdBackgroundDelete +-- | @application/json@ +instance Produces ProjectsIdBackgroundDelete MimeJSON + + +-- *** projectsIdBackgroundGet + +-- | @GET \/projects\/{id}\/background@ +-- +-- Get the project background +-- +-- Get the project background of a specific project. **Returns json on error.** +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +projectsIdBackgroundGet + :: Id -- ^ "id" - Project ID + -> VikunjaRequest ProjectsIdBackgroundGet MimeNoContent FilePath MimeOctetStream +projectsIdBackgroundGet (Id id) = + _mkRequest "GET" ["/projects/",toPath id,"/background"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data ProjectsIdBackgroundGet +-- | @application/octet-stream@ +instance Produces ProjectsIdBackgroundGet MimeOctetStream + + +-- *** projectsIdBackgroundsUnsplashPost + +-- | @POST \/projects\/{id}\/backgrounds\/unsplash@ +-- +-- Set an unsplash photo as project background +-- +-- Sets a photo from unsplash as project background. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +projectsIdBackgroundsUnsplashPost + :: (Consumes ProjectsIdBackgroundsUnsplashPost MimeJSON, MimeRender MimeJSON BackgroundImage) + => BackgroundImage -- ^ "project" - The image you want to set as background + -> Id -- ^ "id" - Project ID + -> VikunjaRequest ProjectsIdBackgroundsUnsplashPost MimeJSON ModelsProject MimeJSON +projectsIdBackgroundsUnsplashPost project (Id id) = + _mkRequest "POST" ["/projects/",toPath id,"/backgrounds/unsplash"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + `setBodyParam` project + +data ProjectsIdBackgroundsUnsplashPost + +-- | /Body Param/ "project" - The image you want to set as background +instance HasBodyParam ProjectsIdBackgroundsUnsplashPost BackgroundImage + +-- | @application/json@ +instance Consumes ProjectsIdBackgroundsUnsplashPost MimeJSON + +-- | @application/json@ +instance Produces ProjectsIdBackgroundsUnsplashPost MimeJSON + + +-- *** projectsIdBackgroundsUploadPut + +-- | @PUT \/projects\/{id}\/backgrounds\/upload@ +-- +-- Upload a project background +-- +-- Upload a project background. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +projectsIdBackgroundsUploadPut + :: (Consumes ProjectsIdBackgroundsUploadPut MimeMultipartFormData) + => Background -- ^ "background" - The file as single file. + -> Id -- ^ "id" - Project ID + -> VikunjaRequest ProjectsIdBackgroundsUploadPut MimeMultipartFormData ModelsMessage MimeJSON +projectsIdBackgroundsUploadPut (Background background) (Id id) = + _mkRequest "PUT" ["/projects/",toPath id,"/backgrounds/upload"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + `_addMultiFormPart` NH.partLBS "background" (mimeRender' MimeMultipartFormData background) + +data ProjectsIdBackgroundsUploadPut + +-- | @multipart/form-data@ +instance Consumes ProjectsIdBackgroundsUploadPut MimeMultipartFormData + +-- | @application/json@ +instance Produces ProjectsIdBackgroundsUploadPut MimeJSON + + +-- *** projectsIdDelete + +-- | @DELETE \/projects\/{id}@ +-- +-- Deletes a project +-- +-- Delets a project +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +projectsIdDelete + :: Id -- ^ "id" - Project ID + -> VikunjaRequest ProjectsIdDelete MimeNoContent ModelsMessage MimeJSON +projectsIdDelete (Id id) = + _mkRequest "DELETE" ["/projects/",toPath id] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data ProjectsIdDelete +-- | @application/json@ +instance Produces ProjectsIdDelete MimeJSON + + +-- *** projectsIdGet + +-- | @GET \/projects\/{id}@ +-- +-- Gets one project +-- +-- Returns a project by its ID. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +projectsIdGet + :: Id -- ^ "id" - Project ID + -> VikunjaRequest ProjectsIdGet MimeNoContent ModelsProject MimeJSON +projectsIdGet (Id id) = + _mkRequest "GET" ["/projects/",toPath id] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data ProjectsIdGet +-- | @application/json@ +instance Produces ProjectsIdGet MimeJSON + + +-- *** projectsIdPost + +-- | @POST \/projects\/{id}@ +-- +-- Updates a project +-- +-- Updates a project. This does not include adding a task (see below). +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +projectsIdPost + :: (Consumes ProjectsIdPost MimeJSON, MimeRender MimeJSON ModelsProject) + => ModelsProject -- ^ "project" - The project with updated values you want to update. + -> Id -- ^ "id" - Project ID + -> VikunjaRequest ProjectsIdPost MimeJSON ModelsProject MimeJSON +projectsIdPost project (Id id) = + _mkRequest "POST" ["/projects/",toPath id] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + `setBodyParam` project + +data ProjectsIdPost + +-- | /Body Param/ "project" - The project with updated values you want to update. +instance HasBodyParam ProjectsIdPost ModelsProject + +-- | @application/json@ +instance Consumes ProjectsIdPost MimeJSON + +-- | @application/json@ +instance Produces ProjectsIdPost MimeJSON + + +-- *** projectsIdProjectusersGet + +-- | @GET \/projects\/{id}\/projectusers@ +-- +-- Get users +-- +-- Lists all users (without emailadresses). Also possible to search for a specific user. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +projectsIdProjectusersGet + :: Id -- ^ "id" - Project ID + -> VikunjaRequest ProjectsIdProjectusersGet MimeNoContent [UserUser] MimeJSON +projectsIdProjectusersGet (Id id) = + _mkRequest "GET" ["/projects/",toPath id,"/projectusers"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data ProjectsIdProjectusersGet + +-- | /Optional Param/ "s" - Search for a user by its name. +instance HasOptionalParam ProjectsIdProjectusersGet S where + applyOptionalParam req (S xs) = + req `addQuery` toQuery ("s", Just xs) +-- | @application/json@ +instance Produces ProjectsIdProjectusersGet MimeJSON + + +-- *** projectsIdViewsViewBucketsGet + +-- | @GET \/projects\/{id}\/views\/{view}\/buckets@ +-- +-- Get all kanban buckets of a project +-- +-- Returns all kanban buckets which belong to that project. Buckets are always sorted by their `position` in ascending order. To get all buckets with their tasks, use the tasks endpoint with a kanban view. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +projectsIdViewsViewBucketsGet + :: Id -- ^ "id" - Project ID + -> View -- ^ "view" - Project view ID + -> VikunjaRequest ProjectsIdViewsViewBucketsGet MimeNoContent [ModelsBucket] MimeJSON +projectsIdViewsViewBucketsGet (Id id) (View view) = + _mkRequest "GET" ["/projects/",toPath id,"/views/",toPath view,"/buckets"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data ProjectsIdViewsViewBucketsGet +-- | @application/json@ +instance Produces ProjectsIdViewsViewBucketsGet MimeJSON + + +-- *** projectsIdViewsViewBucketsPut + +-- | @PUT \/projects\/{id}\/views\/{view}\/buckets@ +-- +-- Create a new bucket +-- +-- Creates a new kanban bucket on a project. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +projectsIdViewsViewBucketsPut + :: (Consumes ProjectsIdViewsViewBucketsPut MimeJSON, MimeRender MimeJSON ModelsBucket) + => ModelsBucket -- ^ "bucket" - The bucket object + -> Id -- ^ "id" - Project Id + -> View -- ^ "view" - Project view ID + -> VikunjaRequest ProjectsIdViewsViewBucketsPut MimeJSON ModelsBucket MimeJSON +projectsIdViewsViewBucketsPut bucket (Id id) (View view) = + _mkRequest "PUT" ["/projects/",toPath id,"/views/",toPath view,"/buckets"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + `setBodyParam` bucket + +data ProjectsIdViewsViewBucketsPut + +-- | /Body Param/ "bucket" - The bucket object +instance HasBodyParam ProjectsIdViewsViewBucketsPut ModelsBucket + +-- | @application/json@ +instance Consumes ProjectsIdViewsViewBucketsPut MimeJSON + +-- | @application/json@ +instance Produces ProjectsIdViewsViewBucketsPut MimeJSON + + +-- *** projectsProjectIDDuplicatePut + +-- | @PUT \/projects\/{projectID}\/duplicate@ +-- +-- Duplicate an existing project +-- +-- Copies the project, tasks, files, kanban data, assignees, comments, attachments, lables, relations, backgrounds, user/team rights and link shares from one project to a new one. The user needs read access in the project and write access in the parent of the new project. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +projectsProjectIDDuplicatePut + :: (Consumes ProjectsProjectIDDuplicatePut MimeJSON, MimeRender MimeJSON ModelsProjectDuplicate) + => ModelsProjectDuplicate -- ^ "project" - The target parent project which should hold the copied project. + -> ProjectId -- ^ "projectId" - The project ID to duplicate + -> VikunjaRequest ProjectsProjectIDDuplicatePut MimeJSON ModelsProjectDuplicate MimeJSON +projectsProjectIDDuplicatePut project (ProjectId projectId) = + _mkRequest "PUT" ["/projects/",toPath projectId,"/duplicate"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + `setBodyParam` project + +data ProjectsProjectIDDuplicatePut + +-- | /Body Param/ "project" - The target parent project which should hold the copied project. +instance HasBodyParam ProjectsProjectIDDuplicatePut ModelsProjectDuplicate + +-- | @application/json@ +instance Consumes ProjectsProjectIDDuplicatePut MimeJSON + +-- | @application/json@ +instance Produces ProjectsProjectIDDuplicatePut MimeJSON + + +-- *** projectsProjectIDViewsViewBucketsBucketIDDelete + +-- | @DELETE \/projects\/{projectID}\/views\/{view}\/buckets\/{bucketID}@ +-- +-- Deletes an existing bucket +-- +-- Deletes an existing kanban bucket and dissociates all of its task. It does not delete any tasks. You cannot delete the last bucket on a project. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +projectsProjectIDViewsViewBucketsBucketIDDelete + :: ProjectId -- ^ "projectId" - Project Id + -> BucketId -- ^ "bucketId" - Bucket Id + -> View -- ^ "view" - Project view ID + -> VikunjaRequest ProjectsProjectIDViewsViewBucketsBucketIDDelete MimeNoContent ModelsMessage MimeJSON +projectsProjectIDViewsViewBucketsBucketIDDelete (ProjectId projectId) (BucketId bucketId) (View view) = + _mkRequest "DELETE" ["/projects/",toPath projectId,"/views/",toPath view,"/buckets/",toPath bucketId] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data ProjectsProjectIDViewsViewBucketsBucketIDDelete +-- | @application/json@ +instance Produces ProjectsProjectIDViewsViewBucketsBucketIDDelete MimeJSON + + +-- *** projectsProjectIDViewsViewBucketsBucketIDPost + +-- | @POST \/projects\/{projectID}\/views\/{view}\/buckets\/{bucketID}@ +-- +-- Update an existing bucket +-- +-- Updates an existing kanban bucket. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +projectsProjectIDViewsViewBucketsBucketIDPost + :: (Consumes ProjectsProjectIDViewsViewBucketsBucketIDPost MimeJSON, MimeRender MimeJSON ModelsBucket) + => ModelsBucket -- ^ "bucket" - The bucket object + -> ProjectId -- ^ "projectId" - Project Id + -> BucketId -- ^ "bucketId" - Bucket Id + -> View -- ^ "view" - Project view ID + -> VikunjaRequest ProjectsProjectIDViewsViewBucketsBucketIDPost MimeJSON ModelsBucket MimeJSON +projectsProjectIDViewsViewBucketsBucketIDPost bucket (ProjectId projectId) (BucketId bucketId) (View view) = + _mkRequest "POST" ["/projects/",toPath projectId,"/views/",toPath view,"/buckets/",toPath bucketId] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + `setBodyParam` bucket + +data ProjectsProjectIDViewsViewBucketsBucketIDPost + +-- | /Body Param/ "bucket" - The bucket object +instance HasBodyParam ProjectsProjectIDViewsViewBucketsBucketIDPost ModelsBucket + +-- | @application/json@ +instance Consumes ProjectsProjectIDViewsViewBucketsBucketIDPost MimeJSON + +-- | @application/json@ +instance Produces ProjectsProjectIDViewsViewBucketsBucketIDPost MimeJSON + + +-- *** projectsProjectViewsGet + +-- | @GET \/projects\/{project}\/views@ +-- +-- Get all project views for a project +-- +-- Returns all project views for a sepcific project +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +projectsProjectViewsGet + :: Project -- ^ "project" - Project ID + -> VikunjaRequest ProjectsProjectViewsGet MimeNoContent [ModelsProjectView] MimeJSON +projectsProjectViewsGet (Project project) = + _mkRequest "GET" ["/projects/",toPath project,"/views"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data ProjectsProjectViewsGet +-- | @application/json@ +instance Produces ProjectsProjectViewsGet MimeJSON + + +-- *** projectsProjectViewsIdDelete + +-- | @DELETE \/projects\/{project}\/views\/{id}@ +-- +-- Delete a project view +-- +-- Deletes a project view. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +projectsProjectViewsIdDelete + :: Project -- ^ "project" - Project ID + -> Id -- ^ "id" - Project View ID + -> VikunjaRequest ProjectsProjectViewsIdDelete MimeNoContent ModelsMessage MimeJSON +projectsProjectViewsIdDelete (Project project) (Id id) = + _mkRequest "DELETE" ["/projects/",toPath project,"/views/",toPath id] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data ProjectsProjectViewsIdDelete +-- | @application/json@ +instance Produces ProjectsProjectViewsIdDelete MimeJSON + + +-- *** projectsProjectViewsIdGet + +-- | @GET \/projects\/{project}\/views\/{id}@ +-- +-- Get one project view +-- +-- Returns a project view by its ID. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +projectsProjectViewsIdGet + :: Project -- ^ "project" - Project ID + -> Id -- ^ "id" - Project View ID + -> VikunjaRequest ProjectsProjectViewsIdGet MimeNoContent ModelsProjectView MimeJSON +projectsProjectViewsIdGet (Project project) (Id id) = + _mkRequest "GET" ["/projects/",toPath project,"/views/",toPath id] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data ProjectsProjectViewsIdGet +-- | @application/json@ +instance Produces ProjectsProjectViewsIdGet MimeJSON + + +-- *** projectsProjectViewsIdPost + +-- | @POST \/projects\/{project}\/views\/{id}@ +-- +-- Updates a project view +-- +-- Updates a project view. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +projectsProjectViewsIdPost + :: (Consumes ProjectsProjectViewsIdPost MimeJSON, MimeRender MimeJSON ModelsProjectView) + => ModelsProjectView -- ^ "view" - The project view with updated values you want to change. + -> Project -- ^ "project" - Project ID + -> Id -- ^ "id" - Project View ID + -> VikunjaRequest ProjectsProjectViewsIdPost MimeJSON ModelsProjectView MimeJSON +projectsProjectViewsIdPost view (Project project) (Id id) = + _mkRequest "POST" ["/projects/",toPath project,"/views/",toPath id] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + `setBodyParam` view + +data ProjectsProjectViewsIdPost + +-- | /Body Param/ "view" - The project view with updated values you want to change. +instance HasBodyParam ProjectsProjectViewsIdPost ModelsProjectView + +-- | @application/json@ +instance Consumes ProjectsProjectViewsIdPost MimeJSON + +-- | @application/json@ +instance Produces ProjectsProjectViewsIdPost MimeJSON + + +-- *** projectsProjectViewsPut + +-- | @PUT \/projects\/{project}\/views@ +-- +-- Create a project view +-- +-- Create a project view in a specific project. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +projectsProjectViewsPut + :: (Consumes ProjectsProjectViewsPut MimeJSON, MimeRender MimeJSON ModelsProjectView) + => ModelsProjectView -- ^ "view" - The project view you want to create. + -> Project -- ^ "project" - Project ID + -> VikunjaRequest ProjectsProjectViewsPut MimeJSON ModelsProjectView MimeJSON +projectsProjectViewsPut view (Project project) = + _mkRequest "PUT" ["/projects/",toPath project,"/views"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + `setBodyParam` view + +data ProjectsProjectViewsPut + +-- | /Body Param/ "view" - The project view you want to create. +instance HasBodyParam ProjectsProjectViewsPut ModelsProjectView + +-- | @application/json@ +instance Consumes ProjectsProjectViewsPut MimeJSON + +-- | @application/json@ +instance Produces ProjectsProjectViewsPut MimeJSON + + +-- *** projectsPut + +-- | @PUT \/projects@ +-- +-- Creates a new project +-- +-- Creates a new project. If a parent project is provided the user needs to have write access to that project. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +projectsPut + :: (Consumes ProjectsPut MimeJSON, MimeRender MimeJSON ModelsProject) + => ModelsProject -- ^ "project" - The project you want to create. + -> VikunjaRequest ProjectsPut MimeJSON ModelsProject MimeJSON +projectsPut project = + _mkRequest "PUT" ["/projects"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + `setBodyParam` project + +data ProjectsPut + +-- | /Body Param/ "project" - The project you want to create. +instance HasBodyParam ProjectsPut ModelsProject + +-- | @application/json@ +instance Consumes ProjectsPut MimeJSON + +-- | @application/json@ +instance Produces ProjectsPut MimeJSON + diff --git a/lib/Vikunja/API/Service.hs b/lib/Vikunja/API/Service.hs new file mode 100644 index 0000000..191329a --- /dev/null +++ b/lib/Vikunja/API/Service.hs @@ -0,0 +1,77 @@ +{- + Vikunja API + + # Pagination Every endpoint capable of pagination will return two headers: * `x-pagination-total-pages`: The total number of available pages for this request * `x-pagination-result-count`: The number of items returned for this request. # Rights All endpoints which return a single item (project, task, etc.) - no array - will also return a `x-max-right` header with the max right the user has on this item as an int where `0` is `Read Only`, `1` is `Read & Write` and `2` is `Admin`. This can be used to show or hide ui elements based on the rights the user has. # Errors All errors have an error code and a human-readable error message in addition to the http status code. You should always check for the status code in the response, not only the http status code. Due to limitations in the swagger library we're using for this document, only one error per http status code is documented here. Make sure to check the [error docs](https://vikunja.io/docs/errors/) in Vikunja's documentation for a full list of available error codes. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **API Token:** You can create scoped API tokens for your user and use the token to make authenticated requests in the context of that user. The token must be provided via an `Authorization: Bearer ` header, similar to jwt auth. See the documentation for the `api` group to manage token creation and revocation. **BasicAuth:** Only used when requesting tasks via CalDAV. + + OpenAPI Version: 3.0.1 + Vikunja API API version: 0.24.6 + Contact: hello@vikunja.io + Generated by OpenAPI Generator (https://openapi-generator.tech) +-} + +{-| +Module : Vikunja.API.Service +-} + +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE MonoLocalBinds #-} +{-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE OverloadedStrings #-} +{-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-binds -fno-warn-unused-imports #-} + +module Vikunja.API.Service where + +import Vikunja.Core +import Vikunja.MimeTypes +import Vikunja.Model as M + +import qualified Data.Aeson as A +import qualified Data.ByteString as B +import qualified Data.ByteString.Lazy as BL +import qualified Data.Data as P (Typeable, TypeRep, typeOf, typeRep) +import qualified Data.Foldable as P +import qualified Data.Map as Map +import qualified Data.Maybe as P +import qualified Data.Proxy as P (Proxy(..)) +import qualified Data.Set as Set +import qualified Data.String as P +import qualified Data.Text as T +import qualified Data.Text.Encoding as T +import qualified Data.Text.Lazy as TL +import qualified Data.Text.Lazy.Encoding as TL +import qualified Data.Time as TI +import qualified Network.HTTP.Client.MultipartFormData as NH +import qualified Network.HTTP.Media as ME +import qualified Network.HTTP.Types as NH +import qualified Web.FormUrlEncoded as WH +import qualified Web.HttpApiData as WH + +import Data.Text (Text) +import GHC.Base ((<|>)) + +import Prelude ((==),(/=),($), (.),(<$>),(<*>),(>>=),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty,maybe,pure,Monad,Applicative,Functor) +import qualified Prelude as P + +-- * Operations + + +-- ** Service + +-- *** infoGet + +-- | @GET \/info@ +-- +-- Info +-- +-- Returns the version, frontendurl, motd and various settings of Vikunja +-- +infoGet + :: VikunjaRequest InfoGet MimeNoContent V1VikunjaInfos MimeJSON +infoGet = + _mkRequest "GET" ["/info"] + +data InfoGet +-- | @application/json@ +instance Produces InfoGet MimeJSON + diff --git a/lib/Vikunja/API/Sharing.hs b/lib/Vikunja/API/Sharing.hs new file mode 100644 index 0000000..2cd3cb5 --- /dev/null +++ b/lib/Vikunja/API/Sharing.hs @@ -0,0 +1,469 @@ +{- + Vikunja API + + # Pagination Every endpoint capable of pagination will return two headers: * `x-pagination-total-pages`: The total number of available pages for this request * `x-pagination-result-count`: The number of items returned for this request. # Rights All endpoints which return a single item (project, task, etc.) - no array - will also return a `x-max-right` header with the max right the user has on this item as an int where `0` is `Read Only`, `1` is `Read & Write` and `2` is `Admin`. This can be used to show or hide ui elements based on the rights the user has. # Errors All errors have an error code and a human-readable error message in addition to the http status code. You should always check for the status code in the response, not only the http status code. Due to limitations in the swagger library we're using for this document, only one error per http status code is documented here. Make sure to check the [error docs](https://vikunja.io/docs/errors/) in Vikunja's documentation for a full list of available error codes. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **API Token:** You can create scoped API tokens for your user and use the token to make authenticated requests in the context of that user. The token must be provided via an `Authorization: Bearer ` header, similar to jwt auth. See the documentation for the `api` group to manage token creation and revocation. **BasicAuth:** Only used when requesting tasks via CalDAV. + + OpenAPI Version: 3.0.1 + Vikunja API API version: 0.24.6 + Contact: hello@vikunja.io + Generated by OpenAPI Generator (https://openapi-generator.tech) +-} + +{-| +Module : Vikunja.API.Sharing +-} + +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE MonoLocalBinds #-} +{-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE OverloadedStrings #-} +{-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-binds -fno-warn-unused-imports #-} + +module Vikunja.API.Sharing where + +import Vikunja.Core +import Vikunja.MimeTypes +import Vikunja.Model as M + +import qualified Data.Aeson as A +import qualified Data.ByteString as B +import qualified Data.ByteString.Lazy as BL +import qualified Data.Data as P (Typeable, TypeRep, typeOf, typeRep) +import qualified Data.Foldable as P +import qualified Data.Map as Map +import qualified Data.Maybe as P +import qualified Data.Proxy as P (Proxy(..)) +import qualified Data.Set as Set +import qualified Data.String as P +import qualified Data.Text as T +import qualified Data.Text.Encoding as T +import qualified Data.Text.Lazy as TL +import qualified Data.Text.Lazy.Encoding as TL +import qualified Data.Time as TI +import qualified Network.HTTP.Client.MultipartFormData as NH +import qualified Network.HTTP.Media as ME +import qualified Network.HTTP.Types as NH +import qualified Web.FormUrlEncoded as WH +import qualified Web.HttpApiData as WH + +import Data.Text (Text) +import GHC.Base ((<|>)) + +import Prelude ((==),(/=),($), (.),(<$>),(<*>),(>>=),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty,maybe,pure,Monad,Applicative,Functor) +import qualified Prelude as P + +-- * Operations + + +-- ** Sharing + +-- *** notificationsPost + +-- | @POST \/notifications@ +-- +-- Mark all notifications of a user as read +-- +notificationsPost + :: VikunjaRequest NotificationsPost MimeNoContent ModelsMessage MimeJSON +notificationsPost = + _mkRequest "POST" ["/notifications"] + +data NotificationsPost +-- | @application/json@ +instance Produces NotificationsPost MimeJSON + + +-- *** projectsIdTeamsGet + +-- | @GET \/projects\/{id}\/teams@ +-- +-- Get teams on a project +-- +-- Returns a project with all teams which have access on a given project. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +projectsIdTeamsGet + :: Id -- ^ "id" - Project ID + -> VikunjaRequest ProjectsIdTeamsGet MimeNoContent [ModelsTeamWithRight] MimeJSON +projectsIdTeamsGet (Id id) = + _mkRequest "GET" ["/projects/",toPath id,"/teams"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data ProjectsIdTeamsGet + +-- | /Optional Param/ "page" - The page number. Used for pagination. If not provided, the first page of results is returned. +instance HasOptionalParam ProjectsIdTeamsGet Page where + applyOptionalParam req (Page xs) = + req `addQuery` toQuery ("page", Just xs) + +-- | /Optional Param/ "per_page" - The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page. +instance HasOptionalParam ProjectsIdTeamsGet PerPage where + applyOptionalParam req (PerPage xs) = + req `addQuery` toQuery ("per_page", Just xs) + +-- | /Optional Param/ "s" - Search teams by its name. +instance HasOptionalParam ProjectsIdTeamsGet S where + applyOptionalParam req (S xs) = + req `addQuery` toQuery ("s", Just xs) +-- | @application/json@ +instance Produces ProjectsIdTeamsGet MimeJSON + + +-- *** projectsIdTeamsPut + +-- | @PUT \/projects\/{id}\/teams@ +-- +-- Add a team to a project +-- +-- Gives a team access to a project. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +projectsIdTeamsPut + :: (Consumes ProjectsIdTeamsPut MimeJSON, MimeRender MimeJSON ModelsTeamProject) + => ModelsTeamProject -- ^ "project" - The team you want to add to the project. + -> Id -- ^ "id" - Project ID + -> VikunjaRequest ProjectsIdTeamsPut MimeJSON ModelsTeamProject MimeJSON +projectsIdTeamsPut project (Id id) = + _mkRequest "PUT" ["/projects/",toPath id,"/teams"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + `setBodyParam` project + +data ProjectsIdTeamsPut + +-- | /Body Param/ "project" - The team you want to add to the project. +instance HasBodyParam ProjectsIdTeamsPut ModelsTeamProject + +-- | @application/json@ +instance Consumes ProjectsIdTeamsPut MimeJSON + +-- | @application/json@ +instance Produces ProjectsIdTeamsPut MimeJSON + + +-- *** projectsIdUsersGet + +-- | @GET \/projects\/{id}\/users@ +-- +-- Get users on a project +-- +-- Returns a project with all users which have access on a given project. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +projectsIdUsersGet + :: Id -- ^ "id" - Project ID + -> VikunjaRequest ProjectsIdUsersGet MimeNoContent [ModelsUserWithRight] MimeJSON +projectsIdUsersGet (Id id) = + _mkRequest "GET" ["/projects/",toPath id,"/users"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data ProjectsIdUsersGet + +-- | /Optional Param/ "page" - The page number. Used for pagination. If not provided, the first page of results is returned. +instance HasOptionalParam ProjectsIdUsersGet Page where + applyOptionalParam req (Page xs) = + req `addQuery` toQuery ("page", Just xs) + +-- | /Optional Param/ "per_page" - The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page. +instance HasOptionalParam ProjectsIdUsersGet PerPage where + applyOptionalParam req (PerPage xs) = + req `addQuery` toQuery ("per_page", Just xs) + +-- | /Optional Param/ "s" - Search users by its name. +instance HasOptionalParam ProjectsIdUsersGet S where + applyOptionalParam req (S xs) = + req `addQuery` toQuery ("s", Just xs) +-- | @application/json@ +instance Produces ProjectsIdUsersGet MimeJSON + + +-- *** projectsIdUsersPut + +-- | @PUT \/projects\/{id}\/users@ +-- +-- Add a user to a project +-- +-- Gives a user access to a project. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +projectsIdUsersPut + :: (Consumes ProjectsIdUsersPut MimeJSON, MimeRender MimeJSON ModelsProjectUser) + => ModelsProjectUser -- ^ "project" - The user you want to add to the project. + -> Id -- ^ "id" - Project ID + -> VikunjaRequest ProjectsIdUsersPut MimeJSON ModelsProjectUser MimeJSON +projectsIdUsersPut project (Id id) = + _mkRequest "PUT" ["/projects/",toPath id,"/users"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + `setBodyParam` project + +data ProjectsIdUsersPut + +-- | /Body Param/ "project" - The user you want to add to the project. +instance HasBodyParam ProjectsIdUsersPut ModelsProjectUser + +-- | @application/json@ +instance Consumes ProjectsIdUsersPut MimeJSON + +-- | @application/json@ +instance Produces ProjectsIdUsersPut MimeJSON + + +-- *** projectsProjectIDTeamsTeamIDDelete + +-- | @DELETE \/projects\/{projectID}\/teams\/{teamID}@ +-- +-- Delete a team from a project +-- +-- Delets a team from a project. The team won't have access to the project anymore. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +projectsProjectIDTeamsTeamIDDelete + :: ProjectId -- ^ "projectId" - Project ID + -> TeamId -- ^ "teamId" - Team ID + -> VikunjaRequest ProjectsProjectIDTeamsTeamIDDelete MimeNoContent ModelsMessage MimeJSON +projectsProjectIDTeamsTeamIDDelete (ProjectId projectId) (TeamId teamId) = + _mkRequest "DELETE" ["/projects/",toPath projectId,"/teams/",toPath teamId] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data ProjectsProjectIDTeamsTeamIDDelete +-- | @application/json@ +instance Produces ProjectsProjectIDTeamsTeamIDDelete MimeJSON + + +-- *** projectsProjectIDTeamsTeamIDPost + +-- | @POST \/projects\/{projectID}\/teams\/{teamID}@ +-- +-- Update a team <-> project relation +-- +-- Update a team <-> project relation. Mostly used to update the right that team has. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +projectsProjectIDTeamsTeamIDPost + :: (Consumes ProjectsProjectIDTeamsTeamIDPost MimeJSON, MimeRender MimeJSON ModelsTeamProject) + => ModelsTeamProject -- ^ "project" - The team you want to update. + -> ProjectId -- ^ "projectId" - Project ID + -> TeamId -- ^ "teamId" - Team ID + -> VikunjaRequest ProjectsProjectIDTeamsTeamIDPost MimeJSON ModelsTeamProject MimeJSON +projectsProjectIDTeamsTeamIDPost project (ProjectId projectId) (TeamId teamId) = + _mkRequest "POST" ["/projects/",toPath projectId,"/teams/",toPath teamId] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + `setBodyParam` project + +data ProjectsProjectIDTeamsTeamIDPost + +-- | /Body Param/ "project" - The team you want to update. +instance HasBodyParam ProjectsProjectIDTeamsTeamIDPost ModelsTeamProject + +-- | @application/json@ +instance Consumes ProjectsProjectIDTeamsTeamIDPost MimeJSON + +-- | @application/json@ +instance Produces ProjectsProjectIDTeamsTeamIDPost MimeJSON + + +-- *** projectsProjectIDUsersUserIDDelete + +-- | @DELETE \/projects\/{projectID}\/users\/{userID}@ +-- +-- Delete a user from a project +-- +-- Delets a user from a project. The user won't have access to the project anymore. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +projectsProjectIDUsersUserIDDelete + :: ProjectId -- ^ "projectId" - Project ID + -> UserId -- ^ "userId" - User ID + -> VikunjaRequest ProjectsProjectIDUsersUserIDDelete MimeNoContent ModelsMessage MimeJSON +projectsProjectIDUsersUserIDDelete (ProjectId projectId) (UserId userId) = + _mkRequest "DELETE" ["/projects/",toPath projectId,"/users/",toPath userId] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data ProjectsProjectIDUsersUserIDDelete +-- | @application/json@ +instance Produces ProjectsProjectIDUsersUserIDDelete MimeJSON + + +-- *** projectsProjectIDUsersUserIDPost + +-- | @POST \/projects\/{projectID}\/users\/{userID}@ +-- +-- Update a user <-> project relation +-- +-- Update a user <-> project relation. Mostly used to update the right that user has. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +projectsProjectIDUsersUserIDPost + :: (Consumes ProjectsProjectIDUsersUserIDPost MimeJSON, MimeRender MimeJSON ModelsProjectUser) + => ModelsProjectUser -- ^ "project" - The user you want to update. + -> ProjectId -- ^ "projectId" - Project ID + -> UserId -- ^ "userId" - User ID + -> VikunjaRequest ProjectsProjectIDUsersUserIDPost MimeJSON ModelsProjectUser MimeJSON +projectsProjectIDUsersUserIDPost project (ProjectId projectId) (UserId userId) = + _mkRequest "POST" ["/projects/",toPath projectId,"/users/",toPath userId] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + `setBodyParam` project + +data ProjectsProjectIDUsersUserIDPost + +-- | /Body Param/ "project" - The user you want to update. +instance HasBodyParam ProjectsProjectIDUsersUserIDPost ModelsProjectUser + +-- | @application/json@ +instance Consumes ProjectsProjectIDUsersUserIDPost MimeJSON + +-- | @application/json@ +instance Produces ProjectsProjectIDUsersUserIDPost MimeJSON + + +-- *** projectsProjectSharesGet + +-- | @GET \/projects\/{project}\/shares@ +-- +-- Get all link shares for a project +-- +-- Returns all link shares which exist for a given project +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +projectsProjectSharesGet + :: Project -- ^ "project" - Project ID + -> VikunjaRequest ProjectsProjectSharesGet MimeNoContent [ModelsLinkSharing] MimeJSON +projectsProjectSharesGet (Project project) = + _mkRequest "GET" ["/projects/",toPath project,"/shares"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data ProjectsProjectSharesGet + +-- | /Optional Param/ "page" - The page number. Used for pagination. If not provided, the first page of results is returned. +instance HasOptionalParam ProjectsProjectSharesGet Page where + applyOptionalParam req (Page xs) = + req `addQuery` toQuery ("page", Just xs) + +-- | /Optional Param/ "per_page" - The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page. +instance HasOptionalParam ProjectsProjectSharesGet PerPage where + applyOptionalParam req (PerPage xs) = + req `addQuery` toQuery ("per_page", Just xs) + +-- | /Optional Param/ "s" - Search shares by hash. +instance HasOptionalParam ProjectsProjectSharesGet S where + applyOptionalParam req (S xs) = + req `addQuery` toQuery ("s", Just xs) +-- | @application/json@ +instance Produces ProjectsProjectSharesGet MimeJSON + + +-- *** projectsProjectSharesPut + +-- | @PUT \/projects\/{project}\/shares@ +-- +-- Share a project via link +-- +-- Share a project via link. The user needs to have write-access to the project to be able do this. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +projectsProjectSharesPut + :: (Consumes ProjectsProjectSharesPut MimeJSON, MimeRender MimeJSON ModelsLinkSharing) + => ModelsLinkSharing -- ^ "label" - The new link share object + -> Project -- ^ "project" - Project ID + -> VikunjaRequest ProjectsProjectSharesPut MimeJSON ModelsLinkSharing MimeJSON +projectsProjectSharesPut label (Project project) = + _mkRequest "PUT" ["/projects/",toPath project,"/shares"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + `setBodyParam` label + +data ProjectsProjectSharesPut + +-- | /Body Param/ "label" - The new link share object +instance HasBodyParam ProjectsProjectSharesPut ModelsLinkSharing + +-- | @application/json@ +instance Consumes ProjectsProjectSharesPut MimeJSON + +-- | @application/json@ +instance Produces ProjectsProjectSharesPut MimeJSON + + +-- *** projectsProjectSharesShareDelete + +-- | @DELETE \/projects\/{project}\/shares\/{share}@ +-- +-- Remove a link share +-- +-- Remove a link share. The user needs to have write-access to the project to be able do this. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +projectsProjectSharesShareDelete + :: Project -- ^ "project" - Project ID + -> Share -- ^ "share" - Share Link ID + -> VikunjaRequest ProjectsProjectSharesShareDelete MimeNoContent ModelsMessage MimeJSON +projectsProjectSharesShareDelete (Project project) (Share share) = + _mkRequest "DELETE" ["/projects/",toPath project,"/shares/",toPath share] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data ProjectsProjectSharesShareDelete +-- | @application/json@ +instance Produces ProjectsProjectSharesShareDelete MimeJSON + + +-- *** projectsProjectSharesShareGet + +-- | @GET \/projects\/{project}\/shares\/{share}@ +-- +-- Get one link shares for a project +-- +-- Returns one link share by its ID. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +projectsProjectSharesShareGet + :: Project -- ^ "project" - Project ID + -> Share -- ^ "share" - Share ID + -> VikunjaRequest ProjectsProjectSharesShareGet MimeNoContent ModelsLinkSharing MimeJSON +projectsProjectSharesShareGet (Project project) (Share share) = + _mkRequest "GET" ["/projects/",toPath project,"/shares/",toPath share] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data ProjectsProjectSharesShareGet +-- | @application/json@ +instance Produces ProjectsProjectSharesShareGet MimeJSON + + +-- *** sharesShareAuthPost + +-- | @POST \/shares\/{share}\/auth@ +-- +-- Get an auth token for a share +-- +-- Get a jwt auth token for a shared project from a share hash. +-- +sharesShareAuthPost + :: (Consumes SharesShareAuthPost MimeJSON, MimeRender MimeJSON V1LinkShareAuth) + => V1LinkShareAuth -- ^ "password" - The password for link shares which require one. + -> ShareText -- ^ "share" - The share hash + -> VikunjaRequest SharesShareAuthPost MimeJSON AuthToken MimeJSON +sharesShareAuthPost password (ShareText share) = + _mkRequest "POST" ["/shares/",toPath share,"/auth"] + `setBodyParam` password + +data SharesShareAuthPost + +-- | /Body Param/ "password" - The password for link shares which require one. +instance HasBodyParam SharesShareAuthPost V1LinkShareAuth + +-- | @application/json@ +instance Consumes SharesShareAuthPost MimeJSON + +-- | @application/json@ +instance Produces SharesShareAuthPost MimeJSON + diff --git a/lib/Vikunja/API/Subscriptions.hs b/lib/Vikunja/API/Subscriptions.hs new file mode 100644 index 0000000..920657d --- /dev/null +++ b/lib/Vikunja/API/Subscriptions.hs @@ -0,0 +1,158 @@ +{- + Vikunja API + + # Pagination Every endpoint capable of pagination will return two headers: * `x-pagination-total-pages`: The total number of available pages for this request * `x-pagination-result-count`: The number of items returned for this request. # Rights All endpoints which return a single item (project, task, etc.) - no array - will also return a `x-max-right` header with the max right the user has on this item as an int where `0` is `Read Only`, `1` is `Read & Write` and `2` is `Admin`. This can be used to show or hide ui elements based on the rights the user has. # Errors All errors have an error code and a human-readable error message in addition to the http status code. You should always check for the status code in the response, not only the http status code. Due to limitations in the swagger library we're using for this document, only one error per http status code is documented here. Make sure to check the [error docs](https://vikunja.io/docs/errors/) in Vikunja's documentation for a full list of available error codes. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **API Token:** You can create scoped API tokens for your user and use the token to make authenticated requests in the context of that user. The token must be provided via an `Authorization: Bearer ` header, similar to jwt auth. See the documentation for the `api` group to manage token creation and revocation. **BasicAuth:** Only used when requesting tasks via CalDAV. + + OpenAPI Version: 3.0.1 + Vikunja API API version: 0.24.6 + Contact: hello@vikunja.io + Generated by OpenAPI Generator (https://openapi-generator.tech) +-} + +{-| +Module : Vikunja.API.Subscriptions +-} + +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE MonoLocalBinds #-} +{-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE OverloadedStrings #-} +{-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-binds -fno-warn-unused-imports #-} + +module Vikunja.API.Subscriptions where + +import Vikunja.Core +import Vikunja.MimeTypes +import Vikunja.Model as M + +import qualified Data.Aeson as A +import qualified Data.ByteString as B +import qualified Data.ByteString.Lazy as BL +import qualified Data.Data as P (Typeable, TypeRep, typeOf, typeRep) +import qualified Data.Foldable as P +import qualified Data.Map as Map +import qualified Data.Maybe as P +import qualified Data.Proxy as P (Proxy(..)) +import qualified Data.Set as Set +import qualified Data.String as P +import qualified Data.Text as T +import qualified Data.Text.Encoding as T +import qualified Data.Text.Lazy as TL +import qualified Data.Text.Lazy.Encoding as TL +import qualified Data.Time as TI +import qualified Network.HTTP.Client.MultipartFormData as NH +import qualified Network.HTTP.Media as ME +import qualified Network.HTTP.Types as NH +import qualified Web.FormUrlEncoded as WH +import qualified Web.HttpApiData as WH + +import Data.Text (Text) +import GHC.Base ((<|>)) + +import Prelude ((==),(/=),($), (.),(<$>),(<*>),(>>=),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty,maybe,pure,Monad,Applicative,Functor) +import qualified Prelude as P + +-- * Operations + + +-- ** Subscriptions + +-- *** notificationsGet + +-- | @GET \/notifications@ +-- +-- Get all notifications for the current user +-- +-- Returns an array with all notifications for the current user. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +notificationsGet + :: VikunjaRequest NotificationsGet MimeNoContent [NotificationsDatabaseNotification] MimeJSON +notificationsGet = + _mkRequest "GET" ["/notifications"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data NotificationsGet + +-- | /Optional Param/ "page" - The page number. Used for pagination. If not provided, the first page of results is returned. +instance HasOptionalParam NotificationsGet Page where + applyOptionalParam req (Page xs) = + req `addQuery` toQuery ("page", Just xs) + +-- | /Optional Param/ "per_page" - The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page. +instance HasOptionalParam NotificationsGet PerPage where + applyOptionalParam req (PerPage xs) = + req `addQuery` toQuery ("per_page", Just xs) +-- | @application/json@ +instance Produces NotificationsGet MimeJSON + + +-- *** notificationsIdPost + +-- | @POST \/notifications\/{id}@ +-- +-- Mark a notification as (un-)read +-- +-- Marks a notification as either read or unread. A user can only mark their own notifications as read. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +notificationsIdPost + :: Id -- ^ "id" - Notification ID + -> VikunjaRequest NotificationsIdPost MimeNoContent ModelsDatabaseNotifications MimeJSON +notificationsIdPost (Id id) = + _mkRequest "POST" ["/notifications/",toPath id] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data NotificationsIdPost +-- | @application/json@ +instance Produces NotificationsIdPost MimeJSON + + +-- *** subscriptionsEntityEntityIDDelete + +-- | @DELETE \/subscriptions\/{entity}\/{entityID}@ +-- +-- Unsubscribe the current user from an entity. +-- +-- Unsubscribes the current user to an entity. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +subscriptionsEntityEntityIDDelete + :: Entity -- ^ "entity" - The entity the user subscribed to. Can be either `project` or `task`. + -> EntityId -- ^ "entityId" - The numeric id of the subscribed entity to. + -> VikunjaRequest SubscriptionsEntityEntityIDDelete MimeNoContent ModelsSubscription MimeJSON +subscriptionsEntityEntityIDDelete (Entity entity) (EntityId entityId) = + _mkRequest "DELETE" ["/subscriptions/",toPath entity,"/",toPath entityId] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data SubscriptionsEntityEntityIDDelete +-- | @application/json@ +instance Produces SubscriptionsEntityEntityIDDelete MimeJSON + + +-- *** subscriptionsEntityEntityIDPut + +-- | @PUT \/subscriptions\/{entity}\/{entityID}@ +-- +-- Subscribes the current user to an entity. +-- +-- Subscribes the current user to an entity. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +subscriptionsEntityEntityIDPut + :: Entity -- ^ "entity" - The entity the user subscribes to. Can be either `project` or `task`. + -> EntityId -- ^ "entityId" - The numeric id of the entity to subscribe to. + -> VikunjaRequest SubscriptionsEntityEntityIDPut MimeNoContent ModelsSubscription MimeJSON +subscriptionsEntityEntityIDPut (Entity entity) (EntityId entityId) = + _mkRequest "PUT" ["/subscriptions/",toPath entity,"/",toPath entityId] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data SubscriptionsEntityEntityIDPut +-- | @application/json@ +instance Produces SubscriptionsEntityEntityIDPut MimeJSON + diff --git a/lib/Vikunja/API/Task.hs b/lib/Vikunja/API/Task.hs new file mode 100644 index 0000000..840c5b1 --- /dev/null +++ b/lib/Vikunja/API/Task.hs @@ -0,0 +1,786 @@ +{- + Vikunja API + + # Pagination Every endpoint capable of pagination will return two headers: * `x-pagination-total-pages`: The total number of available pages for this request * `x-pagination-result-count`: The number of items returned for this request. # Rights All endpoints which return a single item (project, task, etc.) - no array - will also return a `x-max-right` header with the max right the user has on this item as an int where `0` is `Read Only`, `1` is `Read & Write` and `2` is `Admin`. This can be used to show or hide ui elements based on the rights the user has. # Errors All errors have an error code and a human-readable error message in addition to the http status code. You should always check for the status code in the response, not only the http status code. Due to limitations in the swagger library we're using for this document, only one error per http status code is documented here. Make sure to check the [error docs](https://vikunja.io/docs/errors/) in Vikunja's documentation for a full list of available error codes. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **API Token:** You can create scoped API tokens for your user and use the token to make authenticated requests in the context of that user. The token must be provided via an `Authorization: Bearer ` header, similar to jwt auth. See the documentation for the `api` group to manage token creation and revocation. **BasicAuth:** Only used when requesting tasks via CalDAV. + + OpenAPI Version: 3.0.1 + Vikunja API API version: 0.24.6 + Contact: hello@vikunja.io + Generated by OpenAPI Generator (https://openapi-generator.tech) +-} + +{-| +Module : Vikunja.API.Task +-} + +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE MonoLocalBinds #-} +{-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE OverloadedStrings #-} +{-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-binds -fno-warn-unused-imports #-} + +module Vikunja.API.Task where + +import Vikunja.Core +import Vikunja.MimeTypes +import Vikunja.Model as M + +import qualified Data.Aeson as A +import qualified Data.ByteString as B +import qualified Data.ByteString.Lazy as BL +import qualified Data.Data as P (Typeable, TypeRep, typeOf, typeRep) +import qualified Data.Foldable as P +import qualified Data.Map as Map +import qualified Data.Maybe as P +import qualified Data.Proxy as P (Proxy(..)) +import qualified Data.Set as Set +import qualified Data.String as P +import qualified Data.Text as T +import qualified Data.Text.Encoding as T +import qualified Data.Text.Lazy as TL +import qualified Data.Text.Lazy.Encoding as TL +import qualified Data.Time as TI +import qualified Network.HTTP.Client.MultipartFormData as NH +import qualified Network.HTTP.Media as ME +import qualified Network.HTTP.Types as NH +import qualified Web.FormUrlEncoded as WH +import qualified Web.HttpApiData as WH + +import Data.Text (Text) +import GHC.Base ((<|>)) + +import Prelude ((==),(/=),($), (.),(<$>),(<*>),(>>=),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty,maybe,pure,Monad,Applicative,Functor) +import qualified Prelude as P + +-- * Operations + + +-- ** Task + +-- *** kindIdReactionsDeletePost + +-- | @POST \/{kind}\/{id}\/reactions\/delete@ +-- +-- Removes the user's reaction +-- +-- Removes the reaction of that user on that entity. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +kindIdReactionsDeletePost + :: (Consumes KindIdReactionsDeletePost MimeJSON, MimeRender MimeJSON ModelsReaction) + => ModelsReaction -- ^ "project" - The reaction you want to add to the entity. + -> Id -- ^ "id" - Entity ID + -> Kind -- ^ "kind" - The kind of the entity. Can be either `tasks` or `comments` for task comments + -> VikunjaRequest KindIdReactionsDeletePost MimeJSON ModelsMessage MimeJSON +kindIdReactionsDeletePost project (Id id) (Kind kind) = + _mkRequest "POST" ["/",toPath kind,"/",toPath id,"/reactions/delete"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + `setBodyParam` project + +data KindIdReactionsDeletePost + +-- | /Body Param/ "project" - The reaction you want to add to the entity. +instance HasBodyParam KindIdReactionsDeletePost ModelsReaction + +-- | @application/json@ +instance Consumes KindIdReactionsDeletePost MimeJSON + +-- | @application/json@ +instance Produces KindIdReactionsDeletePost MimeJSON + + +-- *** kindIdReactionsGet + +-- | @GET \/{kind}\/{id}\/reactions@ +-- +-- Get all reactions for an entity +-- +-- Returns all reactions for an entity +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +kindIdReactionsGet + :: Id -- ^ "id" - Entity ID + -> Kind -- ^ "kind" - The kind of the entity. Can be either `tasks` or `comments` for task comments + -> VikunjaRequest KindIdReactionsGet MimeNoContent [Map] MimeJSON +kindIdReactionsGet (Id id) (Kind kind) = + _mkRequest "GET" ["/",toPath kind,"/",toPath id,"/reactions"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data KindIdReactionsGet +-- | @application/json@ +instance Produces KindIdReactionsGet MimeJSON + + +-- *** kindIdReactionsPut + +-- | @PUT \/{kind}\/{id}\/reactions@ +-- +-- Add a reaction to an entity +-- +-- Add a reaction to an entity. Will do nothing if the reaction already exists. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +kindIdReactionsPut + :: (Consumes KindIdReactionsPut MimeJSON, MimeRender MimeJSON ModelsReaction) + => ModelsReaction -- ^ "project" - The reaction you want to add to the entity. + -> Id -- ^ "id" - Entity ID + -> Kind -- ^ "kind" - The kind of the entity. Can be either `tasks` or `comments` for task comments + -> VikunjaRequest KindIdReactionsPut MimeJSON ModelsReaction MimeJSON +kindIdReactionsPut project (Id id) (Kind kind) = + _mkRequest "PUT" ["/",toPath kind,"/",toPath id,"/reactions"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + `setBodyParam` project + +data KindIdReactionsPut + +-- | /Body Param/ "project" - The reaction you want to add to the entity. +instance HasBodyParam KindIdReactionsPut ModelsReaction + +-- | @application/json@ +instance Consumes KindIdReactionsPut MimeJSON + +-- | @application/json@ +instance Produces KindIdReactionsPut MimeJSON + + +-- *** projectsIdTasksPut + +-- | @PUT \/projects\/{id}\/tasks@ +-- +-- Create a task +-- +-- Inserts a task into a project. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +projectsIdTasksPut + :: (Consumes ProjectsIdTasksPut MimeJSON, MimeRender MimeJSON ModelsTask) + => ModelsTask -- ^ "task" - The task object + -> Id -- ^ "id" - Project ID + -> VikunjaRequest ProjectsIdTasksPut MimeJSON ModelsTask MimeJSON +projectsIdTasksPut task (Id id) = + _mkRequest "PUT" ["/projects/",toPath id,"/tasks"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + `setBodyParam` task + +data ProjectsIdTasksPut + +-- | /Body Param/ "task" - The task object +instance HasBodyParam ProjectsIdTasksPut ModelsTask + +-- | @application/json@ +instance Consumes ProjectsIdTasksPut MimeJSON + +-- | @application/json@ +instance Produces ProjectsIdTasksPut MimeJSON + + +-- *** projectsIdViewsViewTasksGet + +-- | @GET \/projects\/{id}\/views\/{view}\/tasks@ +-- +-- Get tasks in a project +-- +-- Returns all tasks for the current project. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +projectsIdViewsViewTasksGet + :: Id -- ^ "id" - The project ID. + -> View -- ^ "view" - The project view ID. + -> VikunjaRequest ProjectsIdViewsViewTasksGet MimeNoContent [ModelsTask] MimeJSON +projectsIdViewsViewTasksGet (Id id) (View view) = + _mkRequest "GET" ["/projects/",toPath id,"/views/",toPath view,"/tasks"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data ProjectsIdViewsViewTasksGet + +-- | /Optional Param/ "page" - The page number. Used for pagination. If not provided, the first page of results is returned. +instance HasOptionalParam ProjectsIdViewsViewTasksGet Page where + applyOptionalParam req (Page xs) = + req `addQuery` toQuery ("page", Just xs) + +-- | /Optional Param/ "per_page" - The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page. +instance HasOptionalParam ProjectsIdViewsViewTasksGet PerPage where + applyOptionalParam req (PerPage xs) = + req `addQuery` toQuery ("per_page", Just xs) + +-- | /Optional Param/ "s" - Search tasks by task text. +instance HasOptionalParam ProjectsIdViewsViewTasksGet S where + applyOptionalParam req (S xs) = + req `addQuery` toQuery ("s", Just xs) + +-- | /Optional Param/ "sort_by" - The sorting parameter. You can pass this multiple times to get the tasks ordered by multiple different parametes, along with `order_by`. Possible values to sort by are `id`, `title`, `description`, `done`, `done_at`, `due_date`, `created_by_id`, `project_id`, `repeat_after`, `priority`, `start_date`, `end_date`, `hex_color`, `percent_done`, `uid`, `created`, `updated`. Default is `id`. +instance HasOptionalParam ProjectsIdViewsViewTasksGet SortBy where + applyOptionalParam req (SortBy xs) = + req `addQuery` toQuery ("sort_by", Just xs) + +-- | /Optional Param/ "order_by" - The ordering parameter. Possible values to order by are `asc` or `desc`. Default is `asc`. +instance HasOptionalParam ProjectsIdViewsViewTasksGet OrderBy where + applyOptionalParam req (OrderBy xs) = + req `addQuery` toQuery ("order_by", Just xs) + +-- | /Optional Param/ "filter" - The filter query to match tasks by. Check out https://vikunja.io/docs/filters for a full explanation of the feature. +instance HasOptionalParam ProjectsIdViewsViewTasksGet Filter where + applyOptionalParam req (Filter xs) = + req `addQuery` toQuery ("filter", Just xs) + +-- | /Optional Param/ "filter_timezone" - The time zone which should be used for date match (statements like +instance HasOptionalParam ProjectsIdViewsViewTasksGet FilterTimezone where + applyOptionalParam req (FilterTimezone xs) = + req `addQuery` toQuery ("filter_timezone", Just xs) + +-- | /Optional Param/ "filter_include_nulls" - If set to true the result will include filtered fields whose value is set to `null`. Available values are `true` or `false`. Defaults to `false`. +instance HasOptionalParam ProjectsIdViewsViewTasksGet FilterIncludeNulls where + applyOptionalParam req (FilterIncludeNulls xs) = + req `addQuery` toQuery ("filter_include_nulls", Just xs) + +-- | /Optional Param/ "expand" - If set to `subtasks`, Vikunja will fetch only tasks which do not have subtasks and then in a second step, will fetch all of these subtasks. This may result in more tasks than the pagination limit being returned, but all subtasks will be present in the response. You can only set this to `subtasks`. +instance HasOptionalParam ProjectsIdViewsViewTasksGet Expand where + applyOptionalParam req (Expand xs) = + req `addQuery` toQuery ("expand", Just xs) +-- | @application/json@ +instance Produces ProjectsIdViewsViewTasksGet MimeJSON + + +-- *** projectsProjectViewsViewBucketsBucketTasksPost + +-- | @POST \/projects\/{project}\/views\/{view}\/buckets\/{bucket}\/tasks@ +-- +-- Update a task bucket +-- +-- Updates a task in a bucket +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +projectsProjectViewsViewBucketsBucketTasksPost + :: (Consumes ProjectsProjectViewsViewBucketsBucketTasksPost MimeJSON, MimeRender MimeJSON ModelsTaskBucket) + => ModelsTaskBucket -- ^ "taskBucket" - The id of the task you want to move into the bucket. + -> Project -- ^ "project" - Project ID + -> View -- ^ "view" - Project View ID + -> Bucket -- ^ "bucket" - Bucket ID + -> VikunjaRequest ProjectsProjectViewsViewBucketsBucketTasksPost MimeJSON ModelsTaskBucket MimeJSON +projectsProjectViewsViewBucketsBucketTasksPost taskBucket (Project project) (View view) (Bucket bucket) = + _mkRequest "POST" ["/projects/",toPath project,"/views/",toPath view,"/buckets/",toPath bucket,"/tasks"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + `setBodyParam` taskBucket + +data ProjectsProjectViewsViewBucketsBucketTasksPost + +-- | /Body Param/ "taskBucket" - The id of the task you want to move into the bucket. +instance HasBodyParam ProjectsProjectViewsViewBucketsBucketTasksPost ModelsTaskBucket + +-- | @application/json@ +instance Consumes ProjectsProjectViewsViewBucketsBucketTasksPost MimeJSON + +-- | @application/json@ +instance Produces ProjectsProjectViewsViewBucketsBucketTasksPost MimeJSON + + +-- *** tasksAllGet + +-- | @GET \/tasks\/all@ +-- +-- Get tasks +-- +-- Returns all tasks on any project the user has access to. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +tasksAllGet + :: VikunjaRequest TasksAllGet MimeNoContent [ModelsTask] MimeJSON +tasksAllGet = + _mkRequest "GET" ["/tasks/all"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data TasksAllGet + +-- | /Optional Param/ "page" - The page number. Used for pagination. If not provided, the first page of results is returned. +instance HasOptionalParam TasksAllGet Page where + applyOptionalParam req (Page xs) = + req `addQuery` toQuery ("page", Just xs) + +-- | /Optional Param/ "per_page" - The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page. +instance HasOptionalParam TasksAllGet PerPage where + applyOptionalParam req (PerPage xs) = + req `addQuery` toQuery ("per_page", Just xs) + +-- | /Optional Param/ "s" - Search tasks by task text. +instance HasOptionalParam TasksAllGet S where + applyOptionalParam req (S xs) = + req `addQuery` toQuery ("s", Just xs) + +-- | /Optional Param/ "sort_by" - The sorting parameter. You can pass this multiple times to get the tasks ordered by multiple different parametes, along with `order_by`. Possible values to sort by are `id`, `title`, `description`, `done`, `done_at`, `due_date`, `created_by_id`, `project_id`, `repeat_after`, `priority`, `start_date`, `end_date`, `hex_color`, `percent_done`, `uid`, `created`, `updated`. Default is `id`. +instance HasOptionalParam TasksAllGet SortBy where + applyOptionalParam req (SortBy xs) = + req `addQuery` toQuery ("sort_by", Just xs) + +-- | /Optional Param/ "order_by" - The ordering parameter. Possible values to order by are `asc` or `desc`. Default is `asc`. +instance HasOptionalParam TasksAllGet OrderBy where + applyOptionalParam req (OrderBy xs) = + req `addQuery` toQuery ("order_by", Just xs) + +-- | /Optional Param/ "filter" - The filter query to match tasks by. Check out https://vikunja.io/docs/filters for a full explanation of the feature. +instance HasOptionalParam TasksAllGet Filter where + applyOptionalParam req (Filter xs) = + req `addQuery` toQuery ("filter", Just xs) + +-- | /Optional Param/ "filter_timezone" - The time zone which should be used for date match (statements like +instance HasOptionalParam TasksAllGet FilterTimezone where + applyOptionalParam req (FilterTimezone xs) = + req `addQuery` toQuery ("filter_timezone", Just xs) + +-- | /Optional Param/ "filter_include_nulls" - If set to true the result will include filtered fields whose value is set to `null`. Available values are `true` or `false`. Defaults to `false`. +instance HasOptionalParam TasksAllGet FilterIncludeNulls where + applyOptionalParam req (FilterIncludeNulls xs) = + req `addQuery` toQuery ("filter_include_nulls", Just xs) + +-- | /Optional Param/ "expand" - If set to `subtasks`, Vikunja will fetch only tasks which do not have subtasks and then in a second step, will fetch all of these subtasks. This may result in more tasks than the pagination limit being returned, but all subtasks will be present in the response. You can only set this to `subtasks`. +instance HasOptionalParam TasksAllGet Expand where + applyOptionalParam req (Expand xs) = + req `addQuery` toQuery ("expand", Just xs) +-- | @application/json@ +instance Produces TasksAllGet MimeJSON + + +-- *** tasksBulkPost + +-- | @POST \/tasks\/bulk@ +-- +-- 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. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +tasksBulkPost + :: (Consumes TasksBulkPost MimeJSON, MimeRender MimeJSON ModelsBulkTask) + => ModelsBulkTask -- ^ "task" - The task object. Looks like a normal task, the only difference is it uses an array of project_ids to update. + -> VikunjaRequest TasksBulkPost MimeJSON ModelsTask MimeJSON +tasksBulkPost task = + _mkRequest "POST" ["/tasks/bulk"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + `setBodyParam` task + +data TasksBulkPost + +-- | /Body Param/ "task" - The task object. Looks like a normal task, the only difference is it uses an array of project_ids to update. +instance HasBodyParam TasksBulkPost ModelsBulkTask + +-- | @application/json@ +instance Consumes TasksBulkPost MimeJSON + +-- | @application/json@ +instance Produces TasksBulkPost MimeJSON + + +-- *** tasksIdAttachmentsAttachmentIDDelete + +-- | @DELETE \/tasks\/{id}\/attachments\/{attachmentID}@ +-- +-- Delete an attachment +-- +-- Delete an attachment. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +tasksIdAttachmentsAttachmentIDDelete + :: Id -- ^ "id" - Task ID + -> AttachmentId -- ^ "attachmentId" - Attachment ID + -> VikunjaRequest TasksIdAttachmentsAttachmentIDDelete MimeNoContent ModelsMessage MimeJSON +tasksIdAttachmentsAttachmentIDDelete (Id id) (AttachmentId attachmentId) = + _mkRequest "DELETE" ["/tasks/",toPath id,"/attachments/",toPath attachmentId] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data TasksIdAttachmentsAttachmentIDDelete +-- | @application/json@ +instance Produces TasksIdAttachmentsAttachmentIDDelete MimeJSON + + +-- *** tasksIdAttachmentsAttachmentIDGet + +-- | @GET \/tasks\/{id}\/attachments\/{attachmentID}@ +-- +-- Get one attachment. +-- +-- Get one attachment for download. **Returns json on error.** +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +tasksIdAttachmentsAttachmentIDGet + :: Id -- ^ "id" - Task ID + -> AttachmentId -- ^ "attachmentId" - Attachment ID + -> VikunjaRequest TasksIdAttachmentsAttachmentIDGet MimeNoContent FilePath MimeOctetStream +tasksIdAttachmentsAttachmentIDGet (Id id) (AttachmentId attachmentId) = + _mkRequest "GET" ["/tasks/",toPath id,"/attachments/",toPath attachmentId] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data TasksIdAttachmentsAttachmentIDGet + +-- | /Optional Param/ "preview_size" - The size of the preview image. Can be sm = 100px, md = 200px, lg = 400px or xl = 800px. If provided, a preview image will be returned if the attachment is an image. +instance HasOptionalParam TasksIdAttachmentsAttachmentIDGet PreviewSize where + applyOptionalParam req (PreviewSize xs) = + req `addQuery` toQuery ("preview_size", Just xs) +-- | @application/octet-stream@ +instance Produces TasksIdAttachmentsAttachmentIDGet MimeOctetStream + + +-- *** tasksIdAttachmentsGet + +-- | @GET \/tasks\/{id}\/attachments@ +-- +-- Get all attachments for one task. +-- +-- Get all task attachments for one task. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +tasksIdAttachmentsGet + :: Id -- ^ "id" - Task ID + -> VikunjaRequest TasksIdAttachmentsGet MimeNoContent [ModelsTaskAttachment] MimeJSON +tasksIdAttachmentsGet (Id id) = + _mkRequest "GET" ["/tasks/",toPath id,"/attachments"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data TasksIdAttachmentsGet + +-- | /Optional Param/ "page" - The page number. Used for pagination. If not provided, the first page of results is returned. +instance HasOptionalParam TasksIdAttachmentsGet Page where + applyOptionalParam req (Page xs) = + req `addQuery` toQuery ("page", Just xs) + +-- | /Optional Param/ "per_page" - The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page. +instance HasOptionalParam TasksIdAttachmentsGet PerPage where + applyOptionalParam req (PerPage xs) = + req `addQuery` toQuery ("per_page", Just xs) +-- | @application/json@ +instance Produces TasksIdAttachmentsGet MimeJSON + + +-- *** tasksIdAttachmentsPut + +-- | @PUT \/tasks\/{id}\/attachments@ +-- +-- Upload a task attachment +-- +-- Upload a task attachment. You can pass multiple files with the files form param. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +tasksIdAttachmentsPut + :: (Consumes TasksIdAttachmentsPut MimeMultipartFormData) + => Files -- ^ "files" - The file, as multipart form file. You can pass multiple. + -> Id -- ^ "id" - Task ID + -> VikunjaRequest TasksIdAttachmentsPut MimeMultipartFormData ModelsMessage MimeJSON +tasksIdAttachmentsPut (Files files) (Id id) = + _mkRequest "PUT" ["/tasks/",toPath id,"/attachments"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + `_addMultiFormPart` NH.partLBS "files" (mimeRender' MimeMultipartFormData files) + +data TasksIdAttachmentsPut + +-- | @multipart/form-data@ +instance Consumes TasksIdAttachmentsPut MimeMultipartFormData + +-- | @application/json@ +instance Produces TasksIdAttachmentsPut MimeJSON + + +-- *** tasksIdDelete + +-- | @DELETE \/tasks\/{id}@ +-- +-- Delete a task +-- +-- Deletes a task from a project. This does not mean \"mark it done\". +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +tasksIdDelete + :: Id -- ^ "id" - Task ID + -> VikunjaRequest TasksIdDelete MimeNoContent ModelsMessage MimeJSON +tasksIdDelete (Id id) = + _mkRequest "DELETE" ["/tasks/",toPath id] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data TasksIdDelete +-- | @application/json@ +instance Produces TasksIdDelete MimeJSON + + +-- *** tasksIdGet + +-- | @GET \/tasks\/{id}@ +-- +-- Get one task +-- +-- Returns one task by its ID +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +tasksIdGet + :: Id -- ^ "id" - The task ID + -> VikunjaRequest TasksIdGet MimeNoContent ModelsTask MimeJSON +tasksIdGet (Id id) = + _mkRequest "GET" ["/tasks/",toPath id] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data TasksIdGet +-- | @application/json@ +instance Produces TasksIdGet MimeJSON + + +-- *** tasksIdPositionPost + +-- | @POST \/tasks\/{id}\/position@ +-- +-- Updates a task position +-- +-- Updates a task position. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +tasksIdPositionPost + :: (Consumes TasksIdPositionPost MimeJSON, MimeRender MimeJSON ModelsTaskPosition) + => ModelsTaskPosition -- ^ "view" - The task position with updated values you want to change. + -> Id -- ^ "id" - Task ID + -> VikunjaRequest TasksIdPositionPost MimeJSON ModelsTaskPosition MimeJSON +tasksIdPositionPost view (Id id) = + _mkRequest "POST" ["/tasks/",toPath id,"/position"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + `setBodyParam` view + +data TasksIdPositionPost + +-- | /Body Param/ "view" - The task position with updated values you want to change. +instance HasBodyParam TasksIdPositionPost ModelsTaskPosition + +-- | @application/json@ +instance Consumes TasksIdPositionPost MimeJSON + +-- | @application/json@ +instance Produces TasksIdPositionPost MimeJSON + + +-- *** tasksIdPost + +-- | @POST \/tasks\/{id}@ +-- +-- 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. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +tasksIdPost + :: (Consumes TasksIdPost MimeJSON, MimeRender MimeJSON ModelsTask) + => ModelsTask -- ^ "task" - The task object + -> Id -- ^ "id" - The Task ID + -> VikunjaRequest TasksIdPost MimeJSON ModelsTask MimeJSON +tasksIdPost task (Id id) = + _mkRequest "POST" ["/tasks/",toPath id] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + `setBodyParam` task + +data TasksIdPost + +-- | /Body Param/ "task" - The task object +instance HasBodyParam TasksIdPost ModelsTask + +-- | @application/json@ +instance Consumes TasksIdPost MimeJSON + +-- | @application/json@ +instance Produces TasksIdPost MimeJSON + + +-- *** tasksTaskIDCommentsCommentIDDelete + +-- | @DELETE \/tasks\/{taskID}\/comments\/{commentID}@ +-- +-- Remove a task comment +-- +-- Remove a task comment. The user doing this need to have at least write access to the task this comment belongs to. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +tasksTaskIDCommentsCommentIDDelete + :: TaskId -- ^ "taskId" - Task ID + -> CommentId -- ^ "commentId" - Comment ID + -> VikunjaRequest TasksTaskIDCommentsCommentIDDelete MimeNoContent ModelsMessage MimeJSON +tasksTaskIDCommentsCommentIDDelete (TaskId taskId) (CommentId commentId) = + _mkRequest "DELETE" ["/tasks/",toPath taskId,"/comments/",toPath commentId] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data TasksTaskIDCommentsCommentIDDelete +-- | @application/json@ +instance Produces TasksTaskIDCommentsCommentIDDelete MimeJSON + + +-- *** tasksTaskIDCommentsCommentIDGet + +-- | @GET \/tasks\/{taskID}\/comments\/{commentID}@ +-- +-- Remove a task comment +-- +-- Remove a task comment. The user doing this need to have at least read access to the task this comment belongs to. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +tasksTaskIDCommentsCommentIDGet + :: TaskId -- ^ "taskId" - Task ID + -> CommentId -- ^ "commentId" - Comment ID + -> VikunjaRequest TasksTaskIDCommentsCommentIDGet MimeNoContent ModelsTaskComment MimeJSON +tasksTaskIDCommentsCommentIDGet (TaskId taskId) (CommentId commentId) = + _mkRequest "GET" ["/tasks/",toPath taskId,"/comments/",toPath commentId] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data TasksTaskIDCommentsCommentIDGet +-- | @application/json@ +instance Produces TasksTaskIDCommentsCommentIDGet MimeJSON + + +-- *** tasksTaskIDCommentsCommentIDPost + +-- | @POST \/tasks\/{taskID}\/comments\/{commentID}@ +-- +-- Update an existing task comment +-- +-- Update an existing task comment. The user doing this need to have at least write access to the task this comment belongs to. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +tasksTaskIDCommentsCommentIDPost + :: TaskId -- ^ "taskId" - Task ID + -> CommentId -- ^ "commentId" - Comment ID + -> VikunjaRequest TasksTaskIDCommentsCommentIDPost MimeNoContent ModelsTaskComment MimeJSON +tasksTaskIDCommentsCommentIDPost (TaskId taskId) (CommentId commentId) = + _mkRequest "POST" ["/tasks/",toPath taskId,"/comments/",toPath commentId] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data TasksTaskIDCommentsCommentIDPost +-- | @application/json@ +instance Produces TasksTaskIDCommentsCommentIDPost MimeJSON + + +-- *** tasksTaskIDCommentsGet + +-- | @GET \/tasks\/{taskID}\/comments@ +-- +-- Get all task comments +-- +-- Get all task comments. The user doing this need to have at least read access to the task. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +tasksTaskIDCommentsGet + :: TaskId -- ^ "taskId" - Task ID + -> VikunjaRequest TasksTaskIDCommentsGet MimeNoContent [ModelsTaskComment] MimeJSON +tasksTaskIDCommentsGet (TaskId taskId) = + _mkRequest "GET" ["/tasks/",toPath taskId,"/comments"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data TasksTaskIDCommentsGet +-- | @application/json@ +instance Produces TasksTaskIDCommentsGet MimeJSON + + +-- *** tasksTaskIDCommentsPut + +-- | @PUT \/tasks\/{taskID}\/comments@ +-- +-- Create a new task comment +-- +-- Create a new task comment. The user doing this need to have at least write access to the task this comment should belong to. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +tasksTaskIDCommentsPut + :: (Consumes TasksTaskIDCommentsPut MimeJSON, MimeRender MimeJSON ModelsTaskComment) + => ModelsTaskComment -- ^ "relation" - The task comment object + -> TaskId -- ^ "taskId" - Task ID + -> VikunjaRequest TasksTaskIDCommentsPut MimeJSON ModelsTaskComment MimeJSON +tasksTaskIDCommentsPut relation (TaskId taskId) = + _mkRequest "PUT" ["/tasks/",toPath taskId,"/comments"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + `setBodyParam` relation + +data TasksTaskIDCommentsPut + +-- | /Body Param/ "relation" - The task comment object +instance HasBodyParam TasksTaskIDCommentsPut ModelsTaskComment + +-- | @application/json@ +instance Consumes TasksTaskIDCommentsPut MimeJSON + +-- | @application/json@ +instance Produces TasksTaskIDCommentsPut MimeJSON + + +-- *** tasksTaskIDRelationsPut + +-- | @PUT \/tasks\/{taskID}\/relations@ +-- +-- 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 project. Take a look at the docs for available task relation kinds. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +tasksTaskIDRelationsPut + :: (Consumes TasksTaskIDRelationsPut MimeJSON, MimeRender MimeJSON ModelsTaskRelation) + => ModelsTaskRelation -- ^ "relation" - The relation object + -> TaskId -- ^ "taskId" - Task ID + -> VikunjaRequest TasksTaskIDRelationsPut MimeJSON ModelsTaskRelation MimeJSON +tasksTaskIDRelationsPut relation (TaskId taskId) = + _mkRequest "PUT" ["/tasks/",toPath taskId,"/relations"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + `setBodyParam` relation + +data TasksTaskIDRelationsPut + +-- | /Body Param/ "relation" - The relation object +instance HasBodyParam TasksTaskIDRelationsPut ModelsTaskRelation + +-- | @application/json@ +instance Consumes TasksTaskIDRelationsPut MimeJSON + +-- | @application/json@ +instance Produces TasksTaskIDRelationsPut MimeJSON + + +-- *** tasksTaskIDRelationsRelationKindOtherTaskIDDelete + +-- | @DELETE \/tasks\/{taskID}\/relations\/{relationKind}\/{otherTaskID}@ +-- +-- Remove a task relation +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +tasksTaskIDRelationsRelationKindOtherTaskIDDelete + :: (Consumes TasksTaskIDRelationsRelationKindOtherTaskIDDelete MimeJSON, MimeRender MimeJSON ModelsTaskRelation) + => ModelsTaskRelation -- ^ "relation" - The relation object + -> TaskId -- ^ "taskId" - Task ID + -> RelationKind -- ^ "relationKind" - The kind of the relation. See the TaskRelation type for more info. + -> OtherTaskId -- ^ "otherTaskId" - The id of the other task. + -> VikunjaRequest TasksTaskIDRelationsRelationKindOtherTaskIDDelete MimeJSON ModelsMessage MimeJSON +tasksTaskIDRelationsRelationKindOtherTaskIDDelete relation (TaskId taskId) (RelationKind relationKind) (OtherTaskId otherTaskId) = + _mkRequest "DELETE" ["/tasks/",toPath taskId,"/relations/",toPath relationKind,"/",toPath otherTaskId] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + `setBodyParam` relation + +data TasksTaskIDRelationsRelationKindOtherTaskIDDelete + +-- | /Body Param/ "relation" - The relation object +instance HasBodyParam TasksTaskIDRelationsRelationKindOtherTaskIDDelete ModelsTaskRelation + +-- | @application/json@ +instance Consumes TasksTaskIDRelationsRelationKindOtherTaskIDDelete MimeJSON + +-- | @application/json@ +instance Produces TasksTaskIDRelationsRelationKindOtherTaskIDDelete MimeJSON + diff --git a/lib/Vikunja/API/Team.hs b/lib/Vikunja/API/Team.hs new file mode 100644 index 0000000..51da4b9 --- /dev/null +++ b/lib/Vikunja/API/Team.hs @@ -0,0 +1,280 @@ +{- + Vikunja API + + # Pagination Every endpoint capable of pagination will return two headers: * `x-pagination-total-pages`: The total number of available pages for this request * `x-pagination-result-count`: The number of items returned for this request. # Rights All endpoints which return a single item (project, task, etc.) - no array - will also return a `x-max-right` header with the max right the user has on this item as an int where `0` is `Read Only`, `1` is `Read & Write` and `2` is `Admin`. This can be used to show or hide ui elements based on the rights the user has. # Errors All errors have an error code and a human-readable error message in addition to the http status code. You should always check for the status code in the response, not only the http status code. Due to limitations in the swagger library we're using for this document, only one error per http status code is documented here. Make sure to check the [error docs](https://vikunja.io/docs/errors/) in Vikunja's documentation for a full list of available error codes. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **API Token:** You can create scoped API tokens for your user and use the token to make authenticated requests in the context of that user. The token must be provided via an `Authorization: Bearer ` header, similar to jwt auth. See the documentation for the `api` group to manage token creation and revocation. **BasicAuth:** Only used when requesting tasks via CalDAV. + + OpenAPI Version: 3.0.1 + Vikunja API API version: 0.24.6 + Contact: hello@vikunja.io + Generated by OpenAPI Generator (https://openapi-generator.tech) +-} + +{-| +Module : Vikunja.API.Team +-} + +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE MonoLocalBinds #-} +{-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE OverloadedStrings #-} +{-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-binds -fno-warn-unused-imports #-} + +module Vikunja.API.Team where + +import Vikunja.Core +import Vikunja.MimeTypes +import Vikunja.Model as M + +import qualified Data.Aeson as A +import qualified Data.ByteString as B +import qualified Data.ByteString.Lazy as BL +import qualified Data.Data as P (Typeable, TypeRep, typeOf, typeRep) +import qualified Data.Foldable as P +import qualified Data.Map as Map +import qualified Data.Maybe as P +import qualified Data.Proxy as P (Proxy(..)) +import qualified Data.Set as Set +import qualified Data.String as P +import qualified Data.Text as T +import qualified Data.Text.Encoding as T +import qualified Data.Text.Lazy as TL +import qualified Data.Text.Lazy.Encoding as TL +import qualified Data.Time as TI +import qualified Network.HTTP.Client.MultipartFormData as NH +import qualified Network.HTTP.Media as ME +import qualified Network.HTTP.Types as NH +import qualified Web.FormUrlEncoded as WH +import qualified Web.HttpApiData as WH + +import Data.Text (Text) +import GHC.Base ((<|>)) + +import Prelude ((==),(/=),($), (.),(<$>),(<*>),(>>=),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty,maybe,pure,Monad,Applicative,Functor) +import qualified Prelude as P + +-- * Operations + + +-- ** Team + +-- *** teamsGet + +-- | @GET \/teams@ +-- +-- Get teams +-- +-- Returns all teams the current user is part of. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +teamsGet + :: VikunjaRequest TeamsGet MimeNoContent [ModelsTeam] MimeJSON +teamsGet = + _mkRequest "GET" ["/teams"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data TeamsGet + +-- | /Optional Param/ "page" - The page number. Used for pagination. If not provided, the first page of results is returned. +instance HasOptionalParam TeamsGet Page where + applyOptionalParam req (Page xs) = + req `addQuery` toQuery ("page", Just xs) + +-- | /Optional Param/ "per_page" - The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page. +instance HasOptionalParam TeamsGet PerPage where + applyOptionalParam req (PerPage xs) = + req `addQuery` toQuery ("per_page", Just xs) + +-- | /Optional Param/ "s" - Search teams by its name. +instance HasOptionalParam TeamsGet S where + applyOptionalParam req (S xs) = + req `addQuery` toQuery ("s", Just xs) +-- | @application/json@ +instance Produces TeamsGet MimeJSON + + +-- *** teamsIdDelete + +-- | @DELETE \/teams\/{id}@ +-- +-- Deletes a team +-- +-- Delets a team. This will also remove the access for all users in that team. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +teamsIdDelete + :: Id -- ^ "id" - Team ID + -> VikunjaRequest TeamsIdDelete MimeNoContent ModelsMessage MimeJSON +teamsIdDelete (Id id) = + _mkRequest "DELETE" ["/teams/",toPath id] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data TeamsIdDelete +-- | @application/json@ +instance Produces TeamsIdDelete MimeJSON + + +-- *** teamsIdGet + +-- | @GET \/teams\/{id}@ +-- +-- Gets one team +-- +-- Returns a team by its ID. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +teamsIdGet + :: Id -- ^ "id" - Team ID + -> VikunjaRequest TeamsIdGet MimeNoContent ModelsTeam MimeJSON +teamsIdGet (Id id) = + _mkRequest "GET" ["/teams/",toPath id] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data TeamsIdGet +-- | @application/json@ +instance Produces TeamsIdGet MimeJSON + + +-- *** teamsIdMembersPut + +-- | @PUT \/teams\/{id}\/members@ +-- +-- Add a user to a team +-- +-- Add a user to a team. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +teamsIdMembersPut + :: (Consumes TeamsIdMembersPut MimeJSON, MimeRender MimeJSON ModelsTeamMember) + => ModelsTeamMember -- ^ "team" - The user to be added to a team. + -> Id -- ^ "id" - Team ID + -> VikunjaRequest TeamsIdMembersPut MimeJSON ModelsTeamMember MimeJSON +teamsIdMembersPut team (Id id) = + _mkRequest "PUT" ["/teams/",toPath id,"/members"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + `setBodyParam` team + +data TeamsIdMembersPut + +-- | /Body Param/ "team" - The user to be added to a team. +instance HasBodyParam TeamsIdMembersPut ModelsTeamMember + +-- | @application/json@ +instance Consumes TeamsIdMembersPut MimeJSON + +-- | @application/json@ +instance Produces TeamsIdMembersPut MimeJSON + + +-- *** teamsIdMembersUserIDAdminPost + +-- | @POST \/teams\/{id}\/members\/{userID}\/admin@ +-- +-- Toggle a team member's admin status +-- +-- If a user is team admin, this will make them member and vise-versa. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +teamsIdMembersUserIDAdminPost + :: Id -- ^ "id" - Team ID + -> UserId -- ^ "userId" - User ID + -> VikunjaRequest TeamsIdMembersUserIDAdminPost MimeNoContent ModelsMessage MimeJSON +teamsIdMembersUserIDAdminPost (Id id) (UserId userId) = + _mkRequest "POST" ["/teams/",toPath id,"/members/",toPath userId,"/admin"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data TeamsIdMembersUserIDAdminPost +-- | @application/json@ +instance Produces TeamsIdMembersUserIDAdminPost MimeJSON + + +-- *** teamsIdMembersUserIDDelete + +-- | @DELETE \/teams\/{id}\/members\/{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. A user can remove themselves from the team if they are not the last user in the team. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +teamsIdMembersUserIDDelete + :: Id -- ^ "id" - Team ID + -> UserId -- ^ "userId" - User ID + -> VikunjaRequest TeamsIdMembersUserIDDelete MimeNoContent ModelsMessage MimeJSON +teamsIdMembersUserIDDelete (Id id) (UserId userId) = + _mkRequest "DELETE" ["/teams/",toPath id,"/members/",toPath userId] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data TeamsIdMembersUserIDDelete +-- | @application/json@ +instance Produces TeamsIdMembersUserIDDelete MimeJSON + + +-- *** teamsIdPost + +-- | @POST \/teams\/{id}@ +-- +-- Updates a team +-- +-- Updates a team. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +teamsIdPost + :: (Consumes TeamsIdPost MimeJSON, MimeRender MimeJSON ModelsTeam) + => ModelsTeam -- ^ "team" - The team with updated values you want to update. + -> Id -- ^ "id" - Team ID + -> VikunjaRequest TeamsIdPost MimeJSON ModelsTeam MimeJSON +teamsIdPost team (Id id) = + _mkRequest "POST" ["/teams/",toPath id] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + `setBodyParam` team + +data TeamsIdPost + +-- | /Body Param/ "team" - The team with updated values you want to update. +instance HasBodyParam TeamsIdPost ModelsTeam + +-- | @application/json@ +instance Consumes TeamsIdPost MimeJSON + +-- | @application/json@ +instance Produces TeamsIdPost MimeJSON + + +-- *** teamsPut + +-- | @PUT \/teams@ +-- +-- Creates a new team +-- +-- Creates a new team. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +teamsPut + :: (Consumes TeamsPut MimeJSON, MimeRender MimeJSON ModelsTeam) + => ModelsTeam -- ^ "team" - The team you want to create. + -> VikunjaRequest TeamsPut MimeJSON ModelsTeam MimeJSON +teamsPut team = + _mkRequest "PUT" ["/teams"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + `setBodyParam` team + +data TeamsPut + +-- | /Body Param/ "team" - The team you want to create. +instance HasBodyParam TeamsPut ModelsTeam + +-- | @application/json@ +instance Consumes TeamsPut MimeJSON + +-- | @application/json@ +instance Produces TeamsPut MimeJSON + diff --git a/lib/Vikunja/API/Testing.hs b/lib/Vikunja/API/Testing.hs new file mode 100644 index 0000000..b15c319 --- /dev/null +++ b/lib/Vikunja/API/Testing.hs @@ -0,0 +1,78 @@ +{- + Vikunja API + + # Pagination Every endpoint capable of pagination will return two headers: * `x-pagination-total-pages`: The total number of available pages for this request * `x-pagination-result-count`: The number of items returned for this request. # Rights All endpoints which return a single item (project, task, etc.) - no array - will also return a `x-max-right` header with the max right the user has on this item as an int where `0` is `Read Only`, `1` is `Read & Write` and `2` is `Admin`. This can be used to show or hide ui elements based on the rights the user has. # Errors All errors have an error code and a human-readable error message in addition to the http status code. You should always check for the status code in the response, not only the http status code. Due to limitations in the swagger library we're using for this document, only one error per http status code is documented here. Make sure to check the [error docs](https://vikunja.io/docs/errors/) in Vikunja's documentation for a full list of available error codes. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **API Token:** You can create scoped API tokens for your user and use the token to make authenticated requests in the context of that user. The token must be provided via an `Authorization: Bearer ` header, similar to jwt auth. See the documentation for the `api` group to manage token creation and revocation. **BasicAuth:** Only used when requesting tasks via CalDAV. + + OpenAPI Version: 3.0.1 + Vikunja API API version: 0.24.6 + Contact: hello@vikunja.io + Generated by OpenAPI Generator (https://openapi-generator.tech) +-} + +{-| +Module : Vikunja.API.Testing +-} + +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE MonoLocalBinds #-} +{-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE OverloadedStrings #-} +{-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-binds -fno-warn-unused-imports #-} + +module Vikunja.API.Testing where + +import Vikunja.Core +import Vikunja.MimeTypes +import Vikunja.Model as M + +import qualified Data.Aeson as A +import qualified Data.ByteString as B +import qualified Data.ByteString.Lazy as BL +import qualified Data.Data as P (Typeable, TypeRep, typeOf, typeRep) +import qualified Data.Foldable as P +import qualified Data.Map as Map +import qualified Data.Maybe as P +import qualified Data.Proxy as P (Proxy(..)) +import qualified Data.Set as Set +import qualified Data.String as P +import qualified Data.Text as T +import qualified Data.Text.Encoding as T +import qualified Data.Text.Lazy as TL +import qualified Data.Text.Lazy.Encoding as TL +import qualified Data.Time as TI +import qualified Network.HTTP.Client.MultipartFormData as NH +import qualified Network.HTTP.Media as ME +import qualified Network.HTTP.Types as NH +import qualified Web.FormUrlEncoded as WH +import qualified Web.HttpApiData as WH + +import Data.Text (Text) +import GHC.Base ((<|>)) + +import Prelude ((==),(/=),($), (.),(<$>),(<*>),(>>=),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty,maybe,pure,Monad,Applicative,Functor) +import qualified Prelude as P + +-- * Operations + + +-- ** Testing + +-- *** testTablePatch + +-- | @PATCH \/test\/{table}@ +-- +-- Reset the db to a defined state +-- +-- Fills the specified table with the content provided in the payload. You need to enable the testing endpoint before doing this and provide the `Authorization: ` secret when making requests to this endpoint. See docs for more details. +-- +testTablePatch + :: Table -- ^ "table" - The table to reset + -> VikunjaRequest TestTablePatch MimeNoContent [UserUser] MimeJSON +testTablePatch (Table table) = + _mkRequest "PATCH" ["/test/",toPath table] + +data TestTablePatch +-- | @application/json@ +instance Produces TestTablePatch MimeJSON + diff --git a/lib/Vikunja/API/User.hs b/lib/Vikunja/API/User.hs new file mode 100644 index 0000000..f222e08 --- /dev/null +++ b/lib/Vikunja/API/User.hs @@ -0,0 +1,753 @@ +{- + Vikunja API + + # Pagination Every endpoint capable of pagination will return two headers: * `x-pagination-total-pages`: The total number of available pages for this request * `x-pagination-result-count`: The number of items returned for this request. # Rights All endpoints which return a single item (project, task, etc.) - no array - will also return a `x-max-right` header with the max right the user has on this item as an int where `0` is `Read Only`, `1` is `Read & Write` and `2` is `Admin`. This can be used to show or hide ui elements based on the rights the user has. # Errors All errors have an error code and a human-readable error message in addition to the http status code. You should always check for the status code in the response, not only the http status code. Due to limitations in the swagger library we're using for this document, only one error per http status code is documented here. Make sure to check the [error docs](https://vikunja.io/docs/errors/) in Vikunja's documentation for a full list of available error codes. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **API Token:** You can create scoped API tokens for your user and use the token to make authenticated requests in the context of that user. The token must be provided via an `Authorization: Bearer ` header, similar to jwt auth. See the documentation for the `api` group to manage token creation and revocation. **BasicAuth:** Only used when requesting tasks via CalDAV. + + OpenAPI Version: 3.0.1 + Vikunja API API version: 0.24.6 + Contact: hello@vikunja.io + Generated by OpenAPI Generator (https://openapi-generator.tech) +-} + +{-| +Module : Vikunja.API.User +-} + +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE MonoLocalBinds #-} +{-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE OverloadedStrings #-} +{-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-binds -fno-warn-unused-imports #-} + +module Vikunja.API.User where + +import Vikunja.Core +import Vikunja.MimeTypes +import Vikunja.Model as M + +import qualified Data.Aeson as A +import qualified Data.ByteString as B +import qualified Data.ByteString.Lazy as BL +import qualified Data.Data as P (Typeable, TypeRep, typeOf, typeRep) +import qualified Data.Foldable as P +import qualified Data.Map as Map +import qualified Data.Maybe as P +import qualified Data.Proxy as P (Proxy(..)) +import qualified Data.Set as Set +import qualified Data.String as P +import qualified Data.Text as T +import qualified Data.Text.Encoding as T +import qualified Data.Text.Lazy as TL +import qualified Data.Text.Lazy.Encoding as TL +import qualified Data.Time as TI +import qualified Network.HTTP.Client.MultipartFormData as NH +import qualified Network.HTTP.Media as ME +import qualified Network.HTTP.Types as NH +import qualified Web.FormUrlEncoded as WH +import qualified Web.HttpApiData as WH + +import Data.Text (Text) +import GHC.Base ((<|>)) + +import Prelude ((==),(/=),($), (.),(<$>),(<*>),(>>=),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty,maybe,pure,Monad,Applicative,Functor) +import qualified Prelude as P + +-- * Operations + + +-- ** User + +-- *** userConfirmPost + +-- | @POST \/user\/confirm@ +-- +-- Confirm the email of a new user +-- +-- Confirms the email of a newly registered user. +-- +userConfirmPost + :: (Consumes UserConfirmPost MimeJSON, MimeRender MimeJSON UserEmailConfirm) + => UserEmailConfirm -- ^ "credentials" - The token. + -> VikunjaRequest UserConfirmPost MimeJSON ModelsMessage MimeJSON +userConfirmPost credentials = + _mkRequest "POST" ["/user/confirm"] + `setBodyParam` credentials + +data UserConfirmPost + +-- | /Body Param/ "credentials" - The token. +instance HasBodyParam UserConfirmPost UserEmailConfirm + +-- | @application/json@ +instance Consumes UserConfirmPost MimeJSON + +-- | @application/json@ +instance Produces UserConfirmPost MimeJSON + + +-- *** userDeletionCancelPost + +-- | @POST \/user\/deletion\/cancel@ +-- +-- Abort a user deletion request +-- +-- Aborts an in-progress user deletion. +-- +userDeletionCancelPost + :: (Consumes UserDeletionCancelPost MimeJSON, MimeRender MimeJSON V1UserPasswordConfirmation) + => V1UserPasswordConfirmation -- ^ "credentials" - The user password to confirm. + -> VikunjaRequest UserDeletionCancelPost MimeJSON ModelsMessage MimeJSON +userDeletionCancelPost credentials = + _mkRequest "POST" ["/user/deletion/cancel"] + `setBodyParam` credentials + +data UserDeletionCancelPost + +-- | /Body Param/ "credentials" - The user password to confirm. +instance HasBodyParam UserDeletionCancelPost V1UserPasswordConfirmation + +-- | @application/json@ +instance Consumes UserDeletionCancelPost MimeJSON + +-- | @application/json@ +instance Produces UserDeletionCancelPost MimeJSON + + +-- *** userDeletionConfirmPost + +-- | @POST \/user\/deletion\/confirm@ +-- +-- Confirm a user deletion request +-- +-- Confirms the deletion request of a user sent via email. +-- +userDeletionConfirmPost + :: (Consumes UserDeletionConfirmPost MimeJSON, MimeRender MimeJSON V1UserDeletionRequestConfirm) + => V1UserDeletionRequestConfirm -- ^ "credentials" - The token. + -> VikunjaRequest UserDeletionConfirmPost MimeJSON ModelsMessage MimeJSON +userDeletionConfirmPost credentials = + _mkRequest "POST" ["/user/deletion/confirm"] + `setBodyParam` credentials + +data UserDeletionConfirmPost + +-- | /Body Param/ "credentials" - The token. +instance HasBodyParam UserDeletionConfirmPost V1UserDeletionRequestConfirm + +-- | @application/json@ +instance Consumes UserDeletionConfirmPost MimeJSON + +-- | @application/json@ +instance Produces UserDeletionConfirmPost MimeJSON + + +-- *** userDeletionRequestPost + +-- | @POST \/user\/deletion\/request@ +-- +-- Request the deletion of the user +-- +-- Requests the deletion of the current user. It will trigger an email which has to be confirmed to start the deletion. +-- +userDeletionRequestPost + :: (Consumes UserDeletionRequestPost MimeJSON, MimeRender MimeJSON V1UserPasswordConfirmation) + => V1UserPasswordConfirmation -- ^ "credentials" - The user password. + -> VikunjaRequest UserDeletionRequestPost MimeJSON ModelsMessage MimeJSON +userDeletionRequestPost credentials = + _mkRequest "POST" ["/user/deletion/request"] + `setBodyParam` credentials + +data UserDeletionRequestPost + +-- | /Body Param/ "credentials" - The user password. +instance HasBodyParam UserDeletionRequestPost V1UserPasswordConfirmation + +-- | @application/json@ +instance Consumes UserDeletionRequestPost MimeJSON + +-- | @application/json@ +instance Produces UserDeletionRequestPost MimeJSON + + +-- *** userExportDownloadPost + +-- | @POST \/user\/export\/download@ +-- +-- Download a user data export. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +userExportDownloadPost + :: (Consumes UserExportDownloadPost MimeJSON, MimeRender MimeJSON V1UserPasswordConfirmation) + => V1UserPasswordConfirmation -- ^ "password" - User password to confirm the download. + -> VikunjaRequest UserExportDownloadPost MimeJSON ModelsMessage MimeJSON +userExportDownloadPost password = + _mkRequest "POST" ["/user/export/download"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + `setBodyParam` password + +data UserExportDownloadPost + +-- | /Body Param/ "password" - User password to confirm the download. +instance HasBodyParam UserExportDownloadPost V1UserPasswordConfirmation + +-- | @application/json@ +instance Consumes UserExportDownloadPost MimeJSON + +-- | @application/json@ +instance Produces UserExportDownloadPost MimeJSON + + +-- *** userExportRequestPost + +-- | @POST \/user\/export\/request@ +-- +-- Request a user data export. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +userExportRequestPost + :: (Consumes UserExportRequestPost MimeJSON, MimeRender MimeJSON V1UserPasswordConfirmation) + => V1UserPasswordConfirmation -- ^ "password" - User password to confirm the data export request. + -> VikunjaRequest UserExportRequestPost MimeJSON ModelsMessage MimeJSON +userExportRequestPost password = + _mkRequest "POST" ["/user/export/request"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + `setBodyParam` password + +data UserExportRequestPost + +-- | /Body Param/ "password" - User password to confirm the data export request. +instance HasBodyParam UserExportRequestPost V1UserPasswordConfirmation + +-- | @application/json@ +instance Consumes UserExportRequestPost MimeJSON + +-- | @application/json@ +instance Produces UserExportRequestPost MimeJSON + + +-- *** userGet + +-- | @GET \/user@ +-- +-- Get user information +-- +-- Returns the current user object with their settings. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +userGet + :: VikunjaRequest UserGet MimeNoContent V1UserWithSettings MimeJSON +userGet = + _mkRequest "GET" ["/user"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data UserGet +-- | @application/json@ +instance Produces UserGet MimeJSON + + +-- *** userPasswordPost + +-- | @POST \/user\/password@ +-- +-- Change password +-- +-- Lets the current user change its password. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +userPasswordPost + :: (Consumes UserPasswordPost MimeJSON, MimeRender MimeJSON V1UserPassword) + => V1UserPassword -- ^ "userPassword" - The current and new password. + -> VikunjaRequest UserPasswordPost MimeJSON ModelsMessage MimeJSON +userPasswordPost userPassword = + _mkRequest "POST" ["/user/password"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + `setBodyParam` userPassword + +data UserPasswordPost + +-- | /Body Param/ "userPassword" - The current and new password. +instance HasBodyParam UserPasswordPost V1UserPassword + +-- | @application/json@ +instance Consumes UserPasswordPost MimeJSON + +-- | @application/json@ +instance Produces UserPasswordPost MimeJSON + + +-- *** userPasswordResetPost + +-- | @POST \/user\/password\/reset@ +-- +-- Resets a password +-- +-- Resets a user email with a previously reset token. +-- +userPasswordResetPost + :: (Consumes UserPasswordResetPost MimeJSON, MimeRender MimeJSON UserPasswordReset) + => UserPasswordReset -- ^ "credentials" - The token with the new password. + -> VikunjaRequest UserPasswordResetPost MimeJSON ModelsMessage MimeJSON +userPasswordResetPost credentials = + _mkRequest "POST" ["/user/password/reset"] + `setBodyParam` credentials + +data UserPasswordResetPost + +-- | /Body Param/ "credentials" - The token with the new password. +instance HasBodyParam UserPasswordResetPost UserPasswordReset + +-- | @application/json@ +instance Consumes UserPasswordResetPost MimeJSON + +-- | @application/json@ +instance Produces UserPasswordResetPost MimeJSON + + +-- *** userPasswordTokenPost + +-- | @POST \/user\/password\/token@ +-- +-- Request password reset token +-- +-- Requests a token to reset a users password. The token is sent via email. +-- +userPasswordTokenPost + :: (Consumes UserPasswordTokenPost MimeJSON, MimeRender MimeJSON UserPasswordTokenRequest) + => UserPasswordTokenRequest -- ^ "credentials" - The username of the user to request a token for. + -> VikunjaRequest UserPasswordTokenPost MimeJSON ModelsMessage MimeJSON +userPasswordTokenPost credentials = + _mkRequest "POST" ["/user/password/token"] + `setBodyParam` credentials + +data UserPasswordTokenPost + +-- | /Body Param/ "credentials" - The username of the user to request a token for. +instance HasBodyParam UserPasswordTokenPost UserPasswordTokenRequest + +-- | @application/json@ +instance Consumes UserPasswordTokenPost MimeJSON + +-- | @application/json@ +instance Produces UserPasswordTokenPost MimeJSON + + +-- *** userSettingsAvatarGet + +-- | @GET \/user\/settings\/avatar@ +-- +-- Return user avatar setting +-- +-- Returns the current user's avatar setting. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +userSettingsAvatarGet + :: VikunjaRequest UserSettingsAvatarGet MimeNoContent V1UserAvatarProvider MimeJSON +userSettingsAvatarGet = + _mkRequest "GET" ["/user/settings/avatar"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data UserSettingsAvatarGet +-- | @application/json@ +instance Produces UserSettingsAvatarGet MimeJSON + + +-- *** userSettingsAvatarPost + +-- | @POST \/user\/settings\/avatar@ +-- +-- Set the user's avatar +-- +-- Changes the user avatar. Valid types are gravatar (uses the user email), upload, initials, default. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +userSettingsAvatarPost + :: (Consumes UserSettingsAvatarPost MimeJSON, MimeRender MimeJSON V1UserAvatarProvider) + => V1UserAvatarProvider -- ^ "avatar" - The user's avatar setting + -> VikunjaRequest UserSettingsAvatarPost MimeJSON ModelsMessage MimeJSON +userSettingsAvatarPost avatar = + _mkRequest "POST" ["/user/settings/avatar"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + `setBodyParam` avatar + +data UserSettingsAvatarPost + +-- | /Body Param/ "avatar" - The user's avatar setting +instance HasBodyParam UserSettingsAvatarPost V1UserAvatarProvider + +-- | @application/json@ +instance Consumes UserSettingsAvatarPost MimeJSON + +-- | @application/json@ +instance Produces UserSettingsAvatarPost MimeJSON + + +-- *** userSettingsAvatarUploadPut + +-- | @PUT \/user\/settings\/avatar\/upload@ +-- +-- Upload a user avatar +-- +-- Upload a user avatar. This will also set the user's avatar provider to \"upload\" +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +userSettingsAvatarUploadPut + :: (Consumes UserSettingsAvatarUploadPut MimeMultipartFormData) + => Avatar -- ^ "avatar" - The avatar as single file. + -> VikunjaRequest UserSettingsAvatarUploadPut MimeMultipartFormData ModelsMessage MimeJSON +userSettingsAvatarUploadPut (Avatar avatar) = + _mkRequest "PUT" ["/user/settings/avatar/upload"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + `_addMultiFormPart` NH.partLBS "avatar" (mimeRender' MimeMultipartFormData avatar) + +data UserSettingsAvatarUploadPut + +-- | @multipart/form-data@ +instance Consumes UserSettingsAvatarUploadPut MimeMultipartFormData + +-- | @application/json@ +instance Produces UserSettingsAvatarUploadPut MimeJSON + + +-- *** userSettingsEmailPost + +-- | @POST \/user\/settings\/email@ +-- +-- Update email address +-- +-- Lets the current user change their email address. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +userSettingsEmailPost + :: (Consumes UserSettingsEmailPost MimeJSON, MimeRender MimeJSON UserEmailUpdate) + => UserEmailUpdate -- ^ "userEmailUpdate" - The new email address and current password. + -> VikunjaRequest UserSettingsEmailPost MimeJSON ModelsMessage MimeJSON +userSettingsEmailPost userEmailUpdate = + _mkRequest "POST" ["/user/settings/email"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + `setBodyParam` userEmailUpdate + +data UserSettingsEmailPost + +-- | /Body Param/ "userEmailUpdate" - The new email address and current password. +instance HasBodyParam UserSettingsEmailPost UserEmailUpdate + +-- | @application/json@ +instance Consumes UserSettingsEmailPost MimeJSON + +-- | @application/json@ +instance Produces UserSettingsEmailPost MimeJSON + + +-- *** userSettingsGeneralPost + +-- | @POST \/user\/settings\/general@ +-- +-- Change general user settings of the current user. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +userSettingsGeneralPost + :: (Consumes UserSettingsGeneralPost MimeJSON, MimeRender MimeJSON V1UserSettings) + => V1UserSettings -- ^ "avatar" - The updated user settings + -> VikunjaRequest UserSettingsGeneralPost MimeJSON ModelsMessage MimeJSON +userSettingsGeneralPost avatar = + _mkRequest "POST" ["/user/settings/general"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + `setBodyParam` avatar + +data UserSettingsGeneralPost + +-- | /Body Param/ "avatar" - The updated user settings +instance HasBodyParam UserSettingsGeneralPost V1UserSettings + +-- | @application/json@ +instance Consumes UserSettingsGeneralPost MimeJSON + +-- | @application/json@ +instance Produces UserSettingsGeneralPost MimeJSON + + +-- *** userSettingsTokenCaldavGet + +-- | @GET \/user\/settings\/token\/caldav@ +-- +-- Returns the caldav tokens for the current user +-- +-- Return the IDs and created dates of all caldav tokens for the current user. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +userSettingsTokenCaldavGet + :: VikunjaRequest UserSettingsTokenCaldavGet MimeNoContent [UserToken] MimeJSON +userSettingsTokenCaldavGet = + _mkRequest "GET" ["/user/settings/token/caldav"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data UserSettingsTokenCaldavGet +-- | @application/json@ +instance Produces UserSettingsTokenCaldavGet MimeJSON + + +-- *** userSettingsTokenCaldavIdGet + +-- | @GET \/user\/settings\/token\/caldav\/{id}@ +-- +-- Delete a caldav token by id +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +userSettingsTokenCaldavIdGet + :: Id -- ^ "id" - Token ID + -> VikunjaRequest UserSettingsTokenCaldavIdGet MimeNoContent ModelsMessage MimeJSON +userSettingsTokenCaldavIdGet (Id id) = + _mkRequest "GET" ["/user/settings/token/caldav/",toPath id] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data UserSettingsTokenCaldavIdGet +-- | @application/json@ +instance Produces UserSettingsTokenCaldavIdGet MimeJSON + + +-- *** userSettingsTokenCaldavPut + +-- | @PUT \/user\/settings\/token\/caldav@ +-- +-- Generate a caldav token +-- +-- Generates a caldav token which can be used for the caldav api. It is not possible to see the token again after it was generated. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +userSettingsTokenCaldavPut + :: VikunjaRequest UserSettingsTokenCaldavPut MimeNoContent UserToken MimeJSON +userSettingsTokenCaldavPut = + _mkRequest "PUT" ["/user/settings/token/caldav"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data UserSettingsTokenCaldavPut +-- | @application/json@ +instance Produces UserSettingsTokenCaldavPut MimeJSON + + +-- *** userSettingsTotpDisablePost + +-- | @POST \/user\/settings\/totp\/disable@ +-- +-- Disable totp settings +-- +-- Disables any totp settings for the current user. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +userSettingsTotpDisablePost + :: (Consumes UserSettingsTotpDisablePost MimeJSON, MimeRender MimeJSON UserLogin) + => UserLogin -- ^ "totp" - The current user's password (only password is enough). + -> VikunjaRequest UserSettingsTotpDisablePost MimeJSON ModelsMessage MimeJSON +userSettingsTotpDisablePost totp = + _mkRequest "POST" ["/user/settings/totp/disable"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + `setBodyParam` totp + +data UserSettingsTotpDisablePost + +-- | /Body Param/ "totp" - The current user's password (only password is enough). +instance HasBodyParam UserSettingsTotpDisablePost UserLogin + +-- | @application/json@ +instance Consumes UserSettingsTotpDisablePost MimeJSON + +-- | @application/json@ +instance Produces UserSettingsTotpDisablePost MimeJSON + + +-- *** userSettingsTotpEnablePost + +-- | @POST \/user\/settings\/totp\/enable@ +-- +-- Enable a previously enrolled totp setting. +-- +-- Enables a previously enrolled totp setting by providing a totp passcode. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +userSettingsTotpEnablePost + :: (Consumes UserSettingsTotpEnablePost MimeJSON, MimeRender MimeJSON UserTOTPPasscode) + => UserTOTPPasscode -- ^ "totp" - The totp passcode. + -> VikunjaRequest UserSettingsTotpEnablePost MimeJSON ModelsMessage MimeJSON +userSettingsTotpEnablePost totp = + _mkRequest "POST" ["/user/settings/totp/enable"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + `setBodyParam` totp + +data UserSettingsTotpEnablePost + +-- | /Body Param/ "totp" - The totp passcode. +instance HasBodyParam UserSettingsTotpEnablePost UserTOTPPasscode + +-- | @application/json@ +instance Consumes UserSettingsTotpEnablePost MimeJSON + +-- | @application/json@ +instance Produces UserSettingsTotpEnablePost MimeJSON + + +-- *** userSettingsTotpEnrollPost + +-- | @POST \/user\/settings\/totp\/enroll@ +-- +-- Enroll a user into totp +-- +-- Creates an initial setup for the user in the db. After this step, the user needs to verify they have a working totp setup with the \"enable totp\" endpoint. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +userSettingsTotpEnrollPost + :: VikunjaRequest UserSettingsTotpEnrollPost MimeNoContent UserTOTP MimeJSON +userSettingsTotpEnrollPost = + _mkRequest "POST" ["/user/settings/totp/enroll"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data UserSettingsTotpEnrollPost +-- | @application/json@ +instance Produces UserSettingsTotpEnrollPost MimeJSON + + +-- *** userSettingsTotpGet + +-- | @GET \/user\/settings\/totp@ +-- +-- Totp setting for the current user +-- +-- Returns the current user totp setting or an error if it is not enabled. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +userSettingsTotpGet + :: VikunjaRequest UserSettingsTotpGet MimeNoContent UserTOTP MimeJSON +userSettingsTotpGet = + _mkRequest "GET" ["/user/settings/totp"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data UserSettingsTotpGet +-- | @application/json@ +instance Produces UserSettingsTotpGet MimeJSON + + +-- *** userSettingsTotpQrcodeGet + +-- | @GET \/user\/settings\/totp\/qrcode@ +-- +-- Totp QR Code +-- +-- Returns a qr code for easier setup at end user's devices. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +userSettingsTotpQrcodeGet + :: VikunjaRequest UserSettingsTotpQrcodeGet MimeNoContent FilePath MimeJSON +userSettingsTotpQrcodeGet = + _mkRequest "GET" ["/user/settings/totp/qrcode"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data UserSettingsTotpQrcodeGet +-- | @application/json@ +instance Produces UserSettingsTotpQrcodeGet MimeJSON + + +-- *** userTimezonesGet + +-- | @GET \/user\/timezones@ +-- +-- Get all available time zones on this vikunja instance +-- +-- Because available time zones depend on the system Vikunja is running on, this endpoint returns a project of all valid time zones this particular Vikunja instance can handle. The project of time zones is not sorted, you should sort it on the client. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +userTimezonesGet + :: VikunjaRequest UserTimezonesGet MimeNoContent [Text] MimeJSON +userTimezonesGet = + _mkRequest "GET" ["/user/timezones"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data UserTimezonesGet +-- | @application/json@ +instance Produces UserTimezonesGet MimeJSON + + +-- *** userTokenPost + +-- | @POST \/user\/token@ +-- +-- Renew user token +-- +-- Returns a new valid jwt user token with an extended length. +-- +userTokenPost + :: VikunjaRequest UserTokenPost MimeNoContent AuthToken MimeJSON +userTokenPost = + _mkRequest "POST" ["/user/token"] + +data UserTokenPost +-- | @application/json@ +instance Produces UserTokenPost MimeJSON + + +-- *** usernameAvatarGet + +-- | @GET \/{username}\/avatar@ +-- +-- User Avatar +-- +-- Returns the user avatar as image. +-- +usernameAvatarGet + :: Username -- ^ "username" - The username of the user who's avatar you want to get + -> VikunjaRequest UsernameAvatarGet MimeNoContent FilePath MimeOctetStream +usernameAvatarGet (Username username) = + _mkRequest "GET" ["/",toPath username,"/avatar"] + +data UsernameAvatarGet + +-- | /Optional Param/ "size" - The size of the avatar you want to get. If bigger than the max configured size this will be adjusted to the maximum size. +instance HasOptionalParam UsernameAvatarGet Size where + applyOptionalParam req (Size xs) = + req `addQuery` toQuery ("size", Just xs) +-- | @application/octet-stream@ +instance Produces UsernameAvatarGet MimeOctetStream + + +-- *** usersGet + +-- | @GET \/users@ +-- +-- Get users +-- +-- Search for a user by its username, name or full email. Name (not username) or email require that the user has enabled this in their settings. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +usersGet + :: VikunjaRequest UsersGet MimeNoContent [UserUser] MimeJSON +usersGet = + _mkRequest "GET" ["/users"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data UsersGet + +-- | /Optional Param/ "s" - The search criteria. +instance HasOptionalParam UsersGet S where + applyOptionalParam req (S xs) = + req `addQuery` toQuery ("s", Just xs) +-- | @application/json@ +instance Produces UsersGet MimeJSON + diff --git a/lib/Vikunja/API/Webhooks.hs b/lib/Vikunja/API/Webhooks.hs new file mode 100644 index 0000000..540f3fd --- /dev/null +++ b/lib/Vikunja/API/Webhooks.hs @@ -0,0 +1,190 @@ +{- + Vikunja API + + # Pagination Every endpoint capable of pagination will return two headers: * `x-pagination-total-pages`: The total number of available pages for this request * `x-pagination-result-count`: The number of items returned for this request. # Rights All endpoints which return a single item (project, task, etc.) - no array - will also return a `x-max-right` header with the max right the user has on this item as an int where `0` is `Read Only`, `1` is `Read & Write` and `2` is `Admin`. This can be used to show or hide ui elements based on the rights the user has. # Errors All errors have an error code and a human-readable error message in addition to the http status code. You should always check for the status code in the response, not only the http status code. Due to limitations in the swagger library we're using for this document, only one error per http status code is documented here. Make sure to check the [error docs](https://vikunja.io/docs/errors/) in Vikunja's documentation for a full list of available error codes. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **API Token:** You can create scoped API tokens for your user and use the token to make authenticated requests in the context of that user. The token must be provided via an `Authorization: Bearer ` header, similar to jwt auth. See the documentation for the `api` group to manage token creation and revocation. **BasicAuth:** Only used when requesting tasks via CalDAV. + + OpenAPI Version: 3.0.1 + Vikunja API API version: 0.24.6 + Contact: hello@vikunja.io + Generated by OpenAPI Generator (https://openapi-generator.tech) +-} + +{-| +Module : Vikunja.API.Webhooks +-} + +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE MonoLocalBinds #-} +{-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE OverloadedStrings #-} +{-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-binds -fno-warn-unused-imports #-} + +module Vikunja.API.Webhooks where + +import Vikunja.Core +import Vikunja.MimeTypes +import Vikunja.Model as M + +import qualified Data.Aeson as A +import qualified Data.ByteString as B +import qualified Data.ByteString.Lazy as BL +import qualified Data.Data as P (Typeable, TypeRep, typeOf, typeRep) +import qualified Data.Foldable as P +import qualified Data.Map as Map +import qualified Data.Maybe as P +import qualified Data.Proxy as P (Proxy(..)) +import qualified Data.Set as Set +import qualified Data.String as P +import qualified Data.Text as T +import qualified Data.Text.Encoding as T +import qualified Data.Text.Lazy as TL +import qualified Data.Text.Lazy.Encoding as TL +import qualified Data.Time as TI +import qualified Network.HTTP.Client.MultipartFormData as NH +import qualified Network.HTTP.Media as ME +import qualified Network.HTTP.Types as NH +import qualified Web.FormUrlEncoded as WH +import qualified Web.HttpApiData as WH + +import Data.Text (Text) +import GHC.Base ((<|>)) + +import Prelude ((==),(/=),($), (.),(<$>),(<*>),(>>=),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty,maybe,pure,Monad,Applicative,Functor) +import qualified Prelude as P + +-- * Operations + + +-- ** Webhooks + +-- *** projectsIdWebhooksGet + +-- | @GET \/projects\/{id}\/webhooks@ +-- +-- Get all api webhook targets for the specified project +-- +-- Get all api webhook targets for the specified project. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +projectsIdWebhooksGet + :: Id -- ^ "id" - Project ID + -> VikunjaRequest ProjectsIdWebhooksGet MimeNoContent [ModelsWebhook] MimeJSON +projectsIdWebhooksGet (Id id) = + _mkRequest "GET" ["/projects/",toPath id,"/webhooks"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data ProjectsIdWebhooksGet + +-- | /Optional Param/ "page" - The page number. Used for pagination. If not provided, the first page of results is returned. +instance HasOptionalParam ProjectsIdWebhooksGet Page where + applyOptionalParam req (Page xs) = + req `addQuery` toQuery ("page", Just xs) + +-- | /Optional Param/ "per_page" - The maximum number of items per bucket per page. This parameter is limited by the configured maximum of items per page. +instance HasOptionalParam ProjectsIdWebhooksGet PerPage where + applyOptionalParam req (PerPage xs) = + req `addQuery` toQuery ("per_page", Just xs) +-- | @application/json@ +instance Produces ProjectsIdWebhooksGet MimeJSON + + +-- *** projectsIdWebhooksPut + +-- | @PUT \/projects\/{id}\/webhooks@ +-- +-- Create a webhook target +-- +-- Create a webhook target which receives POST requests about specified events from a project. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +projectsIdWebhooksPut + :: (Consumes ProjectsIdWebhooksPut MimeJSON, MimeRender MimeJSON ModelsWebhook) + => ModelsWebhook -- ^ "webhook" - The webhook target object with required fields + -> Id -- ^ "id" - Project ID + -> VikunjaRequest ProjectsIdWebhooksPut MimeJSON ModelsWebhook MimeJSON +projectsIdWebhooksPut webhook (Id id) = + _mkRequest "PUT" ["/projects/",toPath id,"/webhooks"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + `setBodyParam` webhook + +data ProjectsIdWebhooksPut + +-- | /Body Param/ "webhook" - The webhook target object with required fields +instance HasBodyParam ProjectsIdWebhooksPut ModelsWebhook + +-- | @application/json@ +instance Consumes ProjectsIdWebhooksPut MimeJSON + +-- | @application/json@ +instance Produces ProjectsIdWebhooksPut MimeJSON + + +-- *** projectsIdWebhooksWebhookIDDelete + +-- | @DELETE \/projects\/{id}\/webhooks\/{webhookID}@ +-- +-- Deletes an existing webhook target +-- +-- Delete any of the project's webhook targets. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +projectsIdWebhooksWebhookIDDelete + :: Id -- ^ "id" - Project ID + -> WebhookId -- ^ "webhookId" - Webhook ID + -> VikunjaRequest ProjectsIdWebhooksWebhookIDDelete MimeNoContent ModelsMessage MimeJSON +projectsIdWebhooksWebhookIDDelete (Id id) (WebhookId webhookId) = + _mkRequest "DELETE" ["/projects/",toPath id,"/webhooks/",toPath webhookId] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data ProjectsIdWebhooksWebhookIDDelete +-- | @application/json@ +instance Produces ProjectsIdWebhooksWebhookIDDelete MimeJSON + + +-- *** projectsIdWebhooksWebhookIDPost + +-- | @POST \/projects\/{id}\/webhooks\/{webhookID}@ +-- +-- Change a webhook target's events. +-- +-- Change a webhook target's events. You cannot change other values of a webhook. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +projectsIdWebhooksWebhookIDPost + :: Id -- ^ "id" - Project ID + -> WebhookId -- ^ "webhookId" - Webhook ID + -> VikunjaRequest ProjectsIdWebhooksWebhookIDPost MimeNoContent ModelsWebhook MimeJSON +projectsIdWebhooksWebhookIDPost (Id id) (WebhookId webhookId) = + _mkRequest "POST" ["/projects/",toPath id,"/webhooks/",toPath webhookId] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data ProjectsIdWebhooksWebhookIDPost +-- | @application/json@ +instance Produces ProjectsIdWebhooksWebhookIDPost MimeJSON + + +-- *** webhooksEventsGet + +-- | @GET \/webhooks\/events@ +-- +-- Get all possible webhook events +-- +-- Get all possible webhook events to use when creating or updating a webhook target. +-- +-- AuthMethod: 'AuthApiKeyJWTKeyAuth' +-- +webhooksEventsGet + :: VikunjaRequest WebhooksEventsGet MimeNoContent [Text] MimeJSON +webhooksEventsGet = + _mkRequest "GET" ["/webhooks/events"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyJWTKeyAuth) + +data WebhooksEventsGet +-- | @application/json@ +instance Produces WebhooksEventsGet MimeJSON + diff --git a/lib/Vikunja/Client.hs b/lib/Vikunja/Client.hs new file mode 100644 index 0000000..a4c3230 --- /dev/null +++ b/lib/Vikunja/Client.hs @@ -0,0 +1,224 @@ +{- + Vikunja API + + # Pagination Every endpoint capable of pagination will return two headers: * `x-pagination-total-pages`: The total number of available pages for this request * `x-pagination-result-count`: The number of items returned for this request. # Rights All endpoints which return a single item (project, task, etc.) - no array - will also return a `x-max-right` header with the max right the user has on this item as an int where `0` is `Read Only`, `1` is `Read & Write` and `2` is `Admin`. This can be used to show or hide ui elements based on the rights the user has. # Errors All errors have an error code and a human-readable error message in addition to the http status code. You should always check for the status code in the response, not only the http status code. Due to limitations in the swagger library we're using for this document, only one error per http status code is documented here. Make sure to check the [error docs](https://vikunja.io/docs/errors/) in Vikunja's documentation for a full list of available error codes. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **API Token:** You can create scoped API tokens for your user and use the token to make authenticated requests in the context of that user. The token must be provided via an `Authorization: Bearer ` header, similar to jwt auth. See the documentation for the `api` group to manage token creation and revocation. **BasicAuth:** Only used when requesting tasks via CalDAV. + + OpenAPI Version: 3.0.1 + Vikunja API API version: 0.24.6 + Contact: hello@vikunja.io + Generated by OpenAPI Generator (https://openapi-generator.tech) +-} + +{-| +Module : Vikunja.Client +-} + +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE RankNTypes #-} +{-# LANGUAGE RecordWildCards #-} +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE DeriveFunctor #-} +{-# LANGUAGE DeriveFoldable #-} +{-# LANGUAGE DeriveTraversable #-} +{-# OPTIONS_GHC -fno-warn-unused-binds -fno-warn-unused-imports #-} + +module Vikunja.Client where + +import Vikunja.Core +import Vikunja.Logging +import Vikunja.MimeTypes + +import qualified Control.Exception.Safe as E +import qualified Control.Monad.IO.Class as P +import qualified Control.Monad as P +import qualified Data.Aeson.Types as A +import qualified Data.ByteString as B +import qualified Data.ByteString.Char8 as BC +import qualified Data.ByteString.Lazy as BL +import qualified Data.ByteString.Lazy.Char8 as BCL +import qualified Data.Proxy as P (Proxy(..)) +import qualified Data.Text as T +import qualified Data.Text.Encoding as T +import qualified Network.HTTP.Client as NH +import qualified Network.HTTP.Client.MultipartFormData as NH +import qualified Network.HTTP.Types as NH +import qualified Web.FormUrlEncoded as WH +import qualified Web.HttpApiData as WH + +import Data.Function ((&)) +import Data.Monoid ((<>)) +import Data.Text (Text) +import GHC.Exts (IsString(..)) + +-- * Dispatch + +-- ** Lbs + +-- | send a request returning the raw http response +dispatchLbs + :: (Produces req accept, MimeType contentType) + => NH.Manager -- ^ http-client Connection manager + -> VikunjaConfig -- ^ config + -> VikunjaRequest req contentType res accept -- ^ request + -> IO (NH.Response BCL.ByteString) -- ^ response +dispatchLbs manager config request = do + initReq <- _toInitRequest config request + dispatchInitUnsafe manager config initReq + +-- ** Mime + +-- | pair of decoded http body and http response +data MimeResult res = + MimeResult { mimeResult :: Either MimeError res -- ^ decoded http body + , mimeResultResponse :: NH.Response BCL.ByteString -- ^ http response + } + deriving (Show, Functor, Foldable, Traversable) + +-- | pair of unrender/parser error and http response +data MimeError = + MimeError { + mimeError :: String -- ^ unrender/parser error + , mimeErrorResponse :: NH.Response BCL.ByteString -- ^ http response + } deriving (Show) + +-- | send a request returning the 'MimeResult' +dispatchMime + :: forall req contentType res accept. (Produces req accept, MimeUnrender accept res, MimeType contentType) + => NH.Manager -- ^ http-client Connection manager + -> VikunjaConfig -- ^ config + -> VikunjaRequest req contentType res accept -- ^ request + -> IO (MimeResult res) -- ^ response +dispatchMime manager config request = do + httpResponse <- dispatchLbs manager config request + let statusCode = NH.statusCode . NH.responseStatus $ httpResponse + parsedResult <- + runConfigLogWithExceptions "Client" config $ + do if (statusCode >= 400 && statusCode < 600) + then do + let s = "error statusCode: " ++ show statusCode + _log "Client" levelError (T.pack s) + pure (Left (MimeError s httpResponse)) + else case mimeUnrender (P.Proxy :: P.Proxy accept) (NH.responseBody httpResponse) of + Left s -> do + _log "Client" levelError (T.pack s) + pure (Left (MimeError s httpResponse)) + Right r -> pure (Right r) + return (MimeResult parsedResult httpResponse) + +-- | like 'dispatchMime', but only returns the decoded http body +dispatchMime' + :: (Produces req accept, MimeUnrender accept res, MimeType contentType) + => NH.Manager -- ^ http-client Connection manager + -> VikunjaConfig -- ^ config + -> VikunjaRequest req contentType res accept -- ^ request + -> IO (Either MimeError res) -- ^ response +dispatchMime' manager config request = do + MimeResult parsedResult _ <- dispatchMime manager config request + return parsedResult + +-- ** Unsafe + +-- | like 'dispatchReqLbs', but does not validate the operation is a 'Producer' of the "accept" 'MimeType'. (Useful if the server's response is undocumented) +dispatchLbsUnsafe + :: (MimeType accept, MimeType contentType) + => NH.Manager -- ^ http-client Connection manager + -> VikunjaConfig -- ^ config + -> VikunjaRequest req contentType res accept -- ^ request + -> IO (NH.Response BCL.ByteString) -- ^ response +dispatchLbsUnsafe manager config request = do + initReq <- _toInitRequest config request + dispatchInitUnsafe manager config initReq + +-- | dispatch an InitRequest +dispatchInitUnsafe + :: NH.Manager -- ^ http-client Connection manager + -> VikunjaConfig -- ^ config + -> InitRequest req contentType res accept -- ^ init request + -> IO (NH.Response BCL.ByteString) -- ^ response +dispatchInitUnsafe manager config (InitRequest req) = do + runConfigLogWithExceptions src config $ + do _log src levelInfo requestLogMsg + _log src levelDebug requestDbgLogMsg + res <- P.liftIO $ NH.httpLbs req manager + _log src levelInfo (responseLogMsg res) + _log src levelDebug ((T.pack . show) res) + return res + where + src = "Client" + endpoint = + T.pack $ + BC.unpack $ + NH.method req <> " " <> NH.host req <> NH.path req <> NH.queryString req + requestLogMsg = "REQ:" <> endpoint + requestDbgLogMsg = + "Headers=" <> (T.pack . show) (NH.requestHeaders req) <> " Body=" <> + (case NH.requestBody req of + NH.RequestBodyLBS xs -> T.decodeUtf8 (BL.toStrict xs) + _ -> "") + responseStatusCode = (T.pack . show) . NH.statusCode . NH.responseStatus + responseLogMsg res = + "RES:statusCode=" <> responseStatusCode res <> " (" <> endpoint <> ")" + +-- * InitRequest + +-- | wraps an http-client 'Request' with request/response type parameters +newtype InitRequest req contentType res accept = InitRequest + { unInitRequest :: NH.Request + } deriving (Show) + +-- | Build an http-client 'Request' record from the supplied config and request +_toInitRequest + :: (MimeType accept, MimeType contentType) + => VikunjaConfig -- ^ config + -> VikunjaRequest req contentType res accept -- ^ request + -> IO (InitRequest req contentType res accept) -- ^ initialized request +_toInitRequest config req0 = + runConfigLogWithExceptions "Client" config $ do + parsedReq <- P.liftIO $ NH.parseRequest $ BCL.unpack $ BCL.append (configHost config) (BCL.concat (rUrlPath req0)) + req1 <- P.liftIO $ _applyAuthMethods req0 config + P.when + (configValidateAuthMethods config && (not . null . rAuthTypes) req1) + (E.throw $ AuthMethodException $ "AuthMethod not configured: " <> (show . head . rAuthTypes) req1) + let req2 = req1 & _setContentTypeHeader & _setAcceptHeader + params = rParams req2 + reqHeaders = ("User-Agent", WH.toHeader (configUserAgent config)) : paramsHeaders params + reqQuery = let query = paramsQuery params + queryExtraUnreserved = configQueryExtraUnreserved config + in if B.null queryExtraUnreserved + then NH.renderQuery True query + else NH.renderQueryPartialEscape True (toPartialEscapeQuery queryExtraUnreserved query) + pReq = parsedReq { NH.method = rMethod req2 + , NH.requestHeaders = reqHeaders + , NH.queryString = reqQuery + } + outReq <- case paramsBody params of + ParamBodyNone -> pure (pReq { NH.requestBody = mempty }) + ParamBodyB bs -> pure (pReq { NH.requestBody = NH.RequestBodyBS bs }) + ParamBodyBL bl -> pure (pReq { NH.requestBody = NH.RequestBodyLBS bl }) + ParamBodyFormUrlEncoded form -> pure (pReq { NH.requestBody = NH.RequestBodyLBS (WH.urlEncodeForm form) }) + ParamBodyMultipartFormData parts -> NH.formDataBody parts pReq + + pure (InitRequest outReq) + +-- | modify the underlying Request +modifyInitRequest :: InitRequest req contentType res accept -> (NH.Request -> NH.Request) -> InitRequest req contentType res accept +modifyInitRequest (InitRequest req) f = InitRequest (f req) + +-- | modify the underlying Request (monadic) +modifyInitRequestM :: Monad m => InitRequest req contentType res accept -> (NH.Request -> m NH.Request) -> m (InitRequest req contentType res accept) +modifyInitRequestM (InitRequest req) f = fmap InitRequest (f req) + +-- ** Logging + +-- | Run a block using the configured logger instance +runConfigLog + :: P.MonadIO m + => VikunjaConfig -> LogExec m a +runConfigLog config = configLogExecWithContext config (configLogContext config) + +-- | Run a block using the configured logger instance (logs exceptions) +runConfigLogWithExceptions + :: (E.MonadCatch m, P.MonadIO m) + => T.Text -> VikunjaConfig -> LogExec m a +runConfigLogWithExceptions src config = runConfigLog config . logExceptions src diff --git a/lib/Vikunja/Core.hs b/lib/Vikunja/Core.hs new file mode 100644 index 0000000..c8966a4 --- /dev/null +++ b/lib/Vikunja/Core.hs @@ -0,0 +1,582 @@ +{- + Vikunja API + + # Pagination Every endpoint capable of pagination will return two headers: * `x-pagination-total-pages`: The total number of available pages for this request * `x-pagination-result-count`: The number of items returned for this request. # Rights All endpoints which return a single item (project, task, etc.) - no array - will also return a `x-max-right` header with the max right the user has on this item as an int where `0` is `Read Only`, `1` is `Read & Write` and `2` is `Admin`. This can be used to show or hide ui elements based on the rights the user has. # Errors All errors have an error code and a human-readable error message in addition to the http status code. You should always check for the status code in the response, not only the http status code. Due to limitations in the swagger library we're using for this document, only one error per http status code is documented here. Make sure to check the [error docs](https://vikunja.io/docs/errors/) in Vikunja's documentation for a full list of available error codes. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **API Token:** You can create scoped API tokens for your user and use the token to make authenticated requests in the context of that user. The token must be provided via an `Authorization: Bearer ` header, similar to jwt auth. See the documentation for the `api` group to manage token creation and revocation. **BasicAuth:** Only used when requesting tasks via CalDAV. + + OpenAPI Version: 3.0.1 + Vikunja API API version: 0.24.6 + Contact: hello@vikunja.io + Generated by OpenAPI Generator (https://openapi-generator.tech) +-} + +{-| +Module : Vikunja.Core +-} + +{-# LANGUAGE DeriveDataTypeable #-} +{-# LANGUAGE ExistentialQuantification #-} +{-# LANGUAGE GeneralizedNewtypeDeriving #-} +{-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE NamedFieldPuns #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE RankNTypes #-} +{-# LANGUAGE RecordWildCards #-} +{-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE TupleSections #-} +{-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE CPP #-} +{-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-binds -fno-warn-unused-imports #-} + +module Vikunja.Core where + +import Vikunja.MimeTypes +import Vikunja.Logging + +import qualified Control.Arrow as P (left) +import qualified Control.DeepSeq as NF +import qualified Control.Exception.Safe as E +import qualified Data.Aeson as A +import qualified Data.ByteString as B +import qualified Data.ByteString.Base64.Lazy as BL64 +import qualified Data.ByteString.Builder as BB +import qualified Data.ByteString.Char8 as BC +import qualified Data.ByteString.Lazy as BL +import qualified Data.ByteString.Lazy.Char8 as BCL +import qualified Data.CaseInsensitive as CI +import qualified Data.Data as P (Data, Typeable, TypeRep, typeRep) +import qualified Data.Foldable as P +import qualified Data.Ix as P +import qualified Data.Kind as K (Type) +import qualified Data.Maybe as P +import qualified Data.Proxy as P (Proxy(..)) +import qualified Data.Text as T +import qualified Data.Text.Encoding as T +import qualified Data.Time as TI +import qualified Data.Time.ISO8601 as TI +import qualified GHC.Base as P (Alternative) +import qualified Lens.Micro as L +import qualified Network.HTTP.Client.MultipartFormData as NH +import qualified Network.HTTP.Types as NH +import qualified Prelude as P +import qualified Text.Printf as T +import qualified Web.FormUrlEncoded as WH +import qualified Web.HttpApiData as WH + +import Control.Applicative ((<|>)) +import Control.Applicative (Alternative) +import Control.Monad.Fail (MonadFail) +import Data.Function ((&)) +import Data.Foldable(foldlM) +import Data.Monoid ((<>)) +import Data.Text (Text) +import Prelude (($), (.), (&&), (<$>), (<*>), Maybe(..), Bool(..), Char, String, fmap, mempty, pure, return, show, IO, Monad, Functor, maybe) + +-- * VikunjaConfig + +-- | +data VikunjaConfig = VikunjaConfig + { configHost :: BCL.ByteString -- ^ host supplied in the Request + , configUserAgent :: Text -- ^ user-agent supplied in the Request + , configLogExecWithContext :: LogExecWithContext -- ^ Run a block using a Logger instance + , configLogContext :: LogContext -- ^ Configures the logger + , configAuthMethods :: [AnyAuthMethod] -- ^ List of configured auth methods + , configValidateAuthMethods :: Bool -- ^ throw exceptions if auth methods are not configured + , configQueryExtraUnreserved :: B.ByteString -- ^ Configures additional querystring characters which must not be URI encoded, e.g. '+' or ':' + } + +-- | display the config +instance P.Show VikunjaConfig where + show c = + T.printf + "{ configHost = %v, configUserAgent = %v, ..}" + (show (configHost c)) + (show (configUserAgent c)) + +-- | constructs a default VikunjaConfig +-- +-- configHost: +-- +-- @/api/v1@ +-- +-- configUserAgent: +-- +-- @"vikunja-api/0.24.6.0"@ +-- +newConfig :: IO VikunjaConfig +newConfig = do + logCxt <- initLogContext + return $ VikunjaConfig + { configHost = "/api/v1" + , configUserAgent = "vikunja-api/0.24.6.0" + , configLogExecWithContext = runDefaultLogExecWithContext + , configLogContext = logCxt + , configAuthMethods = [] + , configValidateAuthMethods = True + , configQueryExtraUnreserved = "" + } + +-- | updates config use AuthMethod on matching requests +addAuthMethod :: AuthMethod auth => VikunjaConfig -> auth -> VikunjaConfig +addAuthMethod config@VikunjaConfig {configAuthMethods = as} a = + config { configAuthMethods = AnyAuthMethod a : as} + +-- | updates the config to use stdout logging +withStdoutLogging :: VikunjaConfig -> IO VikunjaConfig +withStdoutLogging p = do + logCxt <- stdoutLoggingContext (configLogContext p) + return $ p { configLogExecWithContext = stdoutLoggingExec, configLogContext = logCxt } + +-- | updates the config to use stderr logging +withStderrLogging :: VikunjaConfig -> IO VikunjaConfig +withStderrLogging p = do + logCxt <- stderrLoggingContext (configLogContext p) + return $ p { configLogExecWithContext = stderrLoggingExec, configLogContext = logCxt } + +-- | updates the config to disable logging +withNoLogging :: VikunjaConfig -> VikunjaConfig +withNoLogging p = p { configLogExecWithContext = runNullLogExec} + +-- * VikunjaRequest + +-- | Represents a request. +-- +-- Type Variables: +-- +-- * req - request operation +-- * contentType - 'MimeType' associated with request body +-- * res - response model +-- * accept - 'MimeType' associated with response body +data VikunjaRequest req contentType res accept = VikunjaRequest + { rMethod :: NH.Method -- ^ Method of VikunjaRequest + , rUrlPath :: [BCL.ByteString] -- ^ Endpoint of VikunjaRequest + , rParams :: Params -- ^ params of VikunjaRequest + , rAuthTypes :: [P.TypeRep] -- ^ types of auth methods + } + deriving (P.Show) + +-- | 'rMethod' Lens +rMethodL :: Lens_' (VikunjaRequest req contentType res accept) NH.Method +rMethodL f VikunjaRequest{..} = (\rMethod -> VikunjaRequest { rMethod, ..} ) <$> f rMethod +{-# INLINE rMethodL #-} + +-- | 'rUrlPath' Lens +rUrlPathL :: Lens_' (VikunjaRequest req contentType res accept) [BCL.ByteString] +rUrlPathL f VikunjaRequest{..} = (\rUrlPath -> VikunjaRequest { rUrlPath, ..} ) <$> f rUrlPath +{-# INLINE rUrlPathL #-} + +-- | 'rParams' Lens +rParamsL :: Lens_' (VikunjaRequest req contentType res accept) Params +rParamsL f VikunjaRequest{..} = (\rParams -> VikunjaRequest { rParams, ..} ) <$> f rParams +{-# INLINE rParamsL #-} + +-- | 'rParams' Lens +rAuthTypesL :: Lens_' (VikunjaRequest req contentType res accept) [P.TypeRep] +rAuthTypesL f VikunjaRequest{..} = (\rAuthTypes -> VikunjaRequest { rAuthTypes, ..} ) <$> f rAuthTypes +{-# INLINE rAuthTypesL #-} + +-- * HasBodyParam + +-- | Designates the body parameter of a request +class HasBodyParam req param where + setBodyParam :: forall contentType res accept. (Consumes req contentType, MimeRender contentType param) => VikunjaRequest req contentType res accept -> param -> VikunjaRequest req contentType res accept + setBodyParam req xs = + req `_setBodyLBS` mimeRender (P.Proxy :: P.Proxy contentType) xs & _setContentTypeHeader + +-- * HasOptionalParam + +-- | Designates the optional parameters of a request +class HasOptionalParam req param where + {-# MINIMAL applyOptionalParam | (-&-) #-} + + -- | Apply an optional parameter to a request + applyOptionalParam :: VikunjaRequest req contentType res accept -> param -> VikunjaRequest req contentType res accept + applyOptionalParam = (-&-) + {-# INLINE applyOptionalParam #-} + + -- | infix operator \/ alias for 'addOptionalParam' + (-&-) :: VikunjaRequest req contentType res accept -> param -> VikunjaRequest req contentType res accept + (-&-) = applyOptionalParam + {-# INLINE (-&-) #-} + +infixl 2 -&- + +-- | Request Params +data Params = Params + { paramsQuery :: NH.Query + , paramsHeaders :: NH.RequestHeaders + , paramsBody :: ParamBody + } + deriving (P.Show) + +-- | 'paramsQuery' Lens +paramsQueryL :: Lens_' Params NH.Query +paramsQueryL f Params{..} = (\paramsQuery -> Params { paramsQuery, ..} ) <$> f paramsQuery +{-# INLINE paramsQueryL #-} + +-- | 'paramsHeaders' Lens +paramsHeadersL :: Lens_' Params NH.RequestHeaders +paramsHeadersL f Params{..} = (\paramsHeaders -> Params { paramsHeaders, ..} ) <$> f paramsHeaders +{-# INLINE paramsHeadersL #-} + +-- | 'paramsBody' Lens +paramsBodyL :: Lens_' Params ParamBody +paramsBodyL f Params{..} = (\paramsBody -> Params { paramsBody, ..} ) <$> f paramsBody +{-# INLINE paramsBodyL #-} + +-- | Request Body +data ParamBody + = ParamBodyNone + | ParamBodyB B.ByteString + | ParamBodyBL BL.ByteString + | ParamBodyFormUrlEncoded WH.Form + | ParamBodyMultipartFormData [NH.Part] + deriving (P.Show) + +-- ** VikunjaRequest Utils + +_mkRequest :: NH.Method -- ^ Method + -> [BCL.ByteString] -- ^ Endpoint + -> VikunjaRequest req contentType res accept -- ^ req: Request Type, res: Response Type +_mkRequest m u = VikunjaRequest m u _mkParams [] + +_mkParams :: Params +_mkParams = Params [] [] ParamBodyNone + +setHeader :: + VikunjaRequest req contentType res accept + -> [NH.Header] + -> VikunjaRequest req contentType res accept +setHeader req header = + req `removeHeader` P.fmap P.fst header + & (`addHeader` header) + +addHeader :: + VikunjaRequest req contentType res accept + -> [NH.Header] + -> VikunjaRequest req contentType res accept +addHeader req header = L.over (rParamsL . paramsHeadersL) (header P.++) req + +removeHeader :: VikunjaRequest req contentType res accept -> [NH.HeaderName] -> VikunjaRequest req contentType res accept +removeHeader req header = + req & + L.over + (rParamsL . paramsHeadersL) + (P.filter (\h -> cifst h `P.notElem` P.fmap CI.mk header)) + where + cifst = CI.mk . P.fst + + +_setContentTypeHeader :: forall req contentType res accept. MimeType contentType => VikunjaRequest req contentType res accept -> VikunjaRequest req contentType res accept +_setContentTypeHeader req = + case mimeType (P.Proxy :: P.Proxy contentType) of + Just m -> req `setHeader` [("content-type", BC.pack $ P.show m)] + Nothing -> req `removeHeader` ["content-type"] + +_setAcceptHeader :: forall req contentType res accept. MimeType accept => VikunjaRequest req contentType res accept -> VikunjaRequest req contentType res accept +_setAcceptHeader req = + case mimeType (P.Proxy :: P.Proxy accept) of + Just m -> req `setHeader` [("accept", BC.pack $ P.show m)] + Nothing -> req `removeHeader` ["accept"] + +setQuery :: + VikunjaRequest req contentType res accept + -> [NH.QueryItem] + -> VikunjaRequest req contentType res accept +setQuery req query = + req & + L.over + (rParamsL . paramsQueryL) + (P.filter (\q -> cifst q `P.notElem` P.fmap cifst query)) & + (`addQuery` query) + where + cifst = CI.mk . P.fst + +addQuery :: + VikunjaRequest req contentType res accept + -> [NH.QueryItem] + -> VikunjaRequest req contentType res accept +addQuery req query = req & L.over (rParamsL . paramsQueryL) (query P.++) + +addForm :: VikunjaRequest req contentType res accept -> WH.Form -> VikunjaRequest req contentType res accept +addForm req newform = + let form = case paramsBody (rParams req) of + ParamBodyFormUrlEncoded _form -> _form + _ -> mempty + in req & L.set (rParamsL . paramsBodyL) (ParamBodyFormUrlEncoded (newform <> form)) + +_addMultiFormPart :: VikunjaRequest req contentType res accept -> NH.Part -> VikunjaRequest req contentType res accept +_addMultiFormPart req newpart = + let parts = case paramsBody (rParams req) of + ParamBodyMultipartFormData _parts -> _parts + _ -> [] + in req & L.set (rParamsL . paramsBodyL) (ParamBodyMultipartFormData (newpart : parts)) + +_setBodyBS :: VikunjaRequest req contentType res accept -> B.ByteString -> VikunjaRequest req contentType res accept +_setBodyBS req body = + req & L.set (rParamsL . paramsBodyL) (ParamBodyB body) + +_setBodyLBS :: VikunjaRequest req contentType res accept -> BL.ByteString -> VikunjaRequest req contentType res accept +_setBodyLBS req body = + req & L.set (rParamsL . paramsBodyL) (ParamBodyBL body) + +_hasAuthType :: AuthMethod authMethod => VikunjaRequest req contentType res accept -> P.Proxy authMethod -> VikunjaRequest req contentType res accept +_hasAuthType req proxy = + req & L.over rAuthTypesL (P.typeRep proxy :) + +-- ** Params Utils + +toPath + :: WH.ToHttpApiData a + => a -> BCL.ByteString +toPath = BB.toLazyByteString . WH.toEncodedUrlPiece + +toHeader :: WH.ToHttpApiData a => (NH.HeaderName, a) -> [NH.Header] +toHeader x = [fmap WH.toHeader x] + +toForm :: WH.ToHttpApiData v => (BC.ByteString, v) -> WH.Form +toForm (k,v) = WH.toForm [(BC.unpack k,v)] + +toQuery :: WH.ToHttpApiData a => (BC.ByteString, Maybe a) -> [NH.QueryItem] +toQuery x = [(fmap . fmap) toQueryParam x] + where toQueryParam = T.encodeUtf8 . WH.toQueryParam + +toPartialEscapeQuery :: B.ByteString -> NH.Query -> NH.PartialEscapeQuery +toPartialEscapeQuery extraUnreserved query = fmap (\(k, v) -> (k, maybe [] go v)) query + where go :: B.ByteString -> [NH.EscapeItem] + go v = v & B.groupBy (\a b -> a `B.notElem` extraUnreserved && b `B.notElem` extraUnreserved) + & fmap (\xs -> if B.null xs then NH.QN xs + else if B.head xs `B.elem` extraUnreserved + then NH.QN xs -- Not Encoded + else NH.QE xs -- Encoded + ) + +-- *** OpenAPI `CollectionFormat` Utils + +-- | Determines the format of the array if type array is used. +data CollectionFormat + = CommaSeparated -- ^ CSV format for multiple parameters. + | SpaceSeparated -- ^ Also called "SSV" + | TabSeparated -- ^ Also called "TSV" + | PipeSeparated -- ^ `value1|value2|value2` + | MultiParamArray -- ^ Using multiple GET parameters, e.g. `foo=bar&foo=baz`. This is valid only for parameters in "query" ('NH.Query') or "formData" ('WH.Form') + +toHeaderColl :: WH.ToHttpApiData a => CollectionFormat -> (NH.HeaderName, [a]) -> [NH.Header] +toHeaderColl c xs = _toColl c toHeader xs + +toFormColl :: WH.ToHttpApiData v => CollectionFormat -> (BC.ByteString, [v]) -> WH.Form +toFormColl c xs = WH.toForm $ fmap unpack $ _toColl c toHeader $ pack xs + where + pack (k,v) = (CI.mk k, v) + unpack (k,v) = (BC.unpack (CI.original k), BC.unpack v) + +toQueryColl :: WH.ToHttpApiData a => CollectionFormat -> (BC.ByteString, Maybe [a]) -> NH.Query +toQueryColl c xs = _toCollA c toQuery xs + +_toColl :: P.Traversable f => CollectionFormat -> (f a -> [(b, BC.ByteString)]) -> f [a] -> [(b, BC.ByteString)] +_toColl c encode xs = fmap (fmap P.fromJust) (_toCollA' c fencode BC.singleton (fmap Just xs)) + where fencode = fmap (fmap Just) . encode . fmap P.fromJust + {-# INLINE fencode #-} + +_toCollA :: (P.Traversable f, P.Traversable t, P.Alternative t) => CollectionFormat -> (f (t a) -> [(b, t BC.ByteString)]) -> f (t [a]) -> [(b, t BC.ByteString)] +_toCollA c encode xs = _toCollA' c encode BC.singleton xs + +_toCollA' :: (P.Monoid c, P.Traversable f, P.Traversable t, P.Alternative t) => CollectionFormat -> (f (t a) -> [(b, t c)]) -> (Char -> c) -> f (t [a]) -> [(b, t c)] +_toCollA' c encode one xs = case c of + CommaSeparated -> go (one ',') + SpaceSeparated -> go (one ' ') + TabSeparated -> go (one '\t') + PipeSeparated -> go (one '|') + MultiParamArray -> expandList + where + go sep = + [P.foldl1 (\(sk, sv) (_, v) -> (sk, (combine sep <$> sv <*> v) <|> sv <|> v)) expandList] + combine sep x y = x <> sep <> y + expandList = (P.concatMap encode . (P.traverse . P.traverse) P.toList) xs + {-# INLINE go #-} + {-# INLINE expandList #-} + {-# INLINE combine #-} + +-- * AuthMethods + +-- | Provides a method to apply auth methods to requests +class P.Typeable a => + AuthMethod a where + applyAuthMethod + :: VikunjaConfig + -> a + -> VikunjaRequest req contentType res accept + -> IO (VikunjaRequest req contentType res accept) + +-- | An existential wrapper for any AuthMethod +data AnyAuthMethod = forall a. AuthMethod a => AnyAuthMethod a deriving (P.Typeable) + +instance AuthMethod AnyAuthMethod where applyAuthMethod config (AnyAuthMethod a) req = applyAuthMethod config a req + +-- | indicates exceptions related to AuthMethods +data AuthMethodException = AuthMethodException String deriving (P.Show, P.Typeable) + +instance E.Exception AuthMethodException + +-- | apply all matching AuthMethods in config to request +_applyAuthMethods + :: VikunjaRequest req contentType res accept + -> VikunjaConfig + -> IO (VikunjaRequest req contentType res accept) +_applyAuthMethods req config@(VikunjaConfig {configAuthMethods = as}) = + foldlM go req as + where + go r (AnyAuthMethod a) = applyAuthMethod config a r + +-- * Utils + +-- | Removes Null fields. (OpenAPI-Specification 2.0 does not allow Null in JSON) +#if MIN_VERSION_aeson(2,0,0) +_omitNulls :: [(A.Key, A.Value)] -> A.Value +#else +_omitNulls :: [(Text, A.Value)] -> A.Value +#endif +_omitNulls = A.object . P.filter notNull + where + notNull (_, A.Null) = False + notNull _ = True + +-- | Encodes fields using WH.toQueryParam +_toFormItem :: (WH.ToHttpApiData a, Functor f) => t -> f a -> f (t, [Text]) +_toFormItem name x = (name,) . (:[]) . WH.toQueryParam <$> x + +-- | Collapse (Just "") to Nothing +_emptyToNothing :: Maybe String -> Maybe String +_emptyToNothing (Just "") = Nothing +_emptyToNothing x = x +{-# INLINE _emptyToNothing #-} + +-- | Collapse (Just mempty) to Nothing +_memptyToNothing :: (P.Monoid a, P.Eq a) => Maybe a -> Maybe a +_memptyToNothing (Just x) | x P.== P.mempty = Nothing +_memptyToNothing x = x +{-# INLINE _memptyToNothing #-} + +-- * DateTime Formatting + +newtype DateTime = DateTime { unDateTime :: TI.UTCTime } + deriving (P.Eq,P.Data,P.Ord,P.Typeable,NF.NFData) +instance A.FromJSON DateTime where + parseJSON = A.withText "DateTime" (_readDateTime . T.unpack) +instance A.ToJSON DateTime where + toJSON (DateTime t) = A.toJSON (_showDateTime t) +instance WH.FromHttpApiData DateTime where + parseUrlPiece = P.maybe (P.Left "parseUrlPiece @DateTime") P.Right . _readDateTime . T.unpack +instance WH.ToHttpApiData DateTime where + toUrlPiece (DateTime t) = T.pack (_showDateTime t) +instance P.Show DateTime where + show (DateTime t) = _showDateTime t +instance MimeRender MimeMultipartFormData DateTime where + mimeRender _ = mimeRenderDefaultMultipartFormData + +-- | @_parseISO8601@ +_readDateTime :: (MonadFail m, Alternative m) => String -> m DateTime +_readDateTime s = + DateTime <$> _parseISO8601 s +{-# INLINE _readDateTime #-} + +-- | @TI.formatISO8601Millis@ +_showDateTime :: (t ~ TI.UTCTime, TI.FormatTime t) => t -> String +_showDateTime = + TI.formatISO8601Millis +{-# INLINE _showDateTime #-} + +-- | parse an ISO8601 date-time string +_parseISO8601 :: (TI.ParseTime t, MonadFail m, Alternative m) => String -> m t +_parseISO8601 t = + P.asum $ + P.flip (TI.parseTimeM True TI.defaultTimeLocale) t <$> + ["%FT%T%QZ", "%FT%T%Q%z", "%FT%T%Q%Z"] +{-# INLINE _parseISO8601 #-} + +-- * Date Formatting + +newtype Date = Date { unDate :: TI.Day } + deriving (P.Enum,P.Eq,P.Data,P.Ord,P.Ix,NF.NFData) +instance A.FromJSON Date where + parseJSON = A.withText "Date" (_readDate . T.unpack) +instance A.ToJSON Date where + toJSON (Date t) = A.toJSON (_showDate t) +instance WH.FromHttpApiData Date where + parseUrlPiece = P.maybe (P.Left "parseUrlPiece @Date") P.Right . _readDate . T.unpack +instance WH.ToHttpApiData Date where + toUrlPiece (Date t) = T.pack (_showDate t) +instance P.Show Date where + show (Date t) = _showDate t +instance MimeRender MimeMultipartFormData Date where + mimeRender _ = mimeRenderDefaultMultipartFormData + +-- | @TI.parseTimeM True TI.defaultTimeLocale "%Y-%m-%d"@ +_readDate :: MonadFail m => String -> m Date +_readDate s = Date <$> TI.parseTimeM True TI.defaultTimeLocale "%Y-%m-%d" s +{-# INLINE _readDate #-} + +-- | @TI.formatTime TI.defaultTimeLocale "%Y-%m-%d"@ +_showDate :: TI.FormatTime t => t -> String +_showDate = + TI.formatTime TI.defaultTimeLocale "%Y-%m-%d" +{-# INLINE _showDate #-} + +-- * Byte/Binary Formatting + + +-- | base64 encoded characters +newtype ByteArray = ByteArray { unByteArray :: BL.ByteString } + deriving (P.Eq,P.Data,P.Ord,P.Typeable,NF.NFData) + +instance A.FromJSON ByteArray where + parseJSON = A.withText "ByteArray" _readByteArray +instance A.ToJSON ByteArray where + toJSON = A.toJSON . _showByteArray +instance WH.FromHttpApiData ByteArray where + parseUrlPiece = P.maybe (P.Left "parseUrlPiece @ByteArray") P.Right . _readByteArray +instance WH.ToHttpApiData ByteArray where + toUrlPiece = _showByteArray +instance P.Show ByteArray where + show = T.unpack . _showByteArray +instance MimeRender MimeMultipartFormData ByteArray where + mimeRender _ = mimeRenderDefaultMultipartFormData + +-- | read base64 encoded characters +_readByteArray :: MonadFail m => Text -> m ByteArray +_readByteArray = P.either P.fail (pure . ByteArray) . BL64.decode . BL.fromStrict . T.encodeUtf8 +{-# INLINE _readByteArray #-} + +-- | show base64 encoded characters +_showByteArray :: ByteArray -> Text +_showByteArray = T.decodeUtf8 . BL.toStrict . BL64.encode . unByteArray +{-# INLINE _showByteArray #-} + +-- | any sequence of octets +newtype Binary = Binary { unBinary :: BL.ByteString } + deriving (P.Eq,P.Data,P.Ord,P.Typeable,NF.NFData) + +instance A.FromJSON Binary where + parseJSON = A.withText "Binary" _readBinaryBase64 +instance A.ToJSON Binary where + toJSON = A.toJSON . _showBinaryBase64 +instance WH.FromHttpApiData Binary where + parseUrlPiece = P.maybe (P.Left "parseUrlPiece @Binary") P.Right . _readBinaryBase64 +instance WH.ToHttpApiData Binary where + toUrlPiece = _showBinaryBase64 +instance P.Show Binary where + show = T.unpack . _showBinaryBase64 +instance MimeRender MimeMultipartFormData Binary where + mimeRender _ = unBinary + +_readBinaryBase64 :: MonadFail m => Text -> m Binary +_readBinaryBase64 = P.either P.fail (pure . Binary) . BL64.decode . BL.fromStrict . T.encodeUtf8 +{-# INLINE _readBinaryBase64 #-} + +_showBinaryBase64 :: Binary -> Text +_showBinaryBase64 = T.decodeUtf8 . BL.toStrict . BL64.encode . unBinary +{-# INLINE _showBinaryBase64 #-} + +-- * Lens Type Aliases + +type Lens_' s a = Lens_ s s a a +type Lens_ s t a b = forall (f :: K.Type -> K.Type). Functor f => (a -> f b) -> s -> f t diff --git a/lib/Vikunja/Logging.hs b/lib/Vikunja/Logging.hs new file mode 100644 index 0000000..65f72b2 --- /dev/null +++ b/lib/Vikunja/Logging.hs @@ -0,0 +1,34 @@ +{- + Vikunja API + + # Pagination Every endpoint capable of pagination will return two headers: * `x-pagination-total-pages`: The total number of available pages for this request * `x-pagination-result-count`: The number of items returned for this request. # Rights All endpoints which return a single item (project, task, etc.) - no array - will also return a `x-max-right` header with the max right the user has on this item as an int where `0` is `Read Only`, `1` is `Read & Write` and `2` is `Admin`. This can be used to show or hide ui elements based on the rights the user has. # Errors All errors have an error code and a human-readable error message in addition to the http status code. You should always check for the status code in the response, not only the http status code. Due to limitations in the swagger library we're using for this document, only one error per http status code is documented here. Make sure to check the [error docs](https://vikunja.io/docs/errors/) in Vikunja's documentation for a full list of available error codes. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **API Token:** You can create scoped API tokens for your user and use the token to make authenticated requests in the context of that user. The token must be provided via an `Authorization: Bearer ` header, similar to jwt auth. See the documentation for the `api` group to manage token creation and revocation. **BasicAuth:** Only used when requesting tasks via CalDAV. + + OpenAPI Version: 3.0.1 + Vikunja API API version: 0.24.6 + Contact: hello@vikunja.io + Generated by OpenAPI Generator (https://openapi-generator.tech) +-} + +{-| +Module : Vikunja.Logging +Logging functions +-} +{-# LANGUAGE CPP #-} + +#ifdef USE_KATIP + +module Vikunja.Logging + ( module Vikunja.LoggingKatip + ) where + +import Vikunja.LoggingKatip + +#else + +module Vikunja.Logging + ( module Vikunja.LoggingMonadLogger + ) where + +import Vikunja.LoggingMonadLogger + +#endif diff --git a/lib/Vikunja/LoggingKatip.hs b/lib/Vikunja/LoggingKatip.hs new file mode 100644 index 0000000..9947fd2 --- /dev/null +++ b/lib/Vikunja/LoggingKatip.hs @@ -0,0 +1,118 @@ +{- + Vikunja API + + # Pagination Every endpoint capable of pagination will return two headers: * `x-pagination-total-pages`: The total number of available pages for this request * `x-pagination-result-count`: The number of items returned for this request. # Rights All endpoints which return a single item (project, task, etc.) - no array - will also return a `x-max-right` header with the max right the user has on this item as an int where `0` is `Read Only`, `1` is `Read & Write` and `2` is `Admin`. This can be used to show or hide ui elements based on the rights the user has. # Errors All errors have an error code and a human-readable error message in addition to the http status code. You should always check for the status code in the response, not only the http status code. Due to limitations in the swagger library we're using for this document, only one error per http status code is documented here. Make sure to check the [error docs](https://vikunja.io/docs/errors/) in Vikunja's documentation for a full list of available error codes. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **API Token:** You can create scoped API tokens for your user and use the token to make authenticated requests in the context of that user. The token must be provided via an `Authorization: Bearer ` header, similar to jwt auth. See the documentation for the `api` group to manage token creation and revocation. **BasicAuth:** Only used when requesting tasks via CalDAV. + + OpenAPI Version: 3.0.1 + Vikunja API API version: 0.24.6 + Contact: hello@vikunja.io + Generated by OpenAPI Generator (https://openapi-generator.tech) +-} + +{-| +Module : Vikunja.LoggingKatip +Katip Logging functions +-} + +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE RankNTypes #-} +{-# LANGUAGE ScopedTypeVariables #-} + +module Vikunja.LoggingKatip where + +import qualified Control.Exception.Safe as E +import qualified Control.Monad.IO.Class as P +import qualified Control.Monad.Trans.Reader as P +import qualified Data.Text as T +import qualified Lens.Micro as L +import qualified System.IO as IO + +import Data.Text (Text) +import GHC.Exts (IsString(..)) + +import qualified Katip as LG + +-- * Type Aliases (for compatibility) + +-- | Runs a Katip logging block with the Log environment +type LogExecWithContext = forall m a. P.MonadIO m => + LogContext -> LogExec m a + +-- | A Katip logging block +type LogExec m a = LG.KatipT m a -> m a + +-- | A Katip Log environment +type LogContext = LG.LogEnv + +-- | A Katip Log severity +type LogLevel = LG.Severity + +-- * default logger + +-- | the default log environment +initLogContext :: IO LogContext +initLogContext = LG.initLogEnv "Vikunja" "dev" + +-- | Runs a Katip logging block with the Log environment +runDefaultLogExecWithContext :: LogExecWithContext +runDefaultLogExecWithContext = LG.runKatipT + +-- * stdout logger + +-- | Runs a Katip logging block with the Log environment +stdoutLoggingExec :: LogExecWithContext +stdoutLoggingExec = runDefaultLogExecWithContext + +-- | A Katip Log environment which targets stdout +stdoutLoggingContext :: LogContext -> IO LogContext +stdoutLoggingContext cxt = do + handleScribe <- LG.mkHandleScribe LG.ColorIfTerminal IO.stdout (LG.permitItem LG.InfoS) LG.V2 + LG.registerScribe "stdout" handleScribe LG.defaultScribeSettings cxt + +-- * stderr logger + +-- | Runs a Katip logging block with the Log environment +stderrLoggingExec :: LogExecWithContext +stderrLoggingExec = runDefaultLogExecWithContext + +-- | A Katip Log environment which targets stderr +stderrLoggingContext :: LogContext -> IO LogContext +stderrLoggingContext cxt = do + handleScribe <- LG.mkHandleScribe LG.ColorIfTerminal IO.stderr (LG.permitItem LG.InfoS) LG.V2 + LG.registerScribe "stderr" handleScribe LG.defaultScribeSettings cxt + +-- * Null logger + +-- | Disables Katip logging +runNullLogExec :: LogExecWithContext +runNullLogExec le (LG.KatipT f) = P.runReaderT f (L.set LG.logEnvScribes mempty le) + +-- * Log Msg + +-- | Log a katip message +_log :: (Applicative m, LG.Katip m) => Text -> LogLevel -> Text -> m () +_log src level msg = do + LG.logMsg (fromString $ T.unpack src) level (LG.logStr msg) + +-- * Log Exceptions + +-- | re-throws exceptions after logging them +logExceptions + :: (LG.Katip m, E.MonadCatch m, Applicative m) + => Text -> m a -> m a +logExceptions src = + E.handle + (\(e :: E.SomeException) -> do + _log src LG.ErrorS ((T.pack . show) e) + E.throw e) + +-- * Log Level + +levelInfo :: LogLevel +levelInfo = LG.InfoS + +levelError :: LogLevel +levelError = LG.ErrorS + +levelDebug :: LogLevel +levelDebug = LG.DebugS diff --git a/lib/Vikunja/LoggingMonadLogger.hs b/lib/Vikunja/LoggingMonadLogger.hs new file mode 100644 index 0000000..35194de --- /dev/null +++ b/lib/Vikunja/LoggingMonadLogger.hs @@ -0,0 +1,127 @@ +{- + Vikunja API + + # Pagination Every endpoint capable of pagination will return two headers: * `x-pagination-total-pages`: The total number of available pages for this request * `x-pagination-result-count`: The number of items returned for this request. # Rights All endpoints which return a single item (project, task, etc.) - no array - will also return a `x-max-right` header with the max right the user has on this item as an int where `0` is `Read Only`, `1` is `Read & Write` and `2` is `Admin`. This can be used to show or hide ui elements based on the rights the user has. # Errors All errors have an error code and a human-readable error message in addition to the http status code. You should always check for the status code in the response, not only the http status code. Due to limitations in the swagger library we're using for this document, only one error per http status code is documented here. Make sure to check the [error docs](https://vikunja.io/docs/errors/) in Vikunja's documentation for a full list of available error codes. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **API Token:** You can create scoped API tokens for your user and use the token to make authenticated requests in the context of that user. The token must be provided via an `Authorization: Bearer ` header, similar to jwt auth. See the documentation for the `api` group to manage token creation and revocation. **BasicAuth:** Only used when requesting tasks via CalDAV. + + OpenAPI Version: 3.0.1 + Vikunja API API version: 0.24.6 + Contact: hello@vikunja.io + Generated by OpenAPI Generator (https://openapi-generator.tech) +-} + +{-| +Module : Vikunja.LoggingMonadLogger +monad-logger Logging functions +-} + +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE RankNTypes #-} +{-# LANGUAGE ScopedTypeVariables #-} + +module Vikunja.LoggingMonadLogger where + +import qualified Control.Exception.Safe as E +import qualified Control.Monad.IO.Class as P +import qualified Data.Text as T +import qualified Data.Time as TI + +import Data.Text (Text) + +import qualified Control.Monad.Logger as LG + +-- * Type Aliases (for compatibility) + +-- | Runs a monad-logger block with the filter predicate +type LogExecWithContext = forall m a. P.MonadIO m => + LogContext -> LogExec m a + +-- | A monad-logger block +type LogExec m a = LG.LoggingT m a -> m a + +-- | A monad-logger filter predicate +type LogContext = LG.LogSource -> LG.LogLevel -> Bool + +-- | A monad-logger log level +type LogLevel = LG.LogLevel + +-- * default logger + +-- | the default log environment +initLogContext :: IO LogContext +initLogContext = pure infoLevelFilter + +-- | Runs a monad-logger block with the filter predicate +runDefaultLogExecWithContext :: LogExecWithContext +runDefaultLogExecWithContext = runNullLogExec + +-- * stdout logger + +-- | Runs a monad-logger block targeting stdout, with the filter predicate +stdoutLoggingExec :: LogExecWithContext +stdoutLoggingExec cxt = LG.runStdoutLoggingT . LG.filterLogger cxt + +-- | @pure@ +stdoutLoggingContext :: LogContext -> IO LogContext +stdoutLoggingContext = pure + +-- * stderr logger + +-- | Runs a monad-logger block targeting stderr, with the filter predicate +stderrLoggingExec :: LogExecWithContext +stderrLoggingExec cxt = LG.runStderrLoggingT . LG.filterLogger cxt + +-- | @pure@ +stderrLoggingContext :: LogContext -> IO LogContext +stderrLoggingContext = pure + +-- * Null logger + +-- | Disables monad-logger logging +runNullLogExec :: LogExecWithContext +runNullLogExec = const (`LG.runLoggingT` nullLogger) + +-- | monad-logger which does nothing +nullLogger :: LG.Loc -> LG.LogSource -> LG.LogLevel -> LG.LogStr -> IO () +nullLogger _ _ _ _ = return () + +-- * Log Msg + +-- | Log a message using the current time +_log :: (P.MonadIO m, LG.MonadLogger m) => Text -> LG.LogLevel -> Text -> m () +_log src level msg = do + now <- P.liftIO (formatTimeLog <$> TI.getCurrentTime) + LG.logOtherNS ("Vikunja." <> src) level ("[" <> now <> "] " <> msg) + where + formatTimeLog = + T.pack . TI.formatTime TI.defaultTimeLocale "%Y-%m-%dT%H:%M:%S%Z" + +-- * Log Exceptions + +-- | re-throws exceptions after logging them +logExceptions + :: (LG.MonadLogger m, E.MonadCatch m, P.MonadIO m) + => Text -> m a -> m a +logExceptions src = + E.handle + (\(e :: E.SomeException) -> do + _log src LG.LevelError ((T.pack . show) e) + E.throw e) + +-- * Log Level + +levelInfo :: LogLevel +levelInfo = LG.LevelInfo + +levelError :: LogLevel +levelError = LG.LevelError + +levelDebug :: LogLevel +levelDebug = LG.LevelDebug + +-- * Level Filter + +minLevelFilter :: LG.LogLevel -> LG.LogSource -> LG.LogLevel -> Bool +minLevelFilter l _ l' = l' >= l + +infoLevelFilter :: LG.LogSource -> LG.LogLevel -> Bool +infoLevelFilter = minLevelFilter LG.LevelInfo diff --git a/lib/Vikunja/MimeTypes.hs b/lib/Vikunja/MimeTypes.hs new file mode 100644 index 0000000..15d3b7c --- /dev/null +++ b/lib/Vikunja/MimeTypes.hs @@ -0,0 +1,204 @@ +{- + Vikunja API + + # Pagination Every endpoint capable of pagination will return two headers: * `x-pagination-total-pages`: The total number of available pages for this request * `x-pagination-result-count`: The number of items returned for this request. # Rights All endpoints which return a single item (project, task, etc.) - no array - will also return a `x-max-right` header with the max right the user has on this item as an int where `0` is `Read Only`, `1` is `Read & Write` and `2` is `Admin`. This can be used to show or hide ui elements based on the rights the user has. # Errors All errors have an error code and a human-readable error message in addition to the http status code. You should always check for the status code in the response, not only the http status code. Due to limitations in the swagger library we're using for this document, only one error per http status code is documented here. Make sure to check the [error docs](https://vikunja.io/docs/errors/) in Vikunja's documentation for a full list of available error codes. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **API Token:** You can create scoped API tokens for your user and use the token to make authenticated requests in the context of that user. The token must be provided via an `Authorization: Bearer ` header, similar to jwt auth. See the documentation for the `api` group to manage token creation and revocation. **BasicAuth:** Only used when requesting tasks via CalDAV. + + OpenAPI Version: 3.0.1 + Vikunja API API version: 0.24.6 + Contact: hello@vikunja.io + Generated by OpenAPI Generator (https://openapi-generator.tech) +-} + +{-| +Module : Vikunja.MimeTypes +-} + +{-# LANGUAGE ConstraintKinds #-} +{-# LANGUAGE ExistentialQuantification #-} +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE ScopedTypeVariables #-} +{-# OPTIONS_GHC -fno-warn-unused-binds -fno-warn-unused-imports #-} + +module Vikunja.MimeTypes where + +import qualified Control.Arrow as P (left) +import qualified Data.Aeson as A +import qualified Data.ByteString as B +import qualified Data.ByteString.Builder as BB +import qualified Data.ByteString.Char8 as BC +import qualified Data.ByteString.Lazy as BL +import qualified Data.ByteString.Lazy.Char8 as BCL +import qualified Data.Data as P (Typeable) +import qualified Data.Proxy as P (Proxy(..)) +import qualified Data.String as P +import qualified Data.Text as T +import qualified Data.Text.Encoding as T +import qualified Network.HTTP.Media as ME +import qualified Web.FormUrlEncoded as WH +import qualified Web.HttpApiData as WH + +import Prelude (($), (.),(<$>),(<*>),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty) +import qualified Prelude as P + +-- * ContentType MimeType + +data ContentType a = MimeType a => ContentType { unContentType :: a } + +-- * Accept MimeType + +data Accept a = MimeType a => Accept { unAccept :: a } + +-- * Consumes Class + +class MimeType mtype => Consumes req mtype where + +-- * Produces Class + +class MimeType mtype => Produces req mtype where + +-- * Default Mime Types + +data MimeJSON = MimeJSON deriving (P.Typeable) +data MimeXML = MimeXML deriving (P.Typeable) +data MimePlainText = MimePlainText deriving (P.Typeable) +data MimeFormUrlEncoded = MimeFormUrlEncoded deriving (P.Typeable) +data MimeMultipartFormData = MimeMultipartFormData deriving (P.Typeable) +data MimeOctetStream = MimeOctetStream deriving (P.Typeable) +data MimeNoContent = MimeNoContent deriving (P.Typeable) +data MimeAny = MimeAny deriving (P.Typeable) + +-- | A type for responses without content-body. +data NoContent = NoContent + deriving (P.Show, P.Eq, P.Typeable) + + +-- * MimeType Class + +class P.Typeable mtype => MimeType mtype where + {-# MINIMAL mimeType | mimeTypes #-} + + mimeTypes :: P.Proxy mtype -> [ME.MediaType] + mimeTypes p = + case mimeType p of + Just x -> [x] + Nothing -> [] + + mimeType :: P.Proxy mtype -> Maybe ME.MediaType + mimeType p = + case mimeTypes p of + [] -> Nothing + (x:_) -> Just x + + mimeType' :: mtype -> Maybe ME.MediaType + mimeType' _ = mimeType (P.Proxy :: P.Proxy mtype) + mimeTypes' :: mtype -> [ME.MediaType] + mimeTypes' _ = mimeTypes (P.Proxy :: P.Proxy mtype) + +-- Default MimeType Instances + +-- | @application/json; charset=utf-8@ +instance MimeType MimeJSON where + mimeType _ = Just $ P.fromString "application/json" +-- | @application/xml; charset=utf-8@ +instance MimeType MimeXML where + mimeType _ = Just $ P.fromString "application/xml" +-- | @application/x-www-form-urlencoded@ +instance MimeType MimeFormUrlEncoded where + mimeType _ = Just $ P.fromString "application/x-www-form-urlencoded" +-- | @multipart/form-data@ +instance MimeType MimeMultipartFormData where + mimeType _ = Just $ P.fromString "multipart/form-data" +-- | @text/plain; charset=utf-8@ +instance MimeType MimePlainText where + mimeType _ = Just $ P.fromString "text/plain" +-- | @application/octet-stream@ +instance MimeType MimeOctetStream where + mimeType _ = Just $ P.fromString "application/octet-stream" +-- | @"*/*"@ +instance MimeType MimeAny where + mimeType _ = Just $ P.fromString "*/*" +instance MimeType MimeNoContent where + mimeType _ = Nothing + +-- * MimeRender Class + +class MimeType mtype => MimeRender mtype x where + mimeRender :: P.Proxy mtype -> x -> BL.ByteString + mimeRender' :: mtype -> x -> BL.ByteString + mimeRender' _ x = mimeRender (P.Proxy :: P.Proxy mtype) x + + +mimeRenderDefaultMultipartFormData :: WH.ToHttpApiData a => a -> BL.ByteString +mimeRenderDefaultMultipartFormData = BL.fromStrict . T.encodeUtf8 . WH.toQueryParam + +-- Default MimeRender Instances + +-- | `A.encode` +instance A.ToJSON a => MimeRender MimeJSON a where mimeRender _ = A.encode +-- | @WH.urlEncodeAsForm@ +instance WH.ToForm a => MimeRender MimeFormUrlEncoded a where mimeRender _ = WH.urlEncodeAsForm + +-- | @P.id@ +instance MimeRender MimePlainText BL.ByteString where mimeRender _ = P.id +-- | @BL.fromStrict . T.encodeUtf8@ +instance MimeRender MimePlainText T.Text where mimeRender _ = BL.fromStrict . T.encodeUtf8 +-- | @BCL.pack@ +instance MimeRender MimePlainText String where mimeRender _ = BCL.pack + +-- | @P.id@ +instance MimeRender MimeOctetStream BL.ByteString where mimeRender _ = P.id +-- | @BL.fromStrict . T.encodeUtf8@ +instance MimeRender MimeOctetStream T.Text where mimeRender _ = BL.fromStrict . T.encodeUtf8 +-- | @BCL.pack@ +instance MimeRender MimeOctetStream String where mimeRender _ = BCL.pack + +instance MimeRender MimeMultipartFormData BL.ByteString where mimeRender _ = P.id + +instance MimeRender MimeMultipartFormData Bool where mimeRender _ = mimeRenderDefaultMultipartFormData +instance MimeRender MimeMultipartFormData Char where mimeRender _ = mimeRenderDefaultMultipartFormData +instance MimeRender MimeMultipartFormData Double where mimeRender _ = mimeRenderDefaultMultipartFormData +instance MimeRender MimeMultipartFormData Float where mimeRender _ = mimeRenderDefaultMultipartFormData +instance MimeRender MimeMultipartFormData Int where mimeRender _ = mimeRenderDefaultMultipartFormData +instance MimeRender MimeMultipartFormData Integer where mimeRender _ = mimeRenderDefaultMultipartFormData +instance MimeRender MimeMultipartFormData String where mimeRender _ = mimeRenderDefaultMultipartFormData +instance MimeRender MimeMultipartFormData T.Text where mimeRender _ = mimeRenderDefaultMultipartFormData + +-- | @P.Right . P.const NoContent@ +instance MimeRender MimeNoContent NoContent where mimeRender _ = P.const BCL.empty + + +-- * MimeUnrender Class + +class MimeType mtype => MimeUnrender mtype o where + mimeUnrender :: P.Proxy mtype -> BL.ByteString -> P.Either String o + mimeUnrender' :: mtype -> BL.ByteString -> P.Either String o + mimeUnrender' _ x = mimeUnrender (P.Proxy :: P.Proxy mtype) x + +-- Default MimeUnrender Instances + +-- | @A.eitherDecode@ +instance A.FromJSON a => MimeUnrender MimeJSON a where mimeUnrender _ = A.eitherDecode +-- | @P.left T.unpack . WH.urlDecodeAsForm@ +instance WH.FromForm a => MimeUnrender MimeFormUrlEncoded a where mimeUnrender _ = P.left T.unpack . WH.urlDecodeAsForm +-- | @P.Right . P.id@ + +instance MimeUnrender MimePlainText BL.ByteString where mimeUnrender _ = P.Right . P.id +-- | @P.left P.show . TL.decodeUtf8'@ +instance MimeUnrender MimePlainText T.Text where mimeUnrender _ = P.left P.show . T.decodeUtf8' . BL.toStrict +-- | @P.Right . BCL.unpack@ +instance MimeUnrender MimePlainText String where mimeUnrender _ = P.Right . BCL.unpack + +-- | @P.Right . P.id@ +instance MimeUnrender MimeOctetStream BL.ByteString where mimeUnrender _ = P.Right . P.id +-- | @P.left P.show . T.decodeUtf8' . BL.toStrict@ +instance MimeUnrender MimeOctetStream T.Text where mimeUnrender _ = P.left P.show . T.decodeUtf8' . BL.toStrict +-- | @P.Right . BCL.unpack@ +instance MimeUnrender MimeOctetStream String where mimeUnrender _ = P.Right . BCL.unpack + +-- | @P.Right . P.const NoContent@ +instance MimeUnrender MimeNoContent NoContent where mimeUnrender _ = P.Right . P.const NoContent + + diff --git a/lib/Vikunja/Model.hs b/lib/Vikunja/Model.hs new file mode 100644 index 0000000..d6ba55d --- /dev/null +++ b/lib/Vikunja/Model.hs @@ -0,0 +1,4264 @@ +{- + Vikunja API + + # Pagination Every endpoint capable of pagination will return two headers: * `x-pagination-total-pages`: The total number of available pages for this request * `x-pagination-result-count`: The number of items returned for this request. # Rights All endpoints which return a single item (project, task, etc.) - no array - will also return a `x-max-right` header with the max right the user has on this item as an int where `0` is `Read Only`, `1` is `Read & Write` and `2` is `Admin`. This can be used to show or hide ui elements based on the rights the user has. # Errors All errors have an error code and a human-readable error message in addition to the http status code. You should always check for the status code in the response, not only the http status code. Due to limitations in the swagger library we're using for this document, only one error per http status code is documented here. Make sure to check the [error docs](https://vikunja.io/docs/errors/) in Vikunja's documentation for a full list of available error codes. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **API Token:** You can create scoped API tokens for your user and use the token to make authenticated requests in the context of that user. The token must be provided via an `Authorization: Bearer ` header, similar to jwt auth. See the documentation for the `api` group to manage token creation and revocation. **BasicAuth:** Only used when requesting tasks via CalDAV. + + OpenAPI Version: 3.0.1 + Vikunja API API version: 0.24.6 + Contact: hello@vikunja.io + Generated by OpenAPI Generator (https://openapi-generator.tech) +-} + +{-| +Module : Vikunja.Model +-} + +{-# LANGUAGE DeriveDataTypeable #-} +{-# LANGUAGE DeriveFoldable #-} +{-# LANGUAGE DeriveGeneric #-} +{-# LANGUAGE DeriveTraversable #-} +{-# LANGUAGE GeneralizedNewtypeDeriving #-} +{-# LANGUAGE LambdaCase #-} +{-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE NamedFieldPuns #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE RecordWildCards #-} +{-# LANGUAGE TupleSections #-} +{-# LANGUAGE TypeFamilies #-} +{-# OPTIONS_GHC -fno-warn-unused-matches -fno-warn-unused-binds -fno-warn-unused-imports #-} + +module Vikunja.Model where + +import Vikunja.Core +import Vikunja.MimeTypes + +import Data.Aeson ((.:),(.:!),(.:?),(.=)) + +import qualified Control.Arrow as P (left) +import qualified Data.Aeson as A +import qualified Data.ByteString as B +import qualified Data.ByteString.Base64 as B64 +import qualified Data.ByteString.Char8 as BC +import qualified Data.ByteString.Lazy as BL +import qualified Data.Data as P (Typeable, TypeRep, typeOf, typeRep) +import qualified Data.Foldable as P +import qualified Data.HashMap.Lazy as HM +import qualified Data.Map as Map +import qualified Data.Maybe as P +import qualified Data.Set as Set +import qualified Data.Text as T +import qualified Data.Text.Encoding as T +import qualified Data.Time as TI +import qualified Lens.Micro as L +import qualified Web.FormUrlEncoded as WH +import qualified Web.HttpApiData as WH + +import Control.Applicative ((<|>)) +import Control.Applicative (Alternative) +import Data.Function ((&)) +import Data.Monoid ((<>)) +import Data.Text (Text) +import Prelude (($),(/=),(.),(<$>),(<*>),(>>=),(=<<),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty,maybe,pure,Monad,Applicative,Functor) + +import qualified Prelude as P + + + +-- * Parameter newtypes + + +-- ** AttachmentId +newtype AttachmentId = AttachmentId { unAttachmentId :: Int } deriving (P.Eq, P.Show) + +-- ** Avatar +newtype Avatar = Avatar { unAvatar :: Text } deriving (P.Eq, P.Show) + +-- ** Background +newtype Background = Background { unBackground :: Text } deriving (P.Eq, P.Show) + +-- ** Bucket +newtype Bucket = Bucket { unBucket :: Int } deriving (P.Eq, P.Show) + +-- ** BucketId +newtype BucketId = BucketId { unBucketId :: Int } deriving (P.Eq, P.Show) + +-- ** CommentId +newtype CommentId = CommentId { unCommentId :: Int } deriving (P.Eq, P.Show) + +-- ** Entity +newtype Entity = Entity { unEntity :: Text } deriving (P.Eq, P.Show) + +-- ** EntityId +newtype EntityId = EntityId { unEntityId :: Text } deriving (P.Eq, P.Show) + +-- ** Expand +newtype Expand = Expand { unExpand :: Text } deriving (P.Eq, P.Show) + +-- ** Files +newtype Files = Files { unFiles :: Text } deriving (P.Eq, P.Show) + +-- ** Filter +newtype Filter = Filter { unFilter :: Text } deriving (P.Eq, P.Show) + +-- ** FilterIncludeNulls +newtype FilterIncludeNulls = FilterIncludeNulls { unFilterIncludeNulls :: Text } deriving (P.Eq, P.Show) + +-- ** FilterTimezone +newtype FilterTimezone = FilterTimezone { unFilterTimezone :: Text } deriving (P.Eq, P.Show) + +-- ** Id +newtype Id = Id { unId :: Int } deriving (P.Eq, P.Show) + +-- ** Image +newtype Image = Image { unImage :: Int } deriving (P.Eq, P.Show) + +-- ** IsArchived +newtype IsArchived = IsArchived { unIsArchived :: Bool } deriving (P.Eq, P.Show) + +-- ** Kind +newtype Kind = Kind { unKind :: Int } deriving (P.Eq, P.Show) + +-- ** Label +newtype Label = Label { unLabel :: Int } deriving (P.Eq, P.Show) + +-- ** OrderBy +newtype OrderBy = OrderBy { unOrderBy :: Text } deriving (P.Eq, P.Show) + +-- ** OtherTaskId +newtype OtherTaskId = OtherTaskId { unOtherTaskId :: Int } deriving (P.Eq, P.Show) + +-- ** P +newtype P = P { unP :: Int } deriving (P.Eq, P.Show) + +-- ** Page +newtype Page = Page { unPage :: Int } deriving (P.Eq, P.Show) + +-- ** ParamImport +newtype ParamImport = ParamImport { unParamImport :: Text } deriving (P.Eq, P.Show) + +-- ** PerPage +newtype PerPage = PerPage { unPerPage :: Int } deriving (P.Eq, P.Show) + +-- ** PreviewSize +newtype PreviewSize = PreviewSize { unPreviewSize :: Text } deriving (P.Eq, P.Show) + +-- ** Project +newtype Project = Project { unProject :: Int } deriving (P.Eq, P.Show) + +-- ** ProjectId +newtype ProjectId = ProjectId { unProjectId :: Int } deriving (P.Eq, P.Show) + +-- ** Provider +newtype Provider = Provider { unProvider :: Int } deriving (P.Eq, P.Show) + +-- ** RelationKind +newtype RelationKind = RelationKind { unRelationKind :: Text } deriving (P.Eq, P.Show) + +-- ** S +newtype S = S { unS :: Text } deriving (P.Eq, P.Show) + +-- ** Share +newtype Share = Share { unShare :: Int } deriving (P.Eq, P.Show) + +-- ** ShareText +newtype ShareText = ShareText { unShareText :: Text } deriving (P.Eq, P.Show) + +-- ** Size +newtype Size = Size { unSize :: Int } deriving (P.Eq, P.Show) + +-- ** SortBy +newtype SortBy = SortBy { unSortBy :: Text } deriving (P.Eq, P.Show) + +-- ** Table +newtype Table = Table { unTable :: Text } deriving (P.Eq, P.Show) + +-- ** Task +newtype Task = Task { unTask :: Int } deriving (P.Eq, P.Show) + +-- ** TaskId +newtype TaskId = TaskId { unTaskId :: Int } deriving (P.Eq, P.Show) + +-- ** TeamId +newtype TeamId = TeamId { unTeamId :: Int } deriving (P.Eq, P.Show) + +-- ** TokenId +newtype TokenId = TokenId { unTokenId :: Int } deriving (P.Eq, P.Show) + +-- ** UserId +newtype UserId = UserId { unUserId :: Int } deriving (P.Eq, P.Show) + +-- ** Username +newtype Username = Username { unUsername :: Text } deriving (P.Eq, P.Show) + +-- ** View +newtype View = View { unView :: Int } deriving (P.Eq, P.Show) + +-- ** WebhookId +newtype WebhookId = WebhookId { unWebhookId :: Int } deriving (P.Eq, P.Show) + +-- * Models + + +-- ** AuthToken +-- | AuthToken +data AuthToken = AuthToken + { authTokenToken :: !(Maybe Text) -- ^ "token" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON AuthToken +instance A.FromJSON AuthToken where + parseJSON = A.withObject "AuthToken" $ \o -> + AuthToken + <$> (o .:? "token") + +-- | ToJSON AuthToken +instance A.ToJSON AuthToken where + toJSON AuthToken {..} = + _omitNulls + [ "token" .= authTokenToken + ] + + +-- | Construct a value of type 'AuthToken' (by applying it's required fields, if any) +mkAuthToken + :: AuthToken +mkAuthToken = + AuthToken + { authTokenToken = Nothing + } + +-- ** BackgroundImage +-- | BackgroundImage +data BackgroundImage = BackgroundImage + { backgroundImageBlurHash :: !(Maybe Text) -- ^ "blur_hash" + , backgroundImageId :: !(Maybe Text) -- ^ "id" + , backgroundImageInfo :: !(Maybe A.Value) -- ^ "info" - This can be used to supply extra information from an image provider to clients + , backgroundImageThumb :: !(Maybe Text) -- ^ "thumb" + , backgroundImageUrl :: !(Maybe Text) -- ^ "url" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON BackgroundImage +instance A.FromJSON BackgroundImage where + parseJSON = A.withObject "BackgroundImage" $ \o -> + BackgroundImage + <$> (o .:? "blur_hash") + <*> (o .:? "id") + <*> (o .:? "info") + <*> (o .:? "thumb") + <*> (o .:? "url") + +-- | ToJSON BackgroundImage +instance A.ToJSON BackgroundImage where + toJSON BackgroundImage {..} = + _omitNulls + [ "blur_hash" .= backgroundImageBlurHash + , "id" .= backgroundImageId + , "info" .= backgroundImageInfo + , "thumb" .= backgroundImageThumb + , "url" .= backgroundImageUrl + ] + + +-- | Construct a value of type 'BackgroundImage' (by applying it's required fields, if any) +mkBackgroundImage + :: BackgroundImage +mkBackgroundImage = + BackgroundImage + { backgroundImageBlurHash = Nothing + , backgroundImageId = Nothing + , backgroundImageInfo = Nothing + , backgroundImageThumb = Nothing + , backgroundImageUrl = Nothing + } + +-- ** FilesFile +-- | FilesFile +data FilesFile = FilesFile + { filesFileCreated :: !(Maybe Text) -- ^ "created" + , filesFileId :: !(Maybe Int) -- ^ "id" + , filesFileMime :: !(Maybe Text) -- ^ "mime" + , filesFileName :: !(Maybe Text) -- ^ "name" + , filesFileSize :: !(Maybe Int) -- ^ "size" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON FilesFile +instance A.FromJSON FilesFile where + parseJSON = A.withObject "FilesFile" $ \o -> + FilesFile + <$> (o .:? "created") + <*> (o .:? "id") + <*> (o .:? "mime") + <*> (o .:? "name") + <*> (o .:? "size") + +-- | ToJSON FilesFile +instance A.ToJSON FilesFile where + toJSON FilesFile {..} = + _omitNulls + [ "created" .= filesFileCreated + , "id" .= filesFileId + , "mime" .= filesFileMime + , "name" .= filesFileName + , "size" .= filesFileSize + ] + + +-- | Construct a value of type 'FilesFile' (by applying it's required fields, if any) +mkFilesFile + :: FilesFile +mkFilesFile = + FilesFile + { filesFileCreated = Nothing + , filesFileId = Nothing + , filesFileMime = Nothing + , filesFileName = Nothing + , filesFileSize = Nothing + } + +-- ** HandlerAuthURL +-- | HandlerAuthURL +data HandlerAuthURL = HandlerAuthURL + { handlerAuthURLUrl :: !(Maybe Text) -- ^ "url" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON HandlerAuthURL +instance A.FromJSON HandlerAuthURL where + parseJSON = A.withObject "HandlerAuthURL" $ \o -> + HandlerAuthURL + <$> (o .:? "url") + +-- | ToJSON HandlerAuthURL +instance A.ToJSON HandlerAuthURL where + toJSON HandlerAuthURL {..} = + _omitNulls + [ "url" .= handlerAuthURLUrl + ] + + +-- | Construct a value of type 'HandlerAuthURL' (by applying it's required fields, if any) +mkHandlerAuthURL + :: HandlerAuthURL +mkHandlerAuthURL = + HandlerAuthURL + { handlerAuthURLUrl = Nothing + } + +-- ** MicrosofttodoMigration +-- | MicrosofttodoMigration +data MicrosofttodoMigration = MicrosofttodoMigration + { microsofttodoMigrationCode :: !(Maybe Text) -- ^ "code" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON MicrosofttodoMigration +instance A.FromJSON MicrosofttodoMigration where + parseJSON = A.withObject "MicrosofttodoMigration" $ \o -> + MicrosofttodoMigration + <$> (o .:? "code") + +-- | ToJSON MicrosofttodoMigration +instance A.ToJSON MicrosofttodoMigration where + toJSON MicrosofttodoMigration {..} = + _omitNulls + [ "code" .= microsofttodoMigrationCode + ] + + +-- | Construct a value of type 'MicrosofttodoMigration' (by applying it's required fields, if any) +mkMicrosofttodoMigration + :: MicrosofttodoMigration +mkMicrosofttodoMigration = + MicrosofttodoMigration + { microsofttodoMigrationCode = Nothing + } + +-- ** MigrationStatus +-- | MigrationStatus +data MigrationStatus = MigrationStatus + { migrationStatusFinishedAt :: !(Maybe Text) -- ^ "finished_at" + , migrationStatusId :: !(Maybe Int) -- ^ "id" + , migrationStatusMigratorName :: !(Maybe Text) -- ^ "migrator_name" + , migrationStatusStartedAt :: !(Maybe Text) -- ^ "started_at" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON MigrationStatus +instance A.FromJSON MigrationStatus where + parseJSON = A.withObject "MigrationStatus" $ \o -> + MigrationStatus + <$> (o .:? "finished_at") + <*> (o .:? "id") + <*> (o .:? "migrator_name") + <*> (o .:? "started_at") + +-- | ToJSON MigrationStatus +instance A.ToJSON MigrationStatus where + toJSON MigrationStatus {..} = + _omitNulls + [ "finished_at" .= migrationStatusFinishedAt + , "id" .= migrationStatusId + , "migrator_name" .= migrationStatusMigratorName + , "started_at" .= migrationStatusStartedAt + ] + + +-- | Construct a value of type 'MigrationStatus' (by applying it's required fields, if any) +mkMigrationStatus + :: MigrationStatus +mkMigrationStatus = + MigrationStatus + { migrationStatusFinishedAt = Nothing + , migrationStatusId = Nothing + , migrationStatusMigratorName = Nothing + , migrationStatusStartedAt = Nothing + } + +-- ** ModelsAPIToken +-- | ModelsAPIToken +data ModelsAPIToken = ModelsAPIToken + { modelsAPITokenCreated :: !(Maybe Text) -- ^ "created" - A timestamp when this api key was created. You cannot change this value. + , modelsAPITokenExpiresAt :: !(Maybe Text) -- ^ "expires_at" - The date when this key expires. + , modelsAPITokenId :: !(Maybe Int) -- ^ "id" - The unique, numeric id of this api key. + , modelsAPITokenPermissions :: !(Maybe Map) -- ^ "permissions" - The permissions this token has. Possible values are available via the /routes endpoint and consist of the keys of the list from that endpoint. For example, if the token should be able to read all tasks as well as update existing tasks, you should add `{\"tasks\":[\"read_all\",\"update\"]}`. + , modelsAPITokenTitle :: !(Maybe Text) -- ^ "title" - A human-readable name for this token + , modelsAPITokenToken :: !(Maybe Text) -- ^ "token" - The actual api key. Only visible after creation. + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ModelsAPIToken +instance A.FromJSON ModelsAPIToken where + parseJSON = A.withObject "ModelsAPIToken" $ \o -> + ModelsAPIToken + <$> (o .:? "created") + <*> (o .:? "expires_at") + <*> (o .:? "id") + <*> (o .:? "permissions") + <*> (o .:? "title") + <*> (o .:? "token") + +-- | ToJSON ModelsAPIToken +instance A.ToJSON ModelsAPIToken where + toJSON ModelsAPIToken {..} = + _omitNulls + [ "created" .= modelsAPITokenCreated + , "expires_at" .= modelsAPITokenExpiresAt + , "id" .= modelsAPITokenId + , "permissions" .= modelsAPITokenPermissions + , "title" .= modelsAPITokenTitle + , "token" .= modelsAPITokenToken + ] + + +-- | Construct a value of type 'ModelsAPIToken' (by applying it's required fields, if any) +mkModelsAPIToken + :: ModelsAPIToken +mkModelsAPIToken = + ModelsAPIToken + { modelsAPITokenCreated = Nothing + , modelsAPITokenExpiresAt = Nothing + , modelsAPITokenId = Nothing + , modelsAPITokenPermissions = NothingNothing + , modelsAPITokenTitle = Nothing + , modelsAPITokenToken = Nothing + } + +-- ** ModelsBucket +-- | ModelsBucket +data ModelsBucket = ModelsBucket + { modelsBucketCount :: !(Maybe Int) -- ^ "count" - The number of tasks currently in this bucket + , modelsBucketCreated :: !(Maybe Text) -- ^ "created" - A timestamp when this bucket was created. You cannot change this value. + , modelsBucketCreatedBy :: !(Maybe ModelsBucketCreatedBy) -- ^ "created_by" + , modelsBucketId :: !(Maybe Int) -- ^ "id" - The unique, numeric id of this bucket. + , modelsBucketLimit :: !(Maybe Int) -- ^ "limit" - How many tasks can be at the same time on this board max + , modelsBucketPosition :: !(Maybe Double) -- ^ "position" - The position this bucket has when querying all buckets. See the tasks.position property on how to use this. + , modelsBucketProjectViewId :: !(Maybe Int) -- ^ "project_view_id" - The project view this bucket belongs to. + , modelsBucketTasks :: !(Maybe [ModelsTask]) -- ^ "tasks" - All tasks which belong to this bucket. + , modelsBucketTitle :: !(Maybe Text) -- ^ "title" - The title of this bucket. + , modelsBucketUpdated :: !(Maybe Text) -- ^ "updated" - A timestamp when this bucket was last updated. You cannot change this value. + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ModelsBucket +instance A.FromJSON ModelsBucket where + parseJSON = A.withObject "ModelsBucket" $ \o -> + ModelsBucket + <$> (o .:? "count") + <*> (o .:? "created") + <*> (o .:? "created_by") + <*> (o .:? "id") + <*> (o .:? "limit") + <*> (o .:? "position") + <*> (o .:? "project_view_id") + <*> (o .:? "tasks") + <*> (o .:? "title") + <*> (o .:? "updated") + +-- | ToJSON ModelsBucket +instance A.ToJSON ModelsBucket where + toJSON ModelsBucket {..} = + _omitNulls + [ "count" .= modelsBucketCount + , "created" .= modelsBucketCreated + , "created_by" .= modelsBucketCreatedBy + , "id" .= modelsBucketId + , "limit" .= modelsBucketLimit + , "position" .= modelsBucketPosition + , "project_view_id" .= modelsBucketProjectViewId + , "tasks" .= modelsBucketTasks + , "title" .= modelsBucketTitle + , "updated" .= modelsBucketUpdated + ] + + +-- | Construct a value of type 'ModelsBucket' (by applying it's required fields, if any) +mkModelsBucket + :: ModelsBucket +mkModelsBucket = + ModelsBucket + { modelsBucketCount = Nothing + , modelsBucketCreated = Nothing + , modelsBucketCreatedBy = Nothing + , modelsBucketId = Nothing + , modelsBucketLimit = Nothing + , modelsBucketPosition = Nothing + , modelsBucketProjectViewId = Nothing + , modelsBucketTasks = Nothing + , modelsBucketTitle = Nothing + , modelsBucketUpdated = Nothing + } + +-- ** ModelsBucketCreatedBy +-- | ModelsBucketCreatedBy +-- The user who initially created the bucket. +data ModelsBucketCreatedBy = ModelsBucketCreatedBy + { modelsBucketCreatedByCreated :: !(Maybe Text) -- ^ "created" - A timestamp when this task was created. You cannot change this value. + , modelsBucketCreatedByEmail :: !(Maybe Text) -- ^ "email" - The user's email address. + , modelsBucketCreatedById :: !(Maybe Int) -- ^ "id" - The unique, numeric id of this user. + , modelsBucketCreatedByName :: !(Maybe Text) -- ^ "name" - The full name of the user. + , modelsBucketCreatedByUpdated :: !(Maybe Text) -- ^ "updated" - A timestamp when this task was last updated. You cannot change this value. + , modelsBucketCreatedByUsername :: !(Maybe Text) -- ^ "username" - The username of the user. Is always unique. + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ModelsBucketCreatedBy +instance A.FromJSON ModelsBucketCreatedBy where + parseJSON = A.withObject "ModelsBucketCreatedBy" $ \o -> + ModelsBucketCreatedBy + <$> (o .:? "created") + <*> (o .:? "email") + <*> (o .:? "id") + <*> (o .:? "name") + <*> (o .:? "updated") + <*> (o .:? "username") + +-- | ToJSON ModelsBucketCreatedBy +instance A.ToJSON ModelsBucketCreatedBy where + toJSON ModelsBucketCreatedBy {..} = + _omitNulls + [ "created" .= modelsBucketCreatedByCreated + , "email" .= modelsBucketCreatedByEmail + , "id" .= modelsBucketCreatedById + , "name" .= modelsBucketCreatedByName + , "updated" .= modelsBucketCreatedByUpdated + , "username" .= modelsBucketCreatedByUsername + ] + + +-- | Construct a value of type 'ModelsBucketCreatedBy' (by applying it's required fields, if any) +mkModelsBucketCreatedBy + :: ModelsBucketCreatedBy +mkModelsBucketCreatedBy = + ModelsBucketCreatedBy + { modelsBucketCreatedByCreated = Nothing + , modelsBucketCreatedByEmail = Nothing + , modelsBucketCreatedById = Nothing + , modelsBucketCreatedByName = Nothing + , modelsBucketCreatedByUpdated = Nothing + , modelsBucketCreatedByUsername = Nothing + } + +-- ** ModelsBulkAssignees +-- | ModelsBulkAssignees +data ModelsBulkAssignees = ModelsBulkAssignees + { modelsBulkAssigneesAssignees :: !(Maybe [UserUser]) -- ^ "assignees" - A project with all assignees + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ModelsBulkAssignees +instance A.FromJSON ModelsBulkAssignees where + parseJSON = A.withObject "ModelsBulkAssignees" $ \o -> + ModelsBulkAssignees + <$> (o .:? "assignees") + +-- | ToJSON ModelsBulkAssignees +instance A.ToJSON ModelsBulkAssignees where + toJSON ModelsBulkAssignees {..} = + _omitNulls + [ "assignees" .= modelsBulkAssigneesAssignees + ] + + +-- | Construct a value of type 'ModelsBulkAssignees' (by applying it's required fields, if any) +mkModelsBulkAssignees + :: ModelsBulkAssignees +mkModelsBulkAssignees = + ModelsBulkAssignees + { modelsBulkAssigneesAssignees = Nothing + } + +-- ** ModelsBulkTask +-- | ModelsBulkTask +data ModelsBulkTask = ModelsBulkTask + { modelsBulkTaskAssignees :: !(Maybe [UserUser]) -- ^ "assignees" - An array of users who are assigned to this task + , modelsBulkTaskAttachments :: !(Maybe [ModelsTaskAttachment]) -- ^ "attachments" - All attachments this task has. This property is read-onlym, you must use the separate endpoint to add attachments to a task. + , modelsBulkTaskBucketId :: !(Maybe Int) -- ^ "bucket_id" - The bucket id. Will only be populated when the task is accessed via a view with buckets. Can be used to move a task between buckets. In that case, the new bucket must be in the same view as the old one. + , modelsBulkTaskCoverImageAttachmentId :: !(Maybe Int) -- ^ "cover_image_attachment_id" - If this task has a cover image, the field will return the id of the attachment that is the cover image. + , modelsBulkTaskCreated :: !(Maybe Text) -- ^ "created" - A timestamp when this task was created. You cannot change this value. + , modelsBulkTaskCreatedBy :: !(Maybe ModelsBulkTaskCreatedBy) -- ^ "created_by" + , modelsBulkTaskDescription :: !(Maybe Text) -- ^ "description" - The task description. + , modelsBulkTaskDone :: !(Maybe Bool) -- ^ "done" - Whether a task is done or not. + , modelsBulkTaskDoneAt :: !(Maybe Text) -- ^ "done_at" - The time when a task was marked as done. + , modelsBulkTaskDueDate :: !(Maybe Text) -- ^ "due_date" - The time when the task is due. + , modelsBulkTaskEndDate :: !(Maybe Text) -- ^ "end_date" - When this task ends. + , modelsBulkTaskHexColor :: !(Maybe Text) -- ^ "hex_color" - The task color in hex + , modelsBulkTaskId :: !(Maybe Int) -- ^ "id" - The unique, numeric id of this task. + , modelsBulkTaskIdentifier :: !(Maybe Text) -- ^ "identifier" - The task identifier, based on the project identifier and the task's index + , modelsBulkTaskIndex :: !(Maybe Int) -- ^ "index" - The task index, calculated per project + , modelsBulkTaskIsFavorite :: !(Maybe Bool) -- ^ "is_favorite" - True if a task is a favorite task. Favorite tasks show up in a separate \"Important\" project. This value depends on the user making the call to the api. + , modelsBulkTaskLabels :: !(Maybe [ModelsLabel]) -- ^ "labels" - An array of labels which are associated with this task. This property is read-only, you must use the separate endpoint to add labels to a task. + , modelsBulkTaskPercentDone :: !(Maybe Double) -- ^ "percent_done" - Determines how far a task is left from being done + , modelsBulkTaskPosition :: !(Maybe Double) -- ^ "position" - The position of the task - any task project can be sorted as usual by this parameter. When accessing tasks via views with buckets, this is primarily used to sort them based on a range. Positions are always saved per view. They will automatically be set if you request the tasks through a view endpoint, otherwise they will always be 0. To update them, take a look at the Task Position endpoint. + , modelsBulkTaskPriority :: !(Maybe Int) -- ^ "priority" - The task priority. Can be anything you want, it is possible to sort by this later. + , modelsBulkTaskProjectId :: !(Maybe Int) -- ^ "project_id" - The project this task belongs to. + , modelsBulkTaskReactions :: !(Maybe Map) -- ^ "reactions" - Reactions on that task. + , modelsBulkTaskRelatedTasks :: !(Maybe Map) -- ^ "related_tasks" - All related tasks, grouped by their relation kind + , modelsBulkTaskReminders :: !(Maybe [ModelsTaskReminder]) -- ^ "reminders" - An array of reminders that are associated with this task. + , modelsBulkTaskRepeatAfter :: !(Maybe Int) -- ^ "repeat_after" - 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. + , modelsBulkTaskRepeatMode :: !(Maybe ModelsTaskRepeatMode) -- ^ "repeat_mode" - Can have three possible values which will trigger when the task is marked as done: 0 = repeats after the amount specified in repeat_after, 1 = repeats all dates each months (ignoring repeat_after), 3 = repeats from the current date rather than the last set date. + , modelsBulkTaskStartDate :: !(Maybe Text) -- ^ "start_date" - When this task starts. + , modelsBulkTaskSubscription :: !(Maybe ModelsBulkTaskSubscription) -- ^ "subscription" + , modelsBulkTaskTaskIds :: !(Maybe [Int]) -- ^ "task_ids" - A project of task ids to update + , modelsBulkTaskTitle :: !(Maybe Text) -- ^ "title" - The task text. This is what you'll see in the project. + , modelsBulkTaskUpdated :: !(Maybe Text) -- ^ "updated" - A timestamp when this task was last updated. You cannot change this value. + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ModelsBulkTask +instance A.FromJSON ModelsBulkTask where + parseJSON = A.withObject "ModelsBulkTask" $ \o -> + ModelsBulkTask + <$> (o .:? "assignees") + <*> (o .:? "attachments") + <*> (o .:? "bucket_id") + <*> (o .:? "cover_image_attachment_id") + <*> (o .:? "created") + <*> (o .:? "created_by") + <*> (o .:? "description") + <*> (o .:? "done") + <*> (o .:? "done_at") + <*> (o .:? "due_date") + <*> (o .:? "end_date") + <*> (o .:? "hex_color") + <*> (o .:? "id") + <*> (o .:? "identifier") + <*> (o .:? "index") + <*> (o .:? "is_favorite") + <*> (o .:? "labels") + <*> (o .:? "percent_done") + <*> (o .:? "position") + <*> (o .:? "priority") + <*> (o .:? "project_id") + <*> (o .:? "reactions") + <*> (o .:? "related_tasks") + <*> (o .:? "reminders") + <*> (o .:? "repeat_after") + <*> (o .:? "repeat_mode") + <*> (o .:? "start_date") + <*> (o .:? "subscription") + <*> (o .:? "task_ids") + <*> (o .:? "title") + <*> (o .:? "updated") + +-- | ToJSON ModelsBulkTask +instance A.ToJSON ModelsBulkTask where + toJSON ModelsBulkTask {..} = + _omitNulls + [ "assignees" .= modelsBulkTaskAssignees + , "attachments" .= modelsBulkTaskAttachments + , "bucket_id" .= modelsBulkTaskBucketId + , "cover_image_attachment_id" .= modelsBulkTaskCoverImageAttachmentId + , "created" .= modelsBulkTaskCreated + , "created_by" .= modelsBulkTaskCreatedBy + , "description" .= modelsBulkTaskDescription + , "done" .= modelsBulkTaskDone + , "done_at" .= modelsBulkTaskDoneAt + , "due_date" .= modelsBulkTaskDueDate + , "end_date" .= modelsBulkTaskEndDate + , "hex_color" .= modelsBulkTaskHexColor + , "id" .= modelsBulkTaskId + , "identifier" .= modelsBulkTaskIdentifier + , "index" .= modelsBulkTaskIndex + , "is_favorite" .= modelsBulkTaskIsFavorite + , "labels" .= modelsBulkTaskLabels + , "percent_done" .= modelsBulkTaskPercentDone + , "position" .= modelsBulkTaskPosition + , "priority" .= modelsBulkTaskPriority + , "project_id" .= modelsBulkTaskProjectId + , "reactions" .= modelsBulkTaskReactions + , "related_tasks" .= modelsBulkTaskRelatedTasks + , "reminders" .= modelsBulkTaskReminders + , "repeat_after" .= modelsBulkTaskRepeatAfter + , "repeat_mode" .= modelsBulkTaskRepeatMode + , "start_date" .= modelsBulkTaskStartDate + , "subscription" .= modelsBulkTaskSubscription + , "task_ids" .= modelsBulkTaskTaskIds + , "title" .= modelsBulkTaskTitle + , "updated" .= modelsBulkTaskUpdated + ] + + +-- | Construct a value of type 'ModelsBulkTask' (by applying it's required fields, if any) +mkModelsBulkTask + :: ModelsBulkTask +mkModelsBulkTask = + ModelsBulkTask + { modelsBulkTaskAssignees = Nothing + , modelsBulkTaskAttachments = Nothing + , modelsBulkTaskBucketId = Nothing + , modelsBulkTaskCoverImageAttachmentId = Nothing + , modelsBulkTaskCreated = Nothing + , modelsBulkTaskCreatedBy = Nothing + , modelsBulkTaskDescription = Nothing + , modelsBulkTaskDone = Nothing + , modelsBulkTaskDoneAt = Nothing + , modelsBulkTaskDueDate = Nothing + , modelsBulkTaskEndDate = Nothing + , modelsBulkTaskHexColor = Nothing + , modelsBulkTaskId = Nothing + , modelsBulkTaskIdentifier = Nothing + , modelsBulkTaskIndex = Nothing + , modelsBulkTaskIsFavorite = Nothing + , modelsBulkTaskLabels = Nothing + , modelsBulkTaskPercentDone = Nothing + , modelsBulkTaskPosition = Nothing + , modelsBulkTaskPriority = Nothing + , modelsBulkTaskProjectId = Nothing + , modelsBulkTaskReactions = NothingNothing + , modelsBulkTaskRelatedTasks = NothingNothing + , modelsBulkTaskReminders = Nothing + , modelsBulkTaskRepeatAfter = Nothing + , modelsBulkTaskRepeatMode = NothingNothing + , modelsBulkTaskStartDate = Nothing + , modelsBulkTaskSubscription = Nothing + , modelsBulkTaskTaskIds = Nothing + , modelsBulkTaskTitle = Nothing + , modelsBulkTaskUpdated = Nothing + } + +-- ** ModelsBulkTaskCreatedBy +-- | ModelsBulkTaskCreatedBy +-- The user who initially created the task. +data ModelsBulkTaskCreatedBy = ModelsBulkTaskCreatedBy + { modelsBulkTaskCreatedByCreated :: !(Maybe Text) -- ^ "created" - A timestamp when this task was created. You cannot change this value. + , modelsBulkTaskCreatedByEmail :: !(Maybe Text) -- ^ "email" - The user's email address. + , modelsBulkTaskCreatedById :: !(Maybe Int) -- ^ "id" - The unique, numeric id of this user. + , modelsBulkTaskCreatedByName :: !(Maybe Text) -- ^ "name" - The full name of the user. + , modelsBulkTaskCreatedByUpdated :: !(Maybe Text) -- ^ "updated" - A timestamp when this task was last updated. You cannot change this value. + , modelsBulkTaskCreatedByUsername :: !(Maybe Text) -- ^ "username" - The username of the user. Is always unique. + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ModelsBulkTaskCreatedBy +instance A.FromJSON ModelsBulkTaskCreatedBy where + parseJSON = A.withObject "ModelsBulkTaskCreatedBy" $ \o -> + ModelsBulkTaskCreatedBy + <$> (o .:? "created") + <*> (o .:? "email") + <*> (o .:? "id") + <*> (o .:? "name") + <*> (o .:? "updated") + <*> (o .:? "username") + +-- | ToJSON ModelsBulkTaskCreatedBy +instance A.ToJSON ModelsBulkTaskCreatedBy where + toJSON ModelsBulkTaskCreatedBy {..} = + _omitNulls + [ "created" .= modelsBulkTaskCreatedByCreated + , "email" .= modelsBulkTaskCreatedByEmail + , "id" .= modelsBulkTaskCreatedById + , "name" .= modelsBulkTaskCreatedByName + , "updated" .= modelsBulkTaskCreatedByUpdated + , "username" .= modelsBulkTaskCreatedByUsername + ] + + +-- | Construct a value of type 'ModelsBulkTaskCreatedBy' (by applying it's required fields, if any) +mkModelsBulkTaskCreatedBy + :: ModelsBulkTaskCreatedBy +mkModelsBulkTaskCreatedBy = + ModelsBulkTaskCreatedBy + { modelsBulkTaskCreatedByCreated = Nothing + , modelsBulkTaskCreatedByEmail = Nothing + , modelsBulkTaskCreatedById = Nothing + , modelsBulkTaskCreatedByName = Nothing + , modelsBulkTaskCreatedByUpdated = Nothing + , modelsBulkTaskCreatedByUsername = Nothing + } + +-- ** ModelsBulkTaskSubscription +-- | ModelsBulkTaskSubscription +-- The subscription status for the user reading this task. You can only read this property, use the subscription endpoints to modify it. Will only returned when retrieving one task. +data ModelsBulkTaskSubscription = ModelsBulkTaskSubscription + { modelsBulkTaskSubscriptionCreated :: !(Maybe Text) -- ^ "created" - A timestamp when this subscription was created. You cannot change this value. + , modelsBulkTaskSubscriptionEntity :: !(Maybe Int) -- ^ "entity" + , modelsBulkTaskSubscriptionEntityId :: !(Maybe Int) -- ^ "entity_id" - The id of the entity to subscribe to. + , modelsBulkTaskSubscriptionId :: !(Maybe Int) -- ^ "id" - The numeric ID of the subscription + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ModelsBulkTaskSubscription +instance A.FromJSON ModelsBulkTaskSubscription where + parseJSON = A.withObject "ModelsBulkTaskSubscription" $ \o -> + ModelsBulkTaskSubscription + <$> (o .:? "created") + <*> (o .:? "entity") + <*> (o .:? "entity_id") + <*> (o .:? "id") + +-- | ToJSON ModelsBulkTaskSubscription +instance A.ToJSON ModelsBulkTaskSubscription where + toJSON ModelsBulkTaskSubscription {..} = + _omitNulls + [ "created" .= modelsBulkTaskSubscriptionCreated + , "entity" .= modelsBulkTaskSubscriptionEntity + , "entity_id" .= modelsBulkTaskSubscriptionEntityId + , "id" .= modelsBulkTaskSubscriptionId + ] + + +-- | Construct a value of type 'ModelsBulkTaskSubscription' (by applying it's required fields, if any) +mkModelsBulkTaskSubscription + :: ModelsBulkTaskSubscription +mkModelsBulkTaskSubscription = + ModelsBulkTaskSubscription + { modelsBulkTaskSubscriptionCreated = Nothing + , modelsBulkTaskSubscriptionEntity = Nothing + , modelsBulkTaskSubscriptionEntityId = Nothing + , modelsBulkTaskSubscriptionId = Nothing + } + +-- ** ModelsDatabaseNotifications +-- | ModelsDatabaseNotifications +data ModelsDatabaseNotifications = ModelsDatabaseNotifications + { modelsDatabaseNotificationsCreated :: !(Maybe Text) -- ^ "created" - A timestamp when this notification was created. You cannot change this value. + , modelsDatabaseNotificationsId :: !(Maybe Int) -- ^ "id" - The unique, numeric id of this notification. + , modelsDatabaseNotificationsName :: !(Maybe Text) -- ^ "name" - The name of the notification + , modelsDatabaseNotificationsNotification :: !(Maybe A.Value) -- ^ "notification" - The actual content of the notification. + , modelsDatabaseNotificationsRead :: !(Maybe Bool) -- ^ "read" - Whether or not to mark this notification as read or unread. True is read, false is unread. + , modelsDatabaseNotificationsReadAt :: !(Maybe Text) -- ^ "read_at" - When this notification is marked as read, this will be updated with the current timestamp. + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ModelsDatabaseNotifications +instance A.FromJSON ModelsDatabaseNotifications where + parseJSON = A.withObject "ModelsDatabaseNotifications" $ \o -> + ModelsDatabaseNotifications + <$> (o .:? "created") + <*> (o .:? "id") + <*> (o .:? "name") + <*> (o .:? "notification") + <*> (o .:? "read") + <*> (o .:? "read_at") + +-- | ToJSON ModelsDatabaseNotifications +instance A.ToJSON ModelsDatabaseNotifications where + toJSON ModelsDatabaseNotifications {..} = + _omitNulls + [ "created" .= modelsDatabaseNotificationsCreated + , "id" .= modelsDatabaseNotificationsId + , "name" .= modelsDatabaseNotificationsName + , "notification" .= modelsDatabaseNotificationsNotification + , "read" .= modelsDatabaseNotificationsRead + , "read_at" .= modelsDatabaseNotificationsReadAt + ] + + +-- | Construct a value of type 'ModelsDatabaseNotifications' (by applying it's required fields, if any) +mkModelsDatabaseNotifications + :: ModelsDatabaseNotifications +mkModelsDatabaseNotifications = + ModelsDatabaseNotifications + { modelsDatabaseNotificationsCreated = Nothing + , modelsDatabaseNotificationsId = Nothing + , modelsDatabaseNotificationsName = Nothing + , modelsDatabaseNotificationsNotification = Nothing + , modelsDatabaseNotificationsRead = Nothing + , modelsDatabaseNotificationsReadAt = Nothing + } + +-- ** ModelsLabel +-- | ModelsLabel +data ModelsLabel = ModelsLabel + { modelsLabelCreated :: !(Maybe Text) -- ^ "created" - A timestamp when this label was created. You cannot change this value. + , modelsLabelCreatedBy :: !(Maybe ModelsLabelCreatedBy) -- ^ "created_by" + , modelsLabelDescription :: !(Maybe Text) -- ^ "description" - The label description. + , modelsLabelHexColor :: !(Maybe Text) -- ^ "hex_color" - The color this label has in hex format. + , modelsLabelId :: !(Maybe Int) -- ^ "id" - The unique, numeric id of this label. + , modelsLabelTitle :: !(Maybe Text) -- ^ "title" - The title of the lable. You'll see this one on tasks associated with it. + , modelsLabelUpdated :: !(Maybe Text) -- ^ "updated" - A timestamp when this label was last updated. You cannot change this value. + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ModelsLabel +instance A.FromJSON ModelsLabel where + parseJSON = A.withObject "ModelsLabel" $ \o -> + ModelsLabel + <$> (o .:? "created") + <*> (o .:? "created_by") + <*> (o .:? "description") + <*> (o .:? "hex_color") + <*> (o .:? "id") + <*> (o .:? "title") + <*> (o .:? "updated") + +-- | ToJSON ModelsLabel +instance A.ToJSON ModelsLabel where + toJSON ModelsLabel {..} = + _omitNulls + [ "created" .= modelsLabelCreated + , "created_by" .= modelsLabelCreatedBy + , "description" .= modelsLabelDescription + , "hex_color" .= modelsLabelHexColor + , "id" .= modelsLabelId + , "title" .= modelsLabelTitle + , "updated" .= modelsLabelUpdated + ] + + +-- | Construct a value of type 'ModelsLabel' (by applying it's required fields, if any) +mkModelsLabel + :: ModelsLabel +mkModelsLabel = + ModelsLabel + { modelsLabelCreated = Nothing + , modelsLabelCreatedBy = Nothing + , modelsLabelDescription = Nothing + , modelsLabelHexColor = Nothing + , modelsLabelId = Nothing + , modelsLabelTitle = Nothing + , modelsLabelUpdated = Nothing + } + +-- ** ModelsLabelCreatedBy +-- | ModelsLabelCreatedBy +-- The user who created this label +data ModelsLabelCreatedBy = ModelsLabelCreatedBy + { modelsLabelCreatedByCreated :: !(Maybe Text) -- ^ "created" - A timestamp when this task was created. You cannot change this value. + , modelsLabelCreatedByEmail :: !(Maybe Text) -- ^ "email" - The user's email address. + , modelsLabelCreatedById :: !(Maybe Int) -- ^ "id" - The unique, numeric id of this user. + , modelsLabelCreatedByName :: !(Maybe Text) -- ^ "name" - The full name of the user. + , modelsLabelCreatedByUpdated :: !(Maybe Text) -- ^ "updated" - A timestamp when this task was last updated. You cannot change this value. + , modelsLabelCreatedByUsername :: !(Maybe Text) -- ^ "username" - The username of the user. Is always unique. + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ModelsLabelCreatedBy +instance A.FromJSON ModelsLabelCreatedBy where + parseJSON = A.withObject "ModelsLabelCreatedBy" $ \o -> + ModelsLabelCreatedBy + <$> (o .:? "created") + <*> (o .:? "email") + <*> (o .:? "id") + <*> (o .:? "name") + <*> (o .:? "updated") + <*> (o .:? "username") + +-- | ToJSON ModelsLabelCreatedBy +instance A.ToJSON ModelsLabelCreatedBy where + toJSON ModelsLabelCreatedBy {..} = + _omitNulls + [ "created" .= modelsLabelCreatedByCreated + , "email" .= modelsLabelCreatedByEmail + , "id" .= modelsLabelCreatedById + , "name" .= modelsLabelCreatedByName + , "updated" .= modelsLabelCreatedByUpdated + , "username" .= modelsLabelCreatedByUsername + ] + + +-- | Construct a value of type 'ModelsLabelCreatedBy' (by applying it's required fields, if any) +mkModelsLabelCreatedBy + :: ModelsLabelCreatedBy +mkModelsLabelCreatedBy = + ModelsLabelCreatedBy + { modelsLabelCreatedByCreated = Nothing + , modelsLabelCreatedByEmail = Nothing + , modelsLabelCreatedById = Nothing + , modelsLabelCreatedByName = Nothing + , modelsLabelCreatedByUpdated = Nothing + , modelsLabelCreatedByUsername = Nothing + } + +-- ** ModelsLabelTask +-- | ModelsLabelTask +data ModelsLabelTask = ModelsLabelTask + { modelsLabelTaskCreated :: !(Maybe Text) -- ^ "created" - A timestamp when this task was created. You cannot change this value. + , modelsLabelTaskLabelId :: !(Maybe Int) -- ^ "label_id" - The label id you want to associate with a task. + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ModelsLabelTask +instance A.FromJSON ModelsLabelTask where + parseJSON = A.withObject "ModelsLabelTask" $ \o -> + ModelsLabelTask + <$> (o .:? "created") + <*> (o .:? "label_id") + +-- | ToJSON ModelsLabelTask +instance A.ToJSON ModelsLabelTask where + toJSON ModelsLabelTask {..} = + _omitNulls + [ "created" .= modelsLabelTaskCreated + , "label_id" .= modelsLabelTaskLabelId + ] + + +-- | Construct a value of type 'ModelsLabelTask' (by applying it's required fields, if any) +mkModelsLabelTask + :: ModelsLabelTask +mkModelsLabelTask = + ModelsLabelTask + { modelsLabelTaskCreated = Nothing + , modelsLabelTaskLabelId = Nothing + } + +-- ** ModelsLabelTaskBulk +-- | ModelsLabelTaskBulk +data ModelsLabelTaskBulk = ModelsLabelTaskBulk + { modelsLabelTaskBulkLabels :: !(Maybe [ModelsLabel]) -- ^ "labels" - All labels you want to update at once. + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ModelsLabelTaskBulk +instance A.FromJSON ModelsLabelTaskBulk where + parseJSON = A.withObject "ModelsLabelTaskBulk" $ \o -> + ModelsLabelTaskBulk + <$> (o .:? "labels") + +-- | ToJSON ModelsLabelTaskBulk +instance A.ToJSON ModelsLabelTaskBulk where + toJSON ModelsLabelTaskBulk {..} = + _omitNulls + [ "labels" .= modelsLabelTaskBulkLabels + ] + + +-- | Construct a value of type 'ModelsLabelTaskBulk' (by applying it's required fields, if any) +mkModelsLabelTaskBulk + :: ModelsLabelTaskBulk +mkModelsLabelTaskBulk = + ModelsLabelTaskBulk + { modelsLabelTaskBulkLabels = Nothing + } + +-- ** ModelsLinkSharing +-- | ModelsLinkSharing +data ModelsLinkSharing = ModelsLinkSharing + { modelsLinkSharingCreated :: !(Maybe Text) -- ^ "created" - A timestamp when this project was shared. You cannot change this value. + , modelsLinkSharingHash :: !(Maybe Text) -- ^ "hash" - The public id to get this shared project + , modelsLinkSharingId :: !(Maybe Int) -- ^ "id" - The ID of the shared thing + , modelsLinkSharingName :: !(Maybe Text) -- ^ "name" - The name of this link share. All actions someone takes while being authenticated with that link will appear with that name. + , modelsLinkSharingPassword :: !(Maybe Text) -- ^ "password" - The password of this link share. You can only set it, not retrieve it after the link share has been created. + , modelsLinkSharingRight :: !(Maybe ModelsRight) -- ^ "right" - The right this project is shared with. 0 = Read only, 1 = Read & Write, 2 = Admin. See the docs for more details. + , modelsLinkSharingSharedBy :: !(Maybe ModelsLinkSharingSharedBy) -- ^ "shared_by" + , modelsLinkSharingSharingType :: !(Maybe ModelsSharingType) -- ^ "sharing_type" - The kind of this link. 0 = undefined, 1 = without password, 2 = with password. + , modelsLinkSharingUpdated :: !(Maybe Text) -- ^ "updated" - A timestamp when this share was last updated. You cannot change this value. + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ModelsLinkSharing +instance A.FromJSON ModelsLinkSharing where + parseJSON = A.withObject "ModelsLinkSharing" $ \o -> + ModelsLinkSharing + <$> (o .:? "created") + <*> (o .:? "hash") + <*> (o .:? "id") + <*> (o .:? "name") + <*> (o .:? "password") + <*> (o .:? "right") + <*> (o .:? "shared_by") + <*> (o .:? "sharing_type") + <*> (o .:? "updated") + +-- | ToJSON ModelsLinkSharing +instance A.ToJSON ModelsLinkSharing where + toJSON ModelsLinkSharing {..} = + _omitNulls + [ "created" .= modelsLinkSharingCreated + , "hash" .= modelsLinkSharingHash + , "id" .= modelsLinkSharingId + , "name" .= modelsLinkSharingName + , "password" .= modelsLinkSharingPassword + , "right" .= modelsLinkSharingRight + , "shared_by" .= modelsLinkSharingSharedBy + , "sharing_type" .= modelsLinkSharingSharingType + , "updated" .= modelsLinkSharingUpdated + ] + + +-- | Construct a value of type 'ModelsLinkSharing' (by applying it's required fields, if any) +mkModelsLinkSharing + :: ModelsLinkSharing +mkModelsLinkSharing = + ModelsLinkSharing + { modelsLinkSharingCreated = Nothing + , modelsLinkSharingHash = Nothing + , modelsLinkSharingId = Nothing + , modelsLinkSharingName = Nothing + , modelsLinkSharingPassword = Nothing + , modelsLinkSharingRight = NothingNothing + , modelsLinkSharingSharedBy = Nothing + , modelsLinkSharingSharingType = NothingNothing + , modelsLinkSharingUpdated = Nothing + } + +-- ** ModelsLinkSharingSharedBy +-- | ModelsLinkSharingSharedBy +-- The user who shared this project +data ModelsLinkSharingSharedBy = ModelsLinkSharingSharedBy + { modelsLinkSharingSharedByCreated :: !(Maybe Text) -- ^ "created" - A timestamp when this task was created. You cannot change this value. + , modelsLinkSharingSharedByEmail :: !(Maybe Text) -- ^ "email" - The user's email address. + , modelsLinkSharingSharedById :: !(Maybe Int) -- ^ "id" - The unique, numeric id of this user. + , modelsLinkSharingSharedByName :: !(Maybe Text) -- ^ "name" - The full name of the user. + , modelsLinkSharingSharedByUpdated :: !(Maybe Text) -- ^ "updated" - A timestamp when this task was last updated. You cannot change this value. + , modelsLinkSharingSharedByUsername :: !(Maybe Text) -- ^ "username" - The username of the user. Is always unique. + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ModelsLinkSharingSharedBy +instance A.FromJSON ModelsLinkSharingSharedBy where + parseJSON = A.withObject "ModelsLinkSharingSharedBy" $ \o -> + ModelsLinkSharingSharedBy + <$> (o .:? "created") + <*> (o .:? "email") + <*> (o .:? "id") + <*> (o .:? "name") + <*> (o .:? "updated") + <*> (o .:? "username") + +-- | ToJSON ModelsLinkSharingSharedBy +instance A.ToJSON ModelsLinkSharingSharedBy where + toJSON ModelsLinkSharingSharedBy {..} = + _omitNulls + [ "created" .= modelsLinkSharingSharedByCreated + , "email" .= modelsLinkSharingSharedByEmail + , "id" .= modelsLinkSharingSharedById + , "name" .= modelsLinkSharingSharedByName + , "updated" .= modelsLinkSharingSharedByUpdated + , "username" .= modelsLinkSharingSharedByUsername + ] + + +-- | Construct a value of type 'ModelsLinkSharingSharedBy' (by applying it's required fields, if any) +mkModelsLinkSharingSharedBy + :: ModelsLinkSharingSharedBy +mkModelsLinkSharingSharedBy = + ModelsLinkSharingSharedBy + { modelsLinkSharingSharedByCreated = Nothing + , modelsLinkSharingSharedByEmail = Nothing + , modelsLinkSharingSharedById = Nothing + , modelsLinkSharingSharedByName = Nothing + , modelsLinkSharingSharedByUpdated = Nothing + , modelsLinkSharingSharedByUsername = Nothing + } + +-- ** ModelsMessage +-- | ModelsMessage +data ModelsMessage = ModelsMessage + { modelsMessageMessage :: !(Maybe Text) -- ^ "message" - A standard message. + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ModelsMessage +instance A.FromJSON ModelsMessage where + parseJSON = A.withObject "ModelsMessage" $ \o -> + ModelsMessage + <$> (o .:? "message") + +-- | ToJSON ModelsMessage +instance A.ToJSON ModelsMessage where + toJSON ModelsMessage {..} = + _omitNulls + [ "message" .= modelsMessageMessage + ] + + +-- | Construct a value of type 'ModelsMessage' (by applying it's required fields, if any) +mkModelsMessage + :: ModelsMessage +mkModelsMessage = + ModelsMessage + { modelsMessageMessage = Nothing + } + +-- ** ModelsProject +-- | ModelsProject +data ModelsProject = ModelsProject + { modelsProjectBackgroundBlurHash :: !(Maybe Text) -- ^ "background_blur_hash" - Contains a very small version of the project background to use as a blurry preview until the actual background is loaded. Check out https://blurha.sh/ to learn how it works. + , modelsProjectBackgroundInformation :: !(Maybe A.Value) -- ^ "background_information" - Holds extra information about the background set since some background providers require attribution or similar. If not null, the background can be accessed at /projects/{projectID}/background + , modelsProjectCreated :: !(Maybe Text) -- ^ "created" - A timestamp when this project was created. You cannot change this value. + , modelsProjectDescription :: !(Maybe Text) -- ^ "description" - The description of the project. + , modelsProjectHexColor :: !(Maybe Text) -- ^ "hex_color" - The hex color of this project + , modelsProjectId :: !(Maybe Int) -- ^ "id" - The unique, numeric id of this project. + , modelsProjectIdentifier :: !(Maybe Text) -- ^ "identifier" - The unique project short identifier. Used to build task identifiers. + , modelsProjectIsArchived :: !(Maybe Bool) -- ^ "is_archived" - Whether a project is archived. + , modelsProjectIsFavorite :: !(Maybe Bool) -- ^ "is_favorite" - True if a project is a favorite. Favorite projects show up in a separate parent project. This value depends on the user making the call to the api. + , modelsProjectOwner :: !(Maybe ModelsProjectOwner) -- ^ "owner" + , modelsProjectParentProjectId :: !(Maybe Int) -- ^ "parent_project_id" + , modelsProjectPosition :: !(Maybe Double) -- ^ "position" - The position this project has when querying all projects. See the tasks.position property on how to use this. + , modelsProjectSubscription :: !(Maybe ModelsProjectSubscription) -- ^ "subscription" + , modelsProjectTitle :: !(Maybe Text) -- ^ "title" - The title of the project. You'll see this in the overview. + , modelsProjectUpdated :: !(Maybe Text) -- ^ "updated" - A timestamp when this project was last updated. You cannot change this value. + , modelsProjectViews :: !(Maybe [ModelsProjectView]) -- ^ "views" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ModelsProject +instance A.FromJSON ModelsProject where + parseJSON = A.withObject "ModelsProject" $ \o -> + ModelsProject + <$> (o .:? "background_blur_hash") + <*> (o .:? "background_information") + <*> (o .:? "created") + <*> (o .:? "description") + <*> (o .:? "hex_color") + <*> (o .:? "id") + <*> (o .:? "identifier") + <*> (o .:? "is_archived") + <*> (o .:? "is_favorite") + <*> (o .:? "owner") + <*> (o .:? "parent_project_id") + <*> (o .:? "position") + <*> (o .:? "subscription") + <*> (o .:? "title") + <*> (o .:? "updated") + <*> (o .:? "views") + +-- | ToJSON ModelsProject +instance A.ToJSON ModelsProject where + toJSON ModelsProject {..} = + _omitNulls + [ "background_blur_hash" .= modelsProjectBackgroundBlurHash + , "background_information" .= modelsProjectBackgroundInformation + , "created" .= modelsProjectCreated + , "description" .= modelsProjectDescription + , "hex_color" .= modelsProjectHexColor + , "id" .= modelsProjectId + , "identifier" .= modelsProjectIdentifier + , "is_archived" .= modelsProjectIsArchived + , "is_favorite" .= modelsProjectIsFavorite + , "owner" .= modelsProjectOwner + , "parent_project_id" .= modelsProjectParentProjectId + , "position" .= modelsProjectPosition + , "subscription" .= modelsProjectSubscription + , "title" .= modelsProjectTitle + , "updated" .= modelsProjectUpdated + , "views" .= modelsProjectViews + ] + + +-- | Construct a value of type 'ModelsProject' (by applying it's required fields, if any) +mkModelsProject + :: ModelsProject +mkModelsProject = + ModelsProject + { modelsProjectBackgroundBlurHash = Nothing + , modelsProjectBackgroundInformation = Nothing + , modelsProjectCreated = Nothing + , modelsProjectDescription = Nothing + , modelsProjectHexColor = Nothing + , modelsProjectId = Nothing + , modelsProjectIdentifier = Nothing + , modelsProjectIsArchived = Nothing + , modelsProjectIsFavorite = Nothing + , modelsProjectOwner = Nothing + , modelsProjectParentProjectId = Nothing + , modelsProjectPosition = Nothing + , modelsProjectSubscription = Nothing + , modelsProjectTitle = Nothing + , modelsProjectUpdated = Nothing + , modelsProjectViews = Nothing + } + +-- ** ModelsProjectDuplicate +-- | ModelsProjectDuplicate +data ModelsProjectDuplicate = ModelsProjectDuplicate + { modelsProjectDuplicateDuplicatedProject :: !(Maybe ModelsProjectDuplicateDuplicatedProject) -- ^ "duplicated_project" + , modelsProjectDuplicateParentProjectId :: !(Maybe Int) -- ^ "parent_project_id" - The target parent project + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ModelsProjectDuplicate +instance A.FromJSON ModelsProjectDuplicate where + parseJSON = A.withObject "ModelsProjectDuplicate" $ \o -> + ModelsProjectDuplicate + <$> (o .:? "duplicated_project") + <*> (o .:? "parent_project_id") + +-- | ToJSON ModelsProjectDuplicate +instance A.ToJSON ModelsProjectDuplicate where + toJSON ModelsProjectDuplicate {..} = + _omitNulls + [ "duplicated_project" .= modelsProjectDuplicateDuplicatedProject + , "parent_project_id" .= modelsProjectDuplicateParentProjectId + ] + + +-- | Construct a value of type 'ModelsProjectDuplicate' (by applying it's required fields, if any) +mkModelsProjectDuplicate + :: ModelsProjectDuplicate +mkModelsProjectDuplicate = + ModelsProjectDuplicate + { modelsProjectDuplicateDuplicatedProject = Nothing + , modelsProjectDuplicateParentProjectId = Nothing + } + +-- ** ModelsProjectDuplicateDuplicatedProject +-- | ModelsProjectDuplicateDuplicatedProject +-- The copied project +data ModelsProjectDuplicateDuplicatedProject = ModelsProjectDuplicateDuplicatedProject + { modelsProjectDuplicateDuplicatedProjectBackgroundBlurHash :: !(Maybe Text) -- ^ "background_blur_hash" - Contains a very small version of the project background to use as a blurry preview until the actual background is loaded. Check out https://blurha.sh/ to learn how it works. + , modelsProjectDuplicateDuplicatedProjectBackgroundInformation :: !(Maybe A.Value) -- ^ "background_information" - Holds extra information about the background set since some background providers require attribution or similar. If not null, the background can be accessed at /projects/{projectID}/background + , modelsProjectDuplicateDuplicatedProjectCreated :: !(Maybe Text) -- ^ "created" - A timestamp when this project was created. You cannot change this value. + , modelsProjectDuplicateDuplicatedProjectDescription :: !(Maybe Text) -- ^ "description" - The description of the project. + , modelsProjectDuplicateDuplicatedProjectHexColor :: !(Maybe Text) -- ^ "hex_color" - The hex color of this project + , modelsProjectDuplicateDuplicatedProjectId :: !(Maybe Int) -- ^ "id" - The unique, numeric id of this project. + , modelsProjectDuplicateDuplicatedProjectIdentifier :: !(Maybe Text) -- ^ "identifier" - The unique project short identifier. Used to build task identifiers. + , modelsProjectDuplicateDuplicatedProjectIsArchived :: !(Maybe Bool) -- ^ "is_archived" - Whether a project is archived. + , modelsProjectDuplicateDuplicatedProjectIsFavorite :: !(Maybe Bool) -- ^ "is_favorite" - True if a project is a favorite. Favorite projects show up in a separate parent project. This value depends on the user making the call to the api. + , modelsProjectDuplicateDuplicatedProjectOwner :: !(Maybe ModelsProjectOwner) -- ^ "owner" + , modelsProjectDuplicateDuplicatedProjectParentProjectId :: !(Maybe Int) -- ^ "parent_project_id" + , modelsProjectDuplicateDuplicatedProjectPosition :: !(Maybe Double) -- ^ "position" - The position this project has when querying all projects. See the tasks.position property on how to use this. + , modelsProjectDuplicateDuplicatedProjectSubscription :: !(Maybe ModelsProjectSubscription) -- ^ "subscription" + , modelsProjectDuplicateDuplicatedProjectTitle :: !(Maybe Text) -- ^ "title" - The title of the project. You'll see this in the overview. + , modelsProjectDuplicateDuplicatedProjectUpdated :: !(Maybe Text) -- ^ "updated" - A timestamp when this project was last updated. You cannot change this value. + , modelsProjectDuplicateDuplicatedProjectViews :: !(Maybe [ModelsProjectView]) -- ^ "views" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ModelsProjectDuplicateDuplicatedProject +instance A.FromJSON ModelsProjectDuplicateDuplicatedProject where + parseJSON = A.withObject "ModelsProjectDuplicateDuplicatedProject" $ \o -> + ModelsProjectDuplicateDuplicatedProject + <$> (o .:? "background_blur_hash") + <*> (o .:? "background_information") + <*> (o .:? "created") + <*> (o .:? "description") + <*> (o .:? "hex_color") + <*> (o .:? "id") + <*> (o .:? "identifier") + <*> (o .:? "is_archived") + <*> (o .:? "is_favorite") + <*> (o .:? "owner") + <*> (o .:? "parent_project_id") + <*> (o .:? "position") + <*> (o .:? "subscription") + <*> (o .:? "title") + <*> (o .:? "updated") + <*> (o .:? "views") + +-- | ToJSON ModelsProjectDuplicateDuplicatedProject +instance A.ToJSON ModelsProjectDuplicateDuplicatedProject where + toJSON ModelsProjectDuplicateDuplicatedProject {..} = + _omitNulls + [ "background_blur_hash" .= modelsProjectDuplicateDuplicatedProjectBackgroundBlurHash + , "background_information" .= modelsProjectDuplicateDuplicatedProjectBackgroundInformation + , "created" .= modelsProjectDuplicateDuplicatedProjectCreated + , "description" .= modelsProjectDuplicateDuplicatedProjectDescription + , "hex_color" .= modelsProjectDuplicateDuplicatedProjectHexColor + , "id" .= modelsProjectDuplicateDuplicatedProjectId + , "identifier" .= modelsProjectDuplicateDuplicatedProjectIdentifier + , "is_archived" .= modelsProjectDuplicateDuplicatedProjectIsArchived + , "is_favorite" .= modelsProjectDuplicateDuplicatedProjectIsFavorite + , "owner" .= modelsProjectDuplicateDuplicatedProjectOwner + , "parent_project_id" .= modelsProjectDuplicateDuplicatedProjectParentProjectId + , "position" .= modelsProjectDuplicateDuplicatedProjectPosition + , "subscription" .= modelsProjectDuplicateDuplicatedProjectSubscription + , "title" .= modelsProjectDuplicateDuplicatedProjectTitle + , "updated" .= modelsProjectDuplicateDuplicatedProjectUpdated + , "views" .= modelsProjectDuplicateDuplicatedProjectViews + ] + + +-- | Construct a value of type 'ModelsProjectDuplicateDuplicatedProject' (by applying it's required fields, if any) +mkModelsProjectDuplicateDuplicatedProject + :: ModelsProjectDuplicateDuplicatedProject +mkModelsProjectDuplicateDuplicatedProject = + ModelsProjectDuplicateDuplicatedProject + { modelsProjectDuplicateDuplicatedProjectBackgroundBlurHash = Nothing + , modelsProjectDuplicateDuplicatedProjectBackgroundInformation = Nothing + , modelsProjectDuplicateDuplicatedProjectCreated = Nothing + , modelsProjectDuplicateDuplicatedProjectDescription = Nothing + , modelsProjectDuplicateDuplicatedProjectHexColor = Nothing + , modelsProjectDuplicateDuplicatedProjectId = Nothing + , modelsProjectDuplicateDuplicatedProjectIdentifier = Nothing + , modelsProjectDuplicateDuplicatedProjectIsArchived = Nothing + , modelsProjectDuplicateDuplicatedProjectIsFavorite = Nothing + , modelsProjectDuplicateDuplicatedProjectOwner = Nothing + , modelsProjectDuplicateDuplicatedProjectParentProjectId = Nothing + , modelsProjectDuplicateDuplicatedProjectPosition = Nothing + , modelsProjectDuplicateDuplicatedProjectSubscription = Nothing + , modelsProjectDuplicateDuplicatedProjectTitle = Nothing + , modelsProjectDuplicateDuplicatedProjectUpdated = Nothing + , modelsProjectDuplicateDuplicatedProjectViews = Nothing + } + +-- ** ModelsProjectOwner +-- | ModelsProjectOwner +-- The user who created this project. +data ModelsProjectOwner = ModelsProjectOwner + { modelsProjectOwnerCreated :: !(Maybe Text) -- ^ "created" - A timestamp when this task was created. You cannot change this value. + , modelsProjectOwnerEmail :: !(Maybe Text) -- ^ "email" - The user's email address. + , modelsProjectOwnerId :: !(Maybe Int) -- ^ "id" - The unique, numeric id of this user. + , modelsProjectOwnerName :: !(Maybe Text) -- ^ "name" - The full name of the user. + , modelsProjectOwnerUpdated :: !(Maybe Text) -- ^ "updated" - A timestamp when this task was last updated. You cannot change this value. + , modelsProjectOwnerUsername :: !(Maybe Text) -- ^ "username" - The username of the user. Is always unique. + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ModelsProjectOwner +instance A.FromJSON ModelsProjectOwner where + parseJSON = A.withObject "ModelsProjectOwner" $ \o -> + ModelsProjectOwner + <$> (o .:? "created") + <*> (o .:? "email") + <*> (o .:? "id") + <*> (o .:? "name") + <*> (o .:? "updated") + <*> (o .:? "username") + +-- | ToJSON ModelsProjectOwner +instance A.ToJSON ModelsProjectOwner where + toJSON ModelsProjectOwner {..} = + _omitNulls + [ "created" .= modelsProjectOwnerCreated + , "email" .= modelsProjectOwnerEmail + , "id" .= modelsProjectOwnerId + , "name" .= modelsProjectOwnerName + , "updated" .= modelsProjectOwnerUpdated + , "username" .= modelsProjectOwnerUsername + ] + + +-- | Construct a value of type 'ModelsProjectOwner' (by applying it's required fields, if any) +mkModelsProjectOwner + :: ModelsProjectOwner +mkModelsProjectOwner = + ModelsProjectOwner + { modelsProjectOwnerCreated = Nothing + , modelsProjectOwnerEmail = Nothing + , modelsProjectOwnerId = Nothing + , modelsProjectOwnerName = Nothing + , modelsProjectOwnerUpdated = Nothing + , modelsProjectOwnerUsername = Nothing + } + +-- ** ModelsProjectSubscription +-- | ModelsProjectSubscription +-- The subscription status for the user reading this project. You can only read this property, use the subscription endpoints to modify it. Will only returned when retreiving one project. +data ModelsProjectSubscription = ModelsProjectSubscription + { modelsProjectSubscriptionCreated :: !(Maybe Text) -- ^ "created" - A timestamp when this subscription was created. You cannot change this value. + , modelsProjectSubscriptionEntity :: !(Maybe Int) -- ^ "entity" + , modelsProjectSubscriptionEntityId :: !(Maybe Int) -- ^ "entity_id" - The id of the entity to subscribe to. + , modelsProjectSubscriptionId :: !(Maybe Int) -- ^ "id" - The numeric ID of the subscription + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ModelsProjectSubscription +instance A.FromJSON ModelsProjectSubscription where + parseJSON = A.withObject "ModelsProjectSubscription" $ \o -> + ModelsProjectSubscription + <$> (o .:? "created") + <*> (o .:? "entity") + <*> (o .:? "entity_id") + <*> (o .:? "id") + +-- | ToJSON ModelsProjectSubscription +instance A.ToJSON ModelsProjectSubscription where + toJSON ModelsProjectSubscription {..} = + _omitNulls + [ "created" .= modelsProjectSubscriptionCreated + , "entity" .= modelsProjectSubscriptionEntity + , "entity_id" .= modelsProjectSubscriptionEntityId + , "id" .= modelsProjectSubscriptionId + ] + + +-- | Construct a value of type 'ModelsProjectSubscription' (by applying it's required fields, if any) +mkModelsProjectSubscription + :: ModelsProjectSubscription +mkModelsProjectSubscription = + ModelsProjectSubscription + { modelsProjectSubscriptionCreated = Nothing + , modelsProjectSubscriptionEntity = Nothing + , modelsProjectSubscriptionEntityId = Nothing + , modelsProjectSubscriptionId = Nothing + } + +-- ** ModelsProjectUser +-- | ModelsProjectUser +data ModelsProjectUser = ModelsProjectUser + { modelsProjectUserCreated :: !(Maybe Text) -- ^ "created" - A timestamp when this relation was created. You cannot change this value. + , modelsProjectUserId :: !(Maybe Int) -- ^ "id" - The unique, numeric id of this project <-> user relation. + , modelsProjectUserRight :: !(Maybe ModelsRight) -- ^ "right" - The right this user has. 0 = Read only, 1 = Read & Write, 2 = Admin. See the docs for more details. + , modelsProjectUserUpdated :: !(Maybe Text) -- ^ "updated" - A timestamp when this relation was last updated. You cannot change this value. + , modelsProjectUserUserId :: !(Maybe Text) -- ^ "user_id" - The username. + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ModelsProjectUser +instance A.FromJSON ModelsProjectUser where + parseJSON = A.withObject "ModelsProjectUser" $ \o -> + ModelsProjectUser + <$> (o .:? "created") + <*> (o .:? "id") + <*> (o .:? "right") + <*> (o .:? "updated") + <*> (o .:? "user_id") + +-- | ToJSON ModelsProjectUser +instance A.ToJSON ModelsProjectUser where + toJSON ModelsProjectUser {..} = + _omitNulls + [ "created" .= modelsProjectUserCreated + , "id" .= modelsProjectUserId + , "right" .= modelsProjectUserRight + , "updated" .= modelsProjectUserUpdated + , "user_id" .= modelsProjectUserUserId + ] + + +-- | Construct a value of type 'ModelsProjectUser' (by applying it's required fields, if any) +mkModelsProjectUser + :: ModelsProjectUser +mkModelsProjectUser = + ModelsProjectUser + { modelsProjectUserCreated = Nothing + , modelsProjectUserId = Nothing + , modelsProjectUserRight = NothingNothing + , modelsProjectUserUpdated = Nothing + , modelsProjectUserUserId = Nothing + } + +-- ** ModelsProjectView +-- | ModelsProjectView +data ModelsProjectView = ModelsProjectView + { modelsProjectViewBucketConfiguration :: !(Maybe [ModelsProjectViewBucketConfiguration]) -- ^ "bucket_configuration" - When the bucket configuration mode is not `manual`, this field holds the options of that configuration. + , modelsProjectViewBucketConfigurationMode :: !(Maybe ModelsBucketConfigurationModeKind) -- ^ "bucket_configuration_mode" - The bucket configuration mode. Can be `none`, `manual` or `filter`. `manual` allows to move tasks between buckets as you normally would. `filter` creates buckets based on a filter for each bucket. + , modelsProjectViewCreated :: !(Maybe Text) -- ^ "created" - A timestamp when this reaction was created. You cannot change this value. + , modelsProjectViewDefaultBucketId :: !(Maybe Int) -- ^ "default_bucket_id" - The ID of the bucket where new tasks without a bucket are added to. By default, this is the leftmost bucket in a view. + , modelsProjectViewDoneBucketId :: !(Maybe Int) -- ^ "done_bucket_id" - If tasks are moved to the done bucket, they are marked as done. If they are marked as done individually, they are moved into the done bucket. + , modelsProjectViewFilter :: !(Maybe Text) -- ^ "filter" - The filter query to match tasks by. Check out https://vikunja.io/docs/filters for a full explanation. + , modelsProjectViewId :: !(Maybe Int) -- ^ "id" - The unique numeric id of this view + , modelsProjectViewPosition :: !(Maybe Double) -- ^ "position" - The position of this view in the list. The list of all views will be sorted by this parameter. + , modelsProjectViewProjectId :: !(Maybe Int) -- ^ "project_id" - The project this view belongs to + , modelsProjectViewTitle :: !(Maybe Text) -- ^ "title" - The title of this view + , modelsProjectViewUpdated :: !(Maybe Text) -- ^ "updated" - A timestamp when this view was updated. You cannot change this value. + , modelsProjectViewViewKind :: !(Maybe ModelsProjectViewKind) -- ^ "view_kind" - The kind of this view. Can be `list`, `gantt`, `table` or `kanban`. + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ModelsProjectView +instance A.FromJSON ModelsProjectView where + parseJSON = A.withObject "ModelsProjectView" $ \o -> + ModelsProjectView + <$> (o .:? "bucket_configuration") + <*> (o .:? "bucket_configuration_mode") + <*> (o .:? "created") + <*> (o .:? "default_bucket_id") + <*> (o .:? "done_bucket_id") + <*> (o .:? "filter") + <*> (o .:? "id") + <*> (o .:? "position") + <*> (o .:? "project_id") + <*> (o .:? "title") + <*> (o .:? "updated") + <*> (o .:? "view_kind") + +-- | ToJSON ModelsProjectView +instance A.ToJSON ModelsProjectView where + toJSON ModelsProjectView {..} = + _omitNulls + [ "bucket_configuration" .= modelsProjectViewBucketConfiguration + , "bucket_configuration_mode" .= modelsProjectViewBucketConfigurationMode + , "created" .= modelsProjectViewCreated + , "default_bucket_id" .= modelsProjectViewDefaultBucketId + , "done_bucket_id" .= modelsProjectViewDoneBucketId + , "filter" .= modelsProjectViewFilter + , "id" .= modelsProjectViewId + , "position" .= modelsProjectViewPosition + , "project_id" .= modelsProjectViewProjectId + , "title" .= modelsProjectViewTitle + , "updated" .= modelsProjectViewUpdated + , "view_kind" .= modelsProjectViewViewKind + ] + + +-- | Construct a value of type 'ModelsProjectView' (by applying it's required fields, if any) +mkModelsProjectView + :: ModelsProjectView +mkModelsProjectView = + ModelsProjectView + { modelsProjectViewBucketConfiguration = Nothing + , modelsProjectViewBucketConfigurationMode = NothingNothing + , modelsProjectViewCreated = Nothing + , modelsProjectViewDefaultBucketId = Nothing + , modelsProjectViewDoneBucketId = Nothing + , modelsProjectViewFilter = Nothing + , modelsProjectViewId = Nothing + , modelsProjectViewPosition = Nothing + , modelsProjectViewProjectId = Nothing + , modelsProjectViewTitle = Nothing + , modelsProjectViewUpdated = Nothing + , modelsProjectViewViewKind = NothingNothing + } + +-- ** ModelsProjectViewBucketConfiguration +-- | ModelsProjectViewBucketConfiguration +data ModelsProjectViewBucketConfiguration = ModelsProjectViewBucketConfiguration + { modelsProjectViewBucketConfigurationFilter :: !(Maybe Text) -- ^ "filter" + , modelsProjectViewBucketConfigurationTitle :: !(Maybe Text) -- ^ "title" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ModelsProjectViewBucketConfiguration +instance A.FromJSON ModelsProjectViewBucketConfiguration where + parseJSON = A.withObject "ModelsProjectViewBucketConfiguration" $ \o -> + ModelsProjectViewBucketConfiguration + <$> (o .:? "filter") + <*> (o .:? "title") + +-- | ToJSON ModelsProjectViewBucketConfiguration +instance A.ToJSON ModelsProjectViewBucketConfiguration where + toJSON ModelsProjectViewBucketConfiguration {..} = + _omitNulls + [ "filter" .= modelsProjectViewBucketConfigurationFilter + , "title" .= modelsProjectViewBucketConfigurationTitle + ] + + +-- | Construct a value of type 'ModelsProjectViewBucketConfiguration' (by applying it's required fields, if any) +mkModelsProjectViewBucketConfiguration + :: ModelsProjectViewBucketConfiguration +mkModelsProjectViewBucketConfiguration = + ModelsProjectViewBucketConfiguration + { modelsProjectViewBucketConfigurationFilter = Nothing + , modelsProjectViewBucketConfigurationTitle = Nothing + } + +-- ** ModelsReaction +-- | ModelsReaction +data ModelsReaction = ModelsReaction + { modelsReactionCreated :: !(Maybe Text) -- ^ "created" - A timestamp when this reaction was created. You cannot change this value. + , modelsReactionUser :: !(Maybe ModelsReactionUser) -- ^ "user" + , modelsReactionValue :: !(Maybe Text) -- ^ "value" - The actual reaction. This can be any valid utf character or text, up to a length of 20. + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ModelsReaction +instance A.FromJSON ModelsReaction where + parseJSON = A.withObject "ModelsReaction" $ \o -> + ModelsReaction + <$> (o .:? "created") + <*> (o .:? "user") + <*> (o .:? "value") + +-- | ToJSON ModelsReaction +instance A.ToJSON ModelsReaction where + toJSON ModelsReaction {..} = + _omitNulls + [ "created" .= modelsReactionCreated + , "user" .= modelsReactionUser + , "value" .= modelsReactionValue + ] + + +-- | Construct a value of type 'ModelsReaction' (by applying it's required fields, if any) +mkModelsReaction + :: ModelsReaction +mkModelsReaction = + ModelsReaction + { modelsReactionCreated = Nothing + , modelsReactionUser = Nothing + , modelsReactionValue = Nothing + } + +-- ** ModelsReactionUser +-- | ModelsReactionUser +-- The user who reacted +data ModelsReactionUser = ModelsReactionUser + { modelsReactionUserCreated :: !(Maybe Text) -- ^ "created" - A timestamp when this task was created. You cannot change this value. + , modelsReactionUserEmail :: !(Maybe Text) -- ^ "email" - The user's email address. + , modelsReactionUserId :: !(Maybe Int) -- ^ "id" - The unique, numeric id of this user. + , modelsReactionUserName :: !(Maybe Text) -- ^ "name" - The full name of the user. + , modelsReactionUserUpdated :: !(Maybe Text) -- ^ "updated" - A timestamp when this task was last updated. You cannot change this value. + , modelsReactionUserUsername :: !(Maybe Text) -- ^ "username" - The username of the user. Is always unique. + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ModelsReactionUser +instance A.FromJSON ModelsReactionUser where + parseJSON = A.withObject "ModelsReactionUser" $ \o -> + ModelsReactionUser + <$> (o .:? "created") + <*> (o .:? "email") + <*> (o .:? "id") + <*> (o .:? "name") + <*> (o .:? "updated") + <*> (o .:? "username") + +-- | ToJSON ModelsReactionUser +instance A.ToJSON ModelsReactionUser where + toJSON ModelsReactionUser {..} = + _omitNulls + [ "created" .= modelsReactionUserCreated + , "email" .= modelsReactionUserEmail + , "id" .= modelsReactionUserId + , "name" .= modelsReactionUserName + , "updated" .= modelsReactionUserUpdated + , "username" .= modelsReactionUserUsername + ] + + +-- | Construct a value of type 'ModelsReactionUser' (by applying it's required fields, if any) +mkModelsReactionUser + :: ModelsReactionUser +mkModelsReactionUser = + ModelsReactionUser + { modelsReactionUserCreated = Nothing + , modelsReactionUserEmail = Nothing + , modelsReactionUserId = Nothing + , modelsReactionUserName = Nothing + , modelsReactionUserUpdated = Nothing + , modelsReactionUserUsername = Nothing + } + +-- ** ModelsRouteDetail +-- | ModelsRouteDetail +data ModelsRouteDetail = ModelsRouteDetail + { modelsRouteDetailMethod :: !(Maybe Text) -- ^ "method" + , modelsRouteDetailPath :: !(Maybe Text) -- ^ "path" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ModelsRouteDetail +instance A.FromJSON ModelsRouteDetail where + parseJSON = A.withObject "ModelsRouteDetail" $ \o -> + ModelsRouteDetail + <$> (o .:? "method") + <*> (o .:? "path") + +-- | ToJSON ModelsRouteDetail +instance A.ToJSON ModelsRouteDetail where + toJSON ModelsRouteDetail {..} = + _omitNulls + [ "method" .= modelsRouteDetailMethod + , "path" .= modelsRouteDetailPath + ] + + +-- | Construct a value of type 'ModelsRouteDetail' (by applying it's required fields, if any) +mkModelsRouteDetail + :: ModelsRouteDetail +mkModelsRouteDetail = + ModelsRouteDetail + { modelsRouteDetailMethod = Nothing + , modelsRouteDetailPath = Nothing + } + +-- ** ModelsSavedFilter +-- | ModelsSavedFilter +data ModelsSavedFilter = ModelsSavedFilter + { modelsSavedFilterCreated :: !(Maybe Text) -- ^ "created" - A timestamp when this filter was created. You cannot change this value. + , modelsSavedFilterDescription :: !(Maybe Text) -- ^ "description" - The description of the filter + , modelsSavedFilterFilters :: !(Maybe ModelsSavedFilterFilters) -- ^ "filters" + , modelsSavedFilterId :: !(Maybe Int) -- ^ "id" - The unique numeric id of this saved filter + , modelsSavedFilterIsFavorite :: !(Maybe Bool) -- ^ "is_favorite" - True if the filter is a favorite. Favorite filters show up in a separate parent project together with favorite projects. + , modelsSavedFilterOwner :: !(Maybe ModelsSavedFilterOwner) -- ^ "owner" + , modelsSavedFilterTitle :: !(Maybe Text) -- ^ "title" - The title of the filter. + , modelsSavedFilterUpdated :: !(Maybe Text) -- ^ "updated" - A timestamp when this filter was last updated. You cannot change this value. + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ModelsSavedFilter +instance A.FromJSON ModelsSavedFilter where + parseJSON = A.withObject "ModelsSavedFilter" $ \o -> + ModelsSavedFilter + <$> (o .:? "created") + <*> (o .:? "description") + <*> (o .:? "filters") + <*> (o .:? "id") + <*> (o .:? "is_favorite") + <*> (o .:? "owner") + <*> (o .:? "title") + <*> (o .:? "updated") + +-- | ToJSON ModelsSavedFilter +instance A.ToJSON ModelsSavedFilter where + toJSON ModelsSavedFilter {..} = + _omitNulls + [ "created" .= modelsSavedFilterCreated + , "description" .= modelsSavedFilterDescription + , "filters" .= modelsSavedFilterFilters + , "id" .= modelsSavedFilterId + , "is_favorite" .= modelsSavedFilterIsFavorite + , "owner" .= modelsSavedFilterOwner + , "title" .= modelsSavedFilterTitle + , "updated" .= modelsSavedFilterUpdated + ] + + +-- | Construct a value of type 'ModelsSavedFilter' (by applying it's required fields, if any) +mkModelsSavedFilter + :: ModelsSavedFilter +mkModelsSavedFilter = + ModelsSavedFilter + { modelsSavedFilterCreated = Nothing + , modelsSavedFilterDescription = Nothing + , modelsSavedFilterFilters = Nothing + , modelsSavedFilterId = Nothing + , modelsSavedFilterIsFavorite = Nothing + , modelsSavedFilterOwner = Nothing + , modelsSavedFilterTitle = Nothing + , modelsSavedFilterUpdated = Nothing + } + +-- ** ModelsSavedFilterFilters +-- | ModelsSavedFilterFilters +-- The actual filters this filter contains +data ModelsSavedFilterFilters = ModelsSavedFilterFilters + { modelsSavedFilterFiltersFilter :: !(Maybe Text) -- ^ "filter" - The filter query to match tasks by. Check out https://vikunja.io/docs/filters for a full explanation. + , modelsSavedFilterFiltersFilterIncludeNulls :: !(Maybe Bool) -- ^ "filter_include_nulls" - If set to true, the result will also include null values + , modelsSavedFilterFiltersOrderBy :: !(Maybe [Text]) -- ^ "order_by" - The query parameter to order the items by. This can be either asc or desc, with asc being the default. + , modelsSavedFilterFiltersSortBy :: !(Maybe [Text]) -- ^ "sort_by" - The query parameter to sort by. This is for ex. done, priority, etc. + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ModelsSavedFilterFilters +instance A.FromJSON ModelsSavedFilterFilters where + parseJSON = A.withObject "ModelsSavedFilterFilters" $ \o -> + ModelsSavedFilterFilters + <$> (o .:? "filter") + <*> (o .:? "filter_include_nulls") + <*> (o .:? "order_by") + <*> (o .:? "sort_by") + +-- | ToJSON ModelsSavedFilterFilters +instance A.ToJSON ModelsSavedFilterFilters where + toJSON ModelsSavedFilterFilters {..} = + _omitNulls + [ "filter" .= modelsSavedFilterFiltersFilter + , "filter_include_nulls" .= modelsSavedFilterFiltersFilterIncludeNulls + , "order_by" .= modelsSavedFilterFiltersOrderBy + , "sort_by" .= modelsSavedFilterFiltersSortBy + ] + + +-- | Construct a value of type 'ModelsSavedFilterFilters' (by applying it's required fields, if any) +mkModelsSavedFilterFilters + :: ModelsSavedFilterFilters +mkModelsSavedFilterFilters = + ModelsSavedFilterFilters + { modelsSavedFilterFiltersFilter = Nothing + , modelsSavedFilterFiltersFilterIncludeNulls = Nothing + , modelsSavedFilterFiltersOrderBy = Nothing + , modelsSavedFilterFiltersSortBy = Nothing + } + +-- ** ModelsSavedFilterOwner +-- | ModelsSavedFilterOwner +-- The user who owns this filter +data ModelsSavedFilterOwner = ModelsSavedFilterOwner + { modelsSavedFilterOwnerCreated :: !(Maybe Text) -- ^ "created" - A timestamp when this task was created. You cannot change this value. + , modelsSavedFilterOwnerEmail :: !(Maybe Text) -- ^ "email" - The user's email address. + , modelsSavedFilterOwnerId :: !(Maybe Int) -- ^ "id" - The unique, numeric id of this user. + , modelsSavedFilterOwnerName :: !(Maybe Text) -- ^ "name" - The full name of the user. + , modelsSavedFilterOwnerUpdated :: !(Maybe Text) -- ^ "updated" - A timestamp when this task was last updated. You cannot change this value. + , modelsSavedFilterOwnerUsername :: !(Maybe Text) -- ^ "username" - The username of the user. Is always unique. + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ModelsSavedFilterOwner +instance A.FromJSON ModelsSavedFilterOwner where + parseJSON = A.withObject "ModelsSavedFilterOwner" $ \o -> + ModelsSavedFilterOwner + <$> (o .:? "created") + <*> (o .:? "email") + <*> (o .:? "id") + <*> (o .:? "name") + <*> (o .:? "updated") + <*> (o .:? "username") + +-- | ToJSON ModelsSavedFilterOwner +instance A.ToJSON ModelsSavedFilterOwner where + toJSON ModelsSavedFilterOwner {..} = + _omitNulls + [ "created" .= modelsSavedFilterOwnerCreated + , "email" .= modelsSavedFilterOwnerEmail + , "id" .= modelsSavedFilterOwnerId + , "name" .= modelsSavedFilterOwnerName + , "updated" .= modelsSavedFilterOwnerUpdated + , "username" .= modelsSavedFilterOwnerUsername + ] + + +-- | Construct a value of type 'ModelsSavedFilterOwner' (by applying it's required fields, if any) +mkModelsSavedFilterOwner + :: ModelsSavedFilterOwner +mkModelsSavedFilterOwner = + ModelsSavedFilterOwner + { modelsSavedFilterOwnerCreated = Nothing + , modelsSavedFilterOwnerEmail = Nothing + , modelsSavedFilterOwnerId = Nothing + , modelsSavedFilterOwnerName = Nothing + , modelsSavedFilterOwnerUpdated = Nothing + , modelsSavedFilterOwnerUsername = Nothing + } + +-- ** ModelsSubscription +-- | ModelsSubscription +data ModelsSubscription = ModelsSubscription + { modelsSubscriptionCreated :: !(Maybe Text) -- ^ "created" - A timestamp when this subscription was created. You cannot change this value. + , modelsSubscriptionEntity :: !(Maybe Int) -- ^ "entity" + , modelsSubscriptionEntityId :: !(Maybe Int) -- ^ "entity_id" - The id of the entity to subscribe to. + , modelsSubscriptionId :: !(Maybe Int) -- ^ "id" - The numeric ID of the subscription + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ModelsSubscription +instance A.FromJSON ModelsSubscription where + parseJSON = A.withObject "ModelsSubscription" $ \o -> + ModelsSubscription + <$> (o .:? "created") + <*> (o .:? "entity") + <*> (o .:? "entity_id") + <*> (o .:? "id") + +-- | ToJSON ModelsSubscription +instance A.ToJSON ModelsSubscription where + toJSON ModelsSubscription {..} = + _omitNulls + [ "created" .= modelsSubscriptionCreated + , "entity" .= modelsSubscriptionEntity + , "entity_id" .= modelsSubscriptionEntityId + , "id" .= modelsSubscriptionId + ] + + +-- | Construct a value of type 'ModelsSubscription' (by applying it's required fields, if any) +mkModelsSubscription + :: ModelsSubscription +mkModelsSubscription = + ModelsSubscription + { modelsSubscriptionCreated = Nothing + , modelsSubscriptionEntity = Nothing + , modelsSubscriptionEntityId = Nothing + , modelsSubscriptionId = Nothing + } + +-- ** ModelsTask +-- | ModelsTask +data ModelsTask = ModelsTask + { modelsTaskAssignees :: !(Maybe [UserUser]) -- ^ "assignees" - An array of users who are assigned to this task + , modelsTaskAttachments :: !(Maybe [ModelsTaskAttachment]) -- ^ "attachments" - All attachments this task has. This property is read-onlym, you must use the separate endpoint to add attachments to a task. + , modelsTaskBucketId :: !(Maybe Int) -- ^ "bucket_id" - The bucket id. Will only be populated when the task is accessed via a view with buckets. Can be used to move a task between buckets. In that case, the new bucket must be in the same view as the old one. + , modelsTaskCoverImageAttachmentId :: !(Maybe Int) -- ^ "cover_image_attachment_id" - If this task has a cover image, the field will return the id of the attachment that is the cover image. + , modelsTaskCreated :: !(Maybe Text) -- ^ "created" - A timestamp when this task was created. You cannot change this value. + , modelsTaskCreatedBy :: !(Maybe ModelsBulkTaskCreatedBy) -- ^ "created_by" + , modelsTaskDescription :: !(Maybe Text) -- ^ "description" - The task description. + , modelsTaskDone :: !(Maybe Bool) -- ^ "done" - Whether a task is done or not. + , modelsTaskDoneAt :: !(Maybe Text) -- ^ "done_at" - The time when a task was marked as done. + , modelsTaskDueDate :: !(Maybe Text) -- ^ "due_date" - The time when the task is due. + , modelsTaskEndDate :: !(Maybe Text) -- ^ "end_date" - When this task ends. + , modelsTaskHexColor :: !(Maybe Text) -- ^ "hex_color" - The task color in hex + , modelsTaskId :: !(Maybe Int) -- ^ "id" - The unique, numeric id of this task. + , modelsTaskIdentifier :: !(Maybe Text) -- ^ "identifier" - The task identifier, based on the project identifier and the task's index + , modelsTaskIndex :: !(Maybe Int) -- ^ "index" - The task index, calculated per project + , modelsTaskIsFavorite :: !(Maybe Bool) -- ^ "is_favorite" - True if a task is a favorite task. Favorite tasks show up in a separate \"Important\" project. This value depends on the user making the call to the api. + , modelsTaskLabels :: !(Maybe [ModelsLabel]) -- ^ "labels" - An array of labels which are associated with this task. This property is read-only, you must use the separate endpoint to add labels to a task. + , modelsTaskPercentDone :: !(Maybe Double) -- ^ "percent_done" - Determines how far a task is left from being done + , modelsTaskPosition :: !(Maybe Double) -- ^ "position" - The position of the task - any task project can be sorted as usual by this parameter. When accessing tasks via views with buckets, this is primarily used to sort them based on a range. Positions are always saved per view. They will automatically be set if you request the tasks through a view endpoint, otherwise they will always be 0. To update them, take a look at the Task Position endpoint. + , modelsTaskPriority :: !(Maybe Int) -- ^ "priority" - The task priority. Can be anything you want, it is possible to sort by this later. + , modelsTaskProjectId :: !(Maybe Int) -- ^ "project_id" - The project this task belongs to. + , modelsTaskReactions :: !(Maybe Map) -- ^ "reactions" - Reactions on that task. + , modelsTaskRelatedTasks :: !(Maybe Map) -- ^ "related_tasks" - All related tasks, grouped by their relation kind + , modelsTaskReminders :: !(Maybe [ModelsTaskReminder]) -- ^ "reminders" - An array of reminders that are associated with this task. + , modelsTaskRepeatAfter :: !(Maybe Int) -- ^ "repeat_after" - 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. + , modelsTaskRepeatMode :: !(Maybe ModelsTaskRepeatMode) -- ^ "repeat_mode" - Can have three possible values which will trigger when the task is marked as done: 0 = repeats after the amount specified in repeat_after, 1 = repeats all dates each months (ignoring repeat_after), 3 = repeats from the current date rather than the last set date. + , modelsTaskStartDate :: !(Maybe Text) -- ^ "start_date" - When this task starts. + , modelsTaskSubscription :: !(Maybe ModelsBulkTaskSubscription) -- ^ "subscription" + , modelsTaskTitle :: !(Maybe Text) -- ^ "title" - The task text. This is what you'll see in the project. + , modelsTaskUpdated :: !(Maybe Text) -- ^ "updated" - A timestamp when this task was last updated. You cannot change this value. + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ModelsTask +instance A.FromJSON ModelsTask where + parseJSON = A.withObject "ModelsTask" $ \o -> + ModelsTask + <$> (o .:? "assignees") + <*> (o .:? "attachments") + <*> (o .:? "bucket_id") + <*> (o .:? "cover_image_attachment_id") + <*> (o .:? "created") + <*> (o .:? "created_by") + <*> (o .:? "description") + <*> (o .:? "done") + <*> (o .:? "done_at") + <*> (o .:? "due_date") + <*> (o .:? "end_date") + <*> (o .:? "hex_color") + <*> (o .:? "id") + <*> (o .:? "identifier") + <*> (o .:? "index") + <*> (o .:? "is_favorite") + <*> (o .:? "labels") + <*> (o .:? "percent_done") + <*> (o .:? "position") + <*> (o .:? "priority") + <*> (o .:? "project_id") + <*> (o .:? "reactions") + <*> (o .:? "related_tasks") + <*> (o .:? "reminders") + <*> (o .:? "repeat_after") + <*> (o .:? "repeat_mode") + <*> (o .:? "start_date") + <*> (o .:? "subscription") + <*> (o .:? "title") + <*> (o .:? "updated") + +-- | ToJSON ModelsTask +instance A.ToJSON ModelsTask where + toJSON ModelsTask {..} = + _omitNulls + [ "assignees" .= modelsTaskAssignees + , "attachments" .= modelsTaskAttachments + , "bucket_id" .= modelsTaskBucketId + , "cover_image_attachment_id" .= modelsTaskCoverImageAttachmentId + , "created" .= modelsTaskCreated + , "created_by" .= modelsTaskCreatedBy + , "description" .= modelsTaskDescription + , "done" .= modelsTaskDone + , "done_at" .= modelsTaskDoneAt + , "due_date" .= modelsTaskDueDate + , "end_date" .= modelsTaskEndDate + , "hex_color" .= modelsTaskHexColor + , "id" .= modelsTaskId + , "identifier" .= modelsTaskIdentifier + , "index" .= modelsTaskIndex + , "is_favorite" .= modelsTaskIsFavorite + , "labels" .= modelsTaskLabels + , "percent_done" .= modelsTaskPercentDone + , "position" .= modelsTaskPosition + , "priority" .= modelsTaskPriority + , "project_id" .= modelsTaskProjectId + , "reactions" .= modelsTaskReactions + , "related_tasks" .= modelsTaskRelatedTasks + , "reminders" .= modelsTaskReminders + , "repeat_after" .= modelsTaskRepeatAfter + , "repeat_mode" .= modelsTaskRepeatMode + , "start_date" .= modelsTaskStartDate + , "subscription" .= modelsTaskSubscription + , "title" .= modelsTaskTitle + , "updated" .= modelsTaskUpdated + ] + + +-- | Construct a value of type 'ModelsTask' (by applying it's required fields, if any) +mkModelsTask + :: ModelsTask +mkModelsTask = + ModelsTask + { modelsTaskAssignees = Nothing + , modelsTaskAttachments = Nothing + , modelsTaskBucketId = Nothing + , modelsTaskCoverImageAttachmentId = Nothing + , modelsTaskCreated = Nothing + , modelsTaskCreatedBy = Nothing + , modelsTaskDescription = Nothing + , modelsTaskDone = Nothing + , modelsTaskDoneAt = Nothing + , modelsTaskDueDate = Nothing + , modelsTaskEndDate = Nothing + , modelsTaskHexColor = Nothing + , modelsTaskId = Nothing + , modelsTaskIdentifier = Nothing + , modelsTaskIndex = Nothing + , modelsTaskIsFavorite = Nothing + , modelsTaskLabels = Nothing + , modelsTaskPercentDone = Nothing + , modelsTaskPosition = Nothing + , modelsTaskPriority = Nothing + , modelsTaskProjectId = Nothing + , modelsTaskReactions = NothingNothing + , modelsTaskRelatedTasks = NothingNothing + , modelsTaskReminders = Nothing + , modelsTaskRepeatAfter = Nothing + , modelsTaskRepeatMode = NothingNothing + , modelsTaskStartDate = Nothing + , modelsTaskSubscription = Nothing + , modelsTaskTitle = Nothing + , modelsTaskUpdated = Nothing + } + +-- ** ModelsTaskAssginee +-- | ModelsTaskAssginee +data ModelsTaskAssginee = ModelsTaskAssginee + { modelsTaskAssgineeCreated :: !(Maybe Text) -- ^ "created" + , modelsTaskAssgineeUserId :: !(Maybe Int) -- ^ "user_id" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ModelsTaskAssginee +instance A.FromJSON ModelsTaskAssginee where + parseJSON = A.withObject "ModelsTaskAssginee" $ \o -> + ModelsTaskAssginee + <$> (o .:? "created") + <*> (o .:? "user_id") + +-- | ToJSON ModelsTaskAssginee +instance A.ToJSON ModelsTaskAssginee where + toJSON ModelsTaskAssginee {..} = + _omitNulls + [ "created" .= modelsTaskAssgineeCreated + , "user_id" .= modelsTaskAssgineeUserId + ] + + +-- | Construct a value of type 'ModelsTaskAssginee' (by applying it's required fields, if any) +mkModelsTaskAssginee + :: ModelsTaskAssginee +mkModelsTaskAssginee = + ModelsTaskAssginee + { modelsTaskAssgineeCreated = Nothing + , modelsTaskAssgineeUserId = Nothing + } + +-- ** ModelsTaskAttachment +-- | ModelsTaskAttachment +data ModelsTaskAttachment = ModelsTaskAttachment + { modelsTaskAttachmentCreated :: !(Maybe Text) -- ^ "created" + , modelsTaskAttachmentCreatedBy :: !(Maybe UserUser) -- ^ "created_by" + , modelsTaskAttachmentFile :: !(Maybe FilesFile) -- ^ "file" + , modelsTaskAttachmentId :: !(Maybe Int) -- ^ "id" + , modelsTaskAttachmentTaskId :: !(Maybe Int) -- ^ "task_id" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ModelsTaskAttachment +instance A.FromJSON ModelsTaskAttachment where + parseJSON = A.withObject "ModelsTaskAttachment" $ \o -> + ModelsTaskAttachment + <$> (o .:? "created") + <*> (o .:? "created_by") + <*> (o .:? "file") + <*> (o .:? "id") + <*> (o .:? "task_id") + +-- | ToJSON ModelsTaskAttachment +instance A.ToJSON ModelsTaskAttachment where + toJSON ModelsTaskAttachment {..} = + _omitNulls + [ "created" .= modelsTaskAttachmentCreated + , "created_by" .= modelsTaskAttachmentCreatedBy + , "file" .= modelsTaskAttachmentFile + , "id" .= modelsTaskAttachmentId + , "task_id" .= modelsTaskAttachmentTaskId + ] + + +-- | Construct a value of type 'ModelsTaskAttachment' (by applying it's required fields, if any) +mkModelsTaskAttachment + :: ModelsTaskAttachment +mkModelsTaskAttachment = + ModelsTaskAttachment + { modelsTaskAttachmentCreated = Nothing + , modelsTaskAttachmentCreatedBy = Nothing + , modelsTaskAttachmentFile = Nothing + , modelsTaskAttachmentId = Nothing + , modelsTaskAttachmentTaskId = Nothing + } + +-- ** ModelsTaskBucket +-- | ModelsTaskBucket +data ModelsTaskBucket = ModelsTaskBucket + { modelsTaskBucketBucketId :: !(Maybe Int) -- ^ "bucket_id" + , modelsTaskBucketProjectViewId :: !(Maybe Int) -- ^ "project_view_id" + , modelsTaskBucketTaskDone :: !(Maybe Bool) -- ^ "task_done" + , modelsTaskBucketTaskId :: !(Maybe Int) -- ^ "task_id" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ModelsTaskBucket +instance A.FromJSON ModelsTaskBucket where + parseJSON = A.withObject "ModelsTaskBucket" $ \o -> + ModelsTaskBucket + <$> (o .:? "bucket_id") + <*> (o .:? "project_view_id") + <*> (o .:? "task_done") + <*> (o .:? "task_id") + +-- | ToJSON ModelsTaskBucket +instance A.ToJSON ModelsTaskBucket where + toJSON ModelsTaskBucket {..} = + _omitNulls + [ "bucket_id" .= modelsTaskBucketBucketId + , "project_view_id" .= modelsTaskBucketProjectViewId + , "task_done" .= modelsTaskBucketTaskDone + , "task_id" .= modelsTaskBucketTaskId + ] + + +-- | Construct a value of type 'ModelsTaskBucket' (by applying it's required fields, if any) +mkModelsTaskBucket + :: ModelsTaskBucket +mkModelsTaskBucket = + ModelsTaskBucket + { modelsTaskBucketBucketId = Nothing + , modelsTaskBucketProjectViewId = Nothing + , modelsTaskBucketTaskDone = Nothing + , modelsTaskBucketTaskId = Nothing + } + +-- ** ModelsTaskCollection +-- | ModelsTaskCollection +data ModelsTaskCollection = ModelsTaskCollection + { modelsTaskCollectionFilter :: !(Maybe Text) -- ^ "filter" - The filter query to match tasks by. Check out https://vikunja.io/docs/filters for a full explanation. + , modelsTaskCollectionFilterIncludeNulls :: !(Maybe Bool) -- ^ "filter_include_nulls" - If set to true, the result will also include null values + , modelsTaskCollectionOrderBy :: !(Maybe [Text]) -- ^ "order_by" - The query parameter to order the items by. This can be either asc or desc, with asc being the default. + , modelsTaskCollectionSortBy :: !(Maybe [Text]) -- ^ "sort_by" - The query parameter to sort by. This is for ex. done, priority, etc. + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ModelsTaskCollection +instance A.FromJSON ModelsTaskCollection where + parseJSON = A.withObject "ModelsTaskCollection" $ \o -> + ModelsTaskCollection + <$> (o .:? "filter") + <*> (o .:? "filter_include_nulls") + <*> (o .:? "order_by") + <*> (o .:? "sort_by") + +-- | ToJSON ModelsTaskCollection +instance A.ToJSON ModelsTaskCollection where + toJSON ModelsTaskCollection {..} = + _omitNulls + [ "filter" .= modelsTaskCollectionFilter + , "filter_include_nulls" .= modelsTaskCollectionFilterIncludeNulls + , "order_by" .= modelsTaskCollectionOrderBy + , "sort_by" .= modelsTaskCollectionSortBy + ] + + +-- | Construct a value of type 'ModelsTaskCollection' (by applying it's required fields, if any) +mkModelsTaskCollection + :: ModelsTaskCollection +mkModelsTaskCollection = + ModelsTaskCollection + { modelsTaskCollectionFilter = Nothing + , modelsTaskCollectionFilterIncludeNulls = Nothing + , modelsTaskCollectionOrderBy = Nothing + , modelsTaskCollectionSortBy = Nothing + } + +-- ** ModelsTaskComment +-- | ModelsTaskComment +data ModelsTaskComment = ModelsTaskComment + { modelsTaskCommentAuthor :: !(Maybe UserUser) -- ^ "author" + , modelsTaskCommentComment :: !(Maybe Text) -- ^ "comment" + , modelsTaskCommentCreated :: !(Maybe Text) -- ^ "created" + , modelsTaskCommentId :: !(Maybe Int) -- ^ "id" + , modelsTaskCommentReactions :: !(Maybe (Map.Map String [UserUser])) -- ^ "reactions" + , modelsTaskCommentUpdated :: !(Maybe Text) -- ^ "updated" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ModelsTaskComment +instance A.FromJSON ModelsTaskComment where + parseJSON = A.withObject "ModelsTaskComment" $ \o -> + ModelsTaskComment + <$> (o .:? "author") + <*> (o .:? "comment") + <*> (o .:? "created") + <*> (o .:? "id") + <*> (o .:? "reactions") + <*> (o .:? "updated") + +-- | ToJSON ModelsTaskComment +instance A.ToJSON ModelsTaskComment where + toJSON ModelsTaskComment {..} = + _omitNulls + [ "author" .= modelsTaskCommentAuthor + , "comment" .= modelsTaskCommentComment + , "created" .= modelsTaskCommentCreated + , "id" .= modelsTaskCommentId + , "reactions" .= modelsTaskCommentReactions + , "updated" .= modelsTaskCommentUpdated + ] + + +-- | Construct a value of type 'ModelsTaskComment' (by applying it's required fields, if any) +mkModelsTaskComment + :: ModelsTaskComment +mkModelsTaskComment = + ModelsTaskComment + { modelsTaskCommentAuthor = Nothing + , modelsTaskCommentComment = Nothing + , modelsTaskCommentCreated = Nothing + , modelsTaskCommentId = Nothing + , modelsTaskCommentReactions = Nothing + , modelsTaskCommentUpdated = Nothing + } + +-- ** ModelsTaskPosition +-- | ModelsTaskPosition +data ModelsTaskPosition = ModelsTaskPosition + { modelsTaskPositionPosition :: !(Maybe Double) -- ^ "position" - The position of the task - any task project can be sorted as usual by this parameter. When accessing tasks via kanban buckets, this is primarily used to sort them based on a range We're using a float64 here to make it possible to put any task within any two other tasks (by changing the number). You would calculate the new position between two tasks with something like task3.position = (task2.position - task1.position) / 2. A 64-Bit float leaves plenty of room to initially give tasks a position with 2^16 difference to the previous task which also leaves a lot of room for rearranging and sorting later. Positions are always saved per view. They will automatically be set if you request the tasks through a view endpoint, otherwise they will always be 0. To update them, take a look at the Task Position endpoint. + , modelsTaskPositionProjectViewId :: !(Maybe Int) -- ^ "project_view_id" - The project view this task is related to + , modelsTaskPositionTaskId :: !(Maybe Int) -- ^ "task_id" - The ID of the task this position is for + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ModelsTaskPosition +instance A.FromJSON ModelsTaskPosition where + parseJSON = A.withObject "ModelsTaskPosition" $ \o -> + ModelsTaskPosition + <$> (o .:? "position") + <*> (o .:? "project_view_id") + <*> (o .:? "task_id") + +-- | ToJSON ModelsTaskPosition +instance A.ToJSON ModelsTaskPosition where + toJSON ModelsTaskPosition {..} = + _omitNulls + [ "position" .= modelsTaskPositionPosition + , "project_view_id" .= modelsTaskPositionProjectViewId + , "task_id" .= modelsTaskPositionTaskId + ] + + +-- | Construct a value of type 'ModelsTaskPosition' (by applying it's required fields, if any) +mkModelsTaskPosition + :: ModelsTaskPosition +mkModelsTaskPosition = + ModelsTaskPosition + { modelsTaskPositionPosition = Nothing + , modelsTaskPositionProjectViewId = Nothing + , modelsTaskPositionTaskId = Nothing + } + +-- ** ModelsTaskRelation +-- | ModelsTaskRelation +data ModelsTaskRelation = ModelsTaskRelation + { modelsTaskRelationCreated :: !(Maybe Text) -- ^ "created" - A timestamp when this label was created. You cannot change this value. + , modelsTaskRelationCreatedBy :: !(Maybe ModelsTaskRelationCreatedBy) -- ^ "created_by" + , modelsTaskRelationOtherTaskId :: !(Maybe Int) -- ^ "other_task_id" - The ID of the other task, the task which is being related. + , modelsTaskRelationRelationKind :: !(Maybe ModelsRelationKind) -- ^ "relation_kind" - The kind of the relation. + , modelsTaskRelationTaskId :: !(Maybe Int) -- ^ "task_id" - The ID of the \"base\" task, the task which has a relation to another. + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ModelsTaskRelation +instance A.FromJSON ModelsTaskRelation where + parseJSON = A.withObject "ModelsTaskRelation" $ \o -> + ModelsTaskRelation + <$> (o .:? "created") + <*> (o .:? "created_by") + <*> (o .:? "other_task_id") + <*> (o .:? "relation_kind") + <*> (o .:? "task_id") + +-- | ToJSON ModelsTaskRelation +instance A.ToJSON ModelsTaskRelation where + toJSON ModelsTaskRelation {..} = + _omitNulls + [ "created" .= modelsTaskRelationCreated + , "created_by" .= modelsTaskRelationCreatedBy + , "other_task_id" .= modelsTaskRelationOtherTaskId + , "relation_kind" .= modelsTaskRelationRelationKind + , "task_id" .= modelsTaskRelationTaskId + ] + + +-- | Construct a value of type 'ModelsTaskRelation' (by applying it's required fields, if any) +mkModelsTaskRelation + :: ModelsTaskRelation +mkModelsTaskRelation = + ModelsTaskRelation + { modelsTaskRelationCreated = Nothing + , modelsTaskRelationCreatedBy = Nothing + , modelsTaskRelationOtherTaskId = Nothing + , modelsTaskRelationRelationKind = NothingNothing + , modelsTaskRelationTaskId = Nothing + } + +-- ** ModelsTaskRelationCreatedBy +-- | ModelsTaskRelationCreatedBy +-- The user who created this relation +data ModelsTaskRelationCreatedBy = ModelsTaskRelationCreatedBy + { modelsTaskRelationCreatedByCreated :: !(Maybe Text) -- ^ "created" - A timestamp when this task was created. You cannot change this value. + , modelsTaskRelationCreatedByEmail :: !(Maybe Text) -- ^ "email" - The user's email address. + , modelsTaskRelationCreatedById :: !(Maybe Int) -- ^ "id" - The unique, numeric id of this user. + , modelsTaskRelationCreatedByName :: !(Maybe Text) -- ^ "name" - The full name of the user. + , modelsTaskRelationCreatedByUpdated :: !(Maybe Text) -- ^ "updated" - A timestamp when this task was last updated. You cannot change this value. + , modelsTaskRelationCreatedByUsername :: !(Maybe Text) -- ^ "username" - The username of the user. Is always unique. + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ModelsTaskRelationCreatedBy +instance A.FromJSON ModelsTaskRelationCreatedBy where + parseJSON = A.withObject "ModelsTaskRelationCreatedBy" $ \o -> + ModelsTaskRelationCreatedBy + <$> (o .:? "created") + <*> (o .:? "email") + <*> (o .:? "id") + <*> (o .:? "name") + <*> (o .:? "updated") + <*> (o .:? "username") + +-- | ToJSON ModelsTaskRelationCreatedBy +instance A.ToJSON ModelsTaskRelationCreatedBy where + toJSON ModelsTaskRelationCreatedBy {..} = + _omitNulls + [ "created" .= modelsTaskRelationCreatedByCreated + , "email" .= modelsTaskRelationCreatedByEmail + , "id" .= modelsTaskRelationCreatedById + , "name" .= modelsTaskRelationCreatedByName + , "updated" .= modelsTaskRelationCreatedByUpdated + , "username" .= modelsTaskRelationCreatedByUsername + ] + + +-- | Construct a value of type 'ModelsTaskRelationCreatedBy' (by applying it's required fields, if any) +mkModelsTaskRelationCreatedBy + :: ModelsTaskRelationCreatedBy +mkModelsTaskRelationCreatedBy = + ModelsTaskRelationCreatedBy + { modelsTaskRelationCreatedByCreated = Nothing + , modelsTaskRelationCreatedByEmail = Nothing + , modelsTaskRelationCreatedById = Nothing + , modelsTaskRelationCreatedByName = Nothing + , modelsTaskRelationCreatedByUpdated = Nothing + , modelsTaskRelationCreatedByUsername = Nothing + } + +-- ** ModelsTaskReminder +-- | ModelsTaskReminder +data ModelsTaskReminder = ModelsTaskReminder + { modelsTaskReminderRelativePeriod :: !(Maybe Int) -- ^ "relative_period" - A period in seconds relative to another date argument. Negative values mean the reminder triggers before the date. Default: 0, tiggers when RelativeTo is due. + , modelsTaskReminderRelativeTo :: !(Maybe ModelsReminderRelation) -- ^ "relative_to" - The name of the date field to which the relative period refers to. + , modelsTaskReminderReminder :: !(Maybe Text) -- ^ "reminder" - The absolute time when the user wants to be reminded of the task. + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ModelsTaskReminder +instance A.FromJSON ModelsTaskReminder where + parseJSON = A.withObject "ModelsTaskReminder" $ \o -> + ModelsTaskReminder + <$> (o .:? "relative_period") + <*> (o .:? "relative_to") + <*> (o .:? "reminder") + +-- | ToJSON ModelsTaskReminder +instance A.ToJSON ModelsTaskReminder where + toJSON ModelsTaskReminder {..} = + _omitNulls + [ "relative_period" .= modelsTaskReminderRelativePeriod + , "relative_to" .= modelsTaskReminderRelativeTo + , "reminder" .= modelsTaskReminderReminder + ] + + +-- | Construct a value of type 'ModelsTaskReminder' (by applying it's required fields, if any) +mkModelsTaskReminder + :: ModelsTaskReminder +mkModelsTaskReminder = + ModelsTaskReminder + { modelsTaskReminderRelativePeriod = Nothing + , modelsTaskReminderRelativeTo = NothingNothing + , modelsTaskReminderReminder = Nothing + } + +-- ** ModelsTeam +-- | ModelsTeam +data ModelsTeam = ModelsTeam + { modelsTeamCreated :: !(Maybe Text) -- ^ "created" - A timestamp when this relation was created. You cannot change this value. + , modelsTeamCreatedBy :: !(Maybe ModelsTeamCreatedBy) -- ^ "created_by" + , modelsTeamDescription :: !(Maybe Text) -- ^ "description" - The team's description. + , modelsTeamId :: !(Maybe Int) -- ^ "id" - The unique, numeric id of this team. + , modelsTeamIncludePublic :: !(Maybe Bool) -- ^ "include_public" - Query parameter controlling whether to include public projects or not + , modelsTeamIsPublic :: !(Maybe Bool) -- ^ "is_public" - Defines wether the team should be publicly discoverable when sharing a project + , modelsTeamMembers :: !(Maybe [ModelsTeamUser]) -- ^ "members" - An array of all members in this team. + , modelsTeamName :: !(Maybe Text) -- ^ "name" - The name of this team. + , modelsTeamOidcId :: !(Maybe Text) -- ^ "oidc_id" - The team's oidc id delivered by the oidc provider + , modelsTeamUpdated :: !(Maybe Text) -- ^ "updated" - A timestamp when this relation was last updated. You cannot change this value. + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ModelsTeam +instance A.FromJSON ModelsTeam where + parseJSON = A.withObject "ModelsTeam" $ \o -> + ModelsTeam + <$> (o .:? "created") + <*> (o .:? "created_by") + <*> (o .:? "description") + <*> (o .:? "id") + <*> (o .:? "include_public") + <*> (o .:? "is_public") + <*> (o .:? "members") + <*> (o .:? "name") + <*> (o .:? "oidc_id") + <*> (o .:? "updated") + +-- | ToJSON ModelsTeam +instance A.ToJSON ModelsTeam where + toJSON ModelsTeam {..} = + _omitNulls + [ "created" .= modelsTeamCreated + , "created_by" .= modelsTeamCreatedBy + , "description" .= modelsTeamDescription + , "id" .= modelsTeamId + , "include_public" .= modelsTeamIncludePublic + , "is_public" .= modelsTeamIsPublic + , "members" .= modelsTeamMembers + , "name" .= modelsTeamName + , "oidc_id" .= modelsTeamOidcId + , "updated" .= modelsTeamUpdated + ] + + +-- | Construct a value of type 'ModelsTeam' (by applying it's required fields, if any) +mkModelsTeam + :: ModelsTeam +mkModelsTeam = + ModelsTeam + { modelsTeamCreated = Nothing + , modelsTeamCreatedBy = Nothing + , modelsTeamDescription = Nothing + , modelsTeamId = Nothing + , modelsTeamIncludePublic = Nothing + , modelsTeamIsPublic = Nothing + , modelsTeamMembers = Nothing + , modelsTeamName = Nothing + , modelsTeamOidcId = Nothing + , modelsTeamUpdated = Nothing + } + +-- ** ModelsTeamCreatedBy +-- | ModelsTeamCreatedBy +-- The user who created this team. +data ModelsTeamCreatedBy = ModelsTeamCreatedBy + { modelsTeamCreatedByCreated :: !(Maybe Text) -- ^ "created" - A timestamp when this task was created. You cannot change this value. + , modelsTeamCreatedByEmail :: !(Maybe Text) -- ^ "email" - The user's email address. + , modelsTeamCreatedById :: !(Maybe Int) -- ^ "id" - The unique, numeric id of this user. + , modelsTeamCreatedByName :: !(Maybe Text) -- ^ "name" - The full name of the user. + , modelsTeamCreatedByUpdated :: !(Maybe Text) -- ^ "updated" - A timestamp when this task was last updated. You cannot change this value. + , modelsTeamCreatedByUsername :: !(Maybe Text) -- ^ "username" - The username of the user. Is always unique. + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ModelsTeamCreatedBy +instance A.FromJSON ModelsTeamCreatedBy where + parseJSON = A.withObject "ModelsTeamCreatedBy" $ \o -> + ModelsTeamCreatedBy + <$> (o .:? "created") + <*> (o .:? "email") + <*> (o .:? "id") + <*> (o .:? "name") + <*> (o .:? "updated") + <*> (o .:? "username") + +-- | ToJSON ModelsTeamCreatedBy +instance A.ToJSON ModelsTeamCreatedBy where + toJSON ModelsTeamCreatedBy {..} = + _omitNulls + [ "created" .= modelsTeamCreatedByCreated + , "email" .= modelsTeamCreatedByEmail + , "id" .= modelsTeamCreatedById + , "name" .= modelsTeamCreatedByName + , "updated" .= modelsTeamCreatedByUpdated + , "username" .= modelsTeamCreatedByUsername + ] + + +-- | Construct a value of type 'ModelsTeamCreatedBy' (by applying it's required fields, if any) +mkModelsTeamCreatedBy + :: ModelsTeamCreatedBy +mkModelsTeamCreatedBy = + ModelsTeamCreatedBy + { modelsTeamCreatedByCreated = Nothing + , modelsTeamCreatedByEmail = Nothing + , modelsTeamCreatedById = Nothing + , modelsTeamCreatedByName = Nothing + , modelsTeamCreatedByUpdated = Nothing + , modelsTeamCreatedByUsername = Nothing + } + +-- ** ModelsTeamMember +-- | ModelsTeamMember +data ModelsTeamMember = ModelsTeamMember + { modelsTeamMemberAdmin :: !(Maybe Bool) -- ^ "admin" - Whether or not the member is an admin of the team. See the docs for more about what a team admin can do + , modelsTeamMemberCreated :: !(Maybe Text) -- ^ "created" - A timestamp when this relation was created. You cannot change this value. + , modelsTeamMemberId :: !(Maybe Int) -- ^ "id" - The unique, numeric id of this team member relation. + , modelsTeamMemberUsername :: !(Maybe Text) -- ^ "username" - The username of the member. We use this to prevent automated user id entering. + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ModelsTeamMember +instance A.FromJSON ModelsTeamMember where + parseJSON = A.withObject "ModelsTeamMember" $ \o -> + ModelsTeamMember + <$> (o .:? "admin") + <*> (o .:? "created") + <*> (o .:? "id") + <*> (o .:? "username") + +-- | ToJSON ModelsTeamMember +instance A.ToJSON ModelsTeamMember where + toJSON ModelsTeamMember {..} = + _omitNulls + [ "admin" .= modelsTeamMemberAdmin + , "created" .= modelsTeamMemberCreated + , "id" .= modelsTeamMemberId + , "username" .= modelsTeamMemberUsername + ] + + +-- | Construct a value of type 'ModelsTeamMember' (by applying it's required fields, if any) +mkModelsTeamMember + :: ModelsTeamMember +mkModelsTeamMember = + ModelsTeamMember + { modelsTeamMemberAdmin = Nothing + , modelsTeamMemberCreated = Nothing + , modelsTeamMemberId = Nothing + , modelsTeamMemberUsername = Nothing + } + +-- ** ModelsTeamProject +-- | ModelsTeamProject +data ModelsTeamProject = ModelsTeamProject + { modelsTeamProjectCreated :: !(Maybe Text) -- ^ "created" - A timestamp when this relation was created. You cannot change this value. + , modelsTeamProjectId :: !(Maybe Int) -- ^ "id" - The unique, numeric id of this project <-> team relation. + , modelsTeamProjectRight :: !(Maybe ModelsRight) -- ^ "right" - The right this team has. 0 = Read only, 1 = Read & Write, 2 = Admin. See the docs for more details. + , modelsTeamProjectTeamId :: !(Maybe Int) -- ^ "team_id" - The team id. + , modelsTeamProjectUpdated :: !(Maybe Text) -- ^ "updated" - A timestamp when this relation was last updated. You cannot change this value. + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ModelsTeamProject +instance A.FromJSON ModelsTeamProject where + parseJSON = A.withObject "ModelsTeamProject" $ \o -> + ModelsTeamProject + <$> (o .:? "created") + <*> (o .:? "id") + <*> (o .:? "right") + <*> (o .:? "team_id") + <*> (o .:? "updated") + +-- | ToJSON ModelsTeamProject +instance A.ToJSON ModelsTeamProject where + toJSON ModelsTeamProject {..} = + _omitNulls + [ "created" .= modelsTeamProjectCreated + , "id" .= modelsTeamProjectId + , "right" .= modelsTeamProjectRight + , "team_id" .= modelsTeamProjectTeamId + , "updated" .= modelsTeamProjectUpdated + ] + + +-- | Construct a value of type 'ModelsTeamProject' (by applying it's required fields, if any) +mkModelsTeamProject + :: ModelsTeamProject +mkModelsTeamProject = + ModelsTeamProject + { modelsTeamProjectCreated = Nothing + , modelsTeamProjectId = Nothing + , modelsTeamProjectRight = NothingNothing + , modelsTeamProjectTeamId = Nothing + , modelsTeamProjectUpdated = Nothing + } + +-- ** ModelsTeamUser +-- | ModelsTeamUser +data ModelsTeamUser = ModelsTeamUser + { modelsTeamUserAdmin :: !(Maybe Bool) -- ^ "admin" - Whether the member is an admin of the team. See the docs for more about what a team admin can do + , modelsTeamUserCreated :: !(Maybe Text) -- ^ "created" - A timestamp when this task was created. You cannot change this value. + , modelsTeamUserEmail :: !(Maybe Text) -- ^ "email" - The user's email address. + , modelsTeamUserId :: !(Maybe Int) -- ^ "id" - The unique, numeric id of this user. + , modelsTeamUserName :: !(Maybe Text) -- ^ "name" - The full name of the user. + , modelsTeamUserUpdated :: !(Maybe Text) -- ^ "updated" - A timestamp when this task was last updated. You cannot change this value. + , modelsTeamUserUsername :: !(Maybe Text) -- ^ "username" - The username of the user. Is always unique. + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ModelsTeamUser +instance A.FromJSON ModelsTeamUser where + parseJSON = A.withObject "ModelsTeamUser" $ \o -> + ModelsTeamUser + <$> (o .:? "admin") + <*> (o .:? "created") + <*> (o .:? "email") + <*> (o .:? "id") + <*> (o .:? "name") + <*> (o .:? "updated") + <*> (o .:? "username") + +-- | ToJSON ModelsTeamUser +instance A.ToJSON ModelsTeamUser where + toJSON ModelsTeamUser {..} = + _omitNulls + [ "admin" .= modelsTeamUserAdmin + , "created" .= modelsTeamUserCreated + , "email" .= modelsTeamUserEmail + , "id" .= modelsTeamUserId + , "name" .= modelsTeamUserName + , "updated" .= modelsTeamUserUpdated + , "username" .= modelsTeamUserUsername + ] + + +-- | Construct a value of type 'ModelsTeamUser' (by applying it's required fields, if any) +mkModelsTeamUser + :: ModelsTeamUser +mkModelsTeamUser = + ModelsTeamUser + { modelsTeamUserAdmin = Nothing + , modelsTeamUserCreated = Nothing + , modelsTeamUserEmail = Nothing + , modelsTeamUserId = Nothing + , modelsTeamUserName = Nothing + , modelsTeamUserUpdated = Nothing + , modelsTeamUserUsername = Nothing + } + +-- ** ModelsTeamWithRight +-- | ModelsTeamWithRight +data ModelsTeamWithRight = ModelsTeamWithRight + { modelsTeamWithRightCreated :: !(Maybe Text) -- ^ "created" - A timestamp when this relation was created. You cannot change this value. + , modelsTeamWithRightCreatedBy :: !(Maybe ModelsTeamCreatedBy) -- ^ "created_by" + , modelsTeamWithRightDescription :: !(Maybe Text) -- ^ "description" - The team's description. + , modelsTeamWithRightId :: !(Maybe Int) -- ^ "id" - The unique, numeric id of this team. + , modelsTeamWithRightIncludePublic :: !(Maybe Bool) -- ^ "include_public" - Query parameter controlling whether to include public projects or not + , modelsTeamWithRightIsPublic :: !(Maybe Bool) -- ^ "is_public" - Defines wether the team should be publicly discoverable when sharing a project + , modelsTeamWithRightMembers :: !(Maybe [ModelsTeamUser]) -- ^ "members" - An array of all members in this team. + , modelsTeamWithRightName :: !(Maybe Text) -- ^ "name" - The name of this team. + , modelsTeamWithRightOidcId :: !(Maybe Text) -- ^ "oidc_id" - The team's oidc id delivered by the oidc provider + , modelsTeamWithRightRight :: !(Maybe ModelsRight) -- ^ "right" + , modelsTeamWithRightUpdated :: !(Maybe Text) -- ^ "updated" - A timestamp when this relation was last updated. You cannot change this value. + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ModelsTeamWithRight +instance A.FromJSON ModelsTeamWithRight where + parseJSON = A.withObject "ModelsTeamWithRight" $ \o -> + ModelsTeamWithRight + <$> (o .:? "created") + <*> (o .:? "created_by") + <*> (o .:? "description") + <*> (o .:? "id") + <*> (o .:? "include_public") + <*> (o .:? "is_public") + <*> (o .:? "members") + <*> (o .:? "name") + <*> (o .:? "oidc_id") + <*> (o .:? "right") + <*> (o .:? "updated") + +-- | ToJSON ModelsTeamWithRight +instance A.ToJSON ModelsTeamWithRight where + toJSON ModelsTeamWithRight {..} = + _omitNulls + [ "created" .= modelsTeamWithRightCreated + , "created_by" .= modelsTeamWithRightCreatedBy + , "description" .= modelsTeamWithRightDescription + , "id" .= modelsTeamWithRightId + , "include_public" .= modelsTeamWithRightIncludePublic + , "is_public" .= modelsTeamWithRightIsPublic + , "members" .= modelsTeamWithRightMembers + , "name" .= modelsTeamWithRightName + , "oidc_id" .= modelsTeamWithRightOidcId + , "right" .= modelsTeamWithRightRight + , "updated" .= modelsTeamWithRightUpdated + ] + + +-- | Construct a value of type 'ModelsTeamWithRight' (by applying it's required fields, if any) +mkModelsTeamWithRight + :: ModelsTeamWithRight +mkModelsTeamWithRight = + ModelsTeamWithRight + { modelsTeamWithRightCreated = Nothing + , modelsTeamWithRightCreatedBy = Nothing + , modelsTeamWithRightDescription = Nothing + , modelsTeamWithRightId = Nothing + , modelsTeamWithRightIncludePublic = Nothing + , modelsTeamWithRightIsPublic = Nothing + , modelsTeamWithRightMembers = Nothing + , modelsTeamWithRightName = Nothing + , modelsTeamWithRightOidcId = Nothing + , modelsTeamWithRightRight = Nothing + , modelsTeamWithRightUpdated = Nothing + } + +-- ** ModelsUserWithRight +-- | ModelsUserWithRight +data ModelsUserWithRight = ModelsUserWithRight + { modelsUserWithRightCreated :: !(Maybe Text) -- ^ "created" - A timestamp when this task was created. You cannot change this value. + , modelsUserWithRightEmail :: !(Maybe Text) -- ^ "email" - The user's email address. + , modelsUserWithRightId :: !(Maybe Int) -- ^ "id" - The unique, numeric id of this user. + , modelsUserWithRightName :: !(Maybe Text) -- ^ "name" - The full name of the user. + , modelsUserWithRightRight :: !(Maybe ModelsRight) -- ^ "right" + , modelsUserWithRightUpdated :: !(Maybe Text) -- ^ "updated" - A timestamp when this task was last updated. You cannot change this value. + , modelsUserWithRightUsername :: !(Maybe Text) -- ^ "username" - The username of the user. Is always unique. + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ModelsUserWithRight +instance A.FromJSON ModelsUserWithRight where + parseJSON = A.withObject "ModelsUserWithRight" $ \o -> + ModelsUserWithRight + <$> (o .:? "created") + <*> (o .:? "email") + <*> (o .:? "id") + <*> (o .:? "name") + <*> (o .:? "right") + <*> (o .:? "updated") + <*> (o .:? "username") + +-- | ToJSON ModelsUserWithRight +instance A.ToJSON ModelsUserWithRight where + toJSON ModelsUserWithRight {..} = + _omitNulls + [ "created" .= modelsUserWithRightCreated + , "email" .= modelsUserWithRightEmail + , "id" .= modelsUserWithRightId + , "name" .= modelsUserWithRightName + , "right" .= modelsUserWithRightRight + , "updated" .= modelsUserWithRightUpdated + , "username" .= modelsUserWithRightUsername + ] + + +-- | Construct a value of type 'ModelsUserWithRight' (by applying it's required fields, if any) +mkModelsUserWithRight + :: ModelsUserWithRight +mkModelsUserWithRight = + ModelsUserWithRight + { modelsUserWithRightCreated = Nothing + , modelsUserWithRightEmail = Nothing + , modelsUserWithRightId = Nothing + , modelsUserWithRightName = Nothing + , modelsUserWithRightRight = Nothing + , modelsUserWithRightUpdated = Nothing + , modelsUserWithRightUsername = Nothing + } + +-- ** ModelsWebhook +-- | ModelsWebhook +data ModelsWebhook = ModelsWebhook + { modelsWebhookCreated :: !(Maybe Text) -- ^ "created" - A timestamp when this webhook target was created. You cannot change this value. + , modelsWebhookCreatedBy :: !(Maybe ModelsWebhookCreatedBy) -- ^ "created_by" + , modelsWebhookEvents :: !(Maybe [Text]) -- ^ "events" - The webhook events which should fire this webhook target + , modelsWebhookId :: !(Maybe Int) -- ^ "id" - The generated ID of this webhook target + , modelsWebhookProjectId :: !(Maybe Int) -- ^ "project_id" - The project ID of the project this webhook target belongs to + , modelsWebhookSecret :: !(Maybe Text) -- ^ "secret" - If provided, webhook requests will be signed using HMAC. Check out the docs about how to use this: https://vikunja.io/docs/webhooks/#signing + , modelsWebhookTargetUrl :: !(Maybe Text) -- ^ "target_url" - The target URL where the POST request with the webhook payload will be made + , modelsWebhookUpdated :: !(Maybe Text) -- ^ "updated" - A timestamp when this webhook target was last updated. You cannot change this value. + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ModelsWebhook +instance A.FromJSON ModelsWebhook where + parseJSON = A.withObject "ModelsWebhook" $ \o -> + ModelsWebhook + <$> (o .:? "created") + <*> (o .:? "created_by") + <*> (o .:? "events") + <*> (o .:? "id") + <*> (o .:? "project_id") + <*> (o .:? "secret") + <*> (o .:? "target_url") + <*> (o .:? "updated") + +-- | ToJSON ModelsWebhook +instance A.ToJSON ModelsWebhook where + toJSON ModelsWebhook {..} = + _omitNulls + [ "created" .= modelsWebhookCreated + , "created_by" .= modelsWebhookCreatedBy + , "events" .= modelsWebhookEvents + , "id" .= modelsWebhookId + , "project_id" .= modelsWebhookProjectId + , "secret" .= modelsWebhookSecret + , "target_url" .= modelsWebhookTargetUrl + , "updated" .= modelsWebhookUpdated + ] + + +-- | Construct a value of type 'ModelsWebhook' (by applying it's required fields, if any) +mkModelsWebhook + :: ModelsWebhook +mkModelsWebhook = + ModelsWebhook + { modelsWebhookCreated = Nothing + , modelsWebhookCreatedBy = Nothing + , modelsWebhookEvents = Nothing + , modelsWebhookId = Nothing + , modelsWebhookProjectId = Nothing + , modelsWebhookSecret = Nothing + , modelsWebhookTargetUrl = Nothing + , modelsWebhookUpdated = Nothing + } + +-- ** ModelsWebhookCreatedBy +-- | ModelsWebhookCreatedBy +-- The user who initially created the webhook target. +data ModelsWebhookCreatedBy = ModelsWebhookCreatedBy + { modelsWebhookCreatedByCreated :: !(Maybe Text) -- ^ "created" - A timestamp when this task was created. You cannot change this value. + , modelsWebhookCreatedByEmail :: !(Maybe Text) -- ^ "email" - The user's email address. + , modelsWebhookCreatedById :: !(Maybe Int) -- ^ "id" - The unique, numeric id of this user. + , modelsWebhookCreatedByName :: !(Maybe Text) -- ^ "name" - The full name of the user. + , modelsWebhookCreatedByUpdated :: !(Maybe Text) -- ^ "updated" - A timestamp when this task was last updated. You cannot change this value. + , modelsWebhookCreatedByUsername :: !(Maybe Text) -- ^ "username" - The username of the user. Is always unique. + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ModelsWebhookCreatedBy +instance A.FromJSON ModelsWebhookCreatedBy where + parseJSON = A.withObject "ModelsWebhookCreatedBy" $ \o -> + ModelsWebhookCreatedBy + <$> (o .:? "created") + <*> (o .:? "email") + <*> (o .:? "id") + <*> (o .:? "name") + <*> (o .:? "updated") + <*> (o .:? "username") + +-- | ToJSON ModelsWebhookCreatedBy +instance A.ToJSON ModelsWebhookCreatedBy where + toJSON ModelsWebhookCreatedBy {..} = + _omitNulls + [ "created" .= modelsWebhookCreatedByCreated + , "email" .= modelsWebhookCreatedByEmail + , "id" .= modelsWebhookCreatedById + , "name" .= modelsWebhookCreatedByName + , "updated" .= modelsWebhookCreatedByUpdated + , "username" .= modelsWebhookCreatedByUsername + ] + + +-- | Construct a value of type 'ModelsWebhookCreatedBy' (by applying it's required fields, if any) +mkModelsWebhookCreatedBy + :: ModelsWebhookCreatedBy +mkModelsWebhookCreatedBy = + ModelsWebhookCreatedBy + { modelsWebhookCreatedByCreated = Nothing + , modelsWebhookCreatedByEmail = Nothing + , modelsWebhookCreatedById = Nothing + , modelsWebhookCreatedByName = Nothing + , modelsWebhookCreatedByUpdated = Nothing + , modelsWebhookCreatedByUsername = Nothing + } + +-- ** NotificationsDatabaseNotification +-- | NotificationsDatabaseNotification +data NotificationsDatabaseNotification = NotificationsDatabaseNotification + { notificationsDatabaseNotificationCreated :: !(Maybe Text) -- ^ "created" - A timestamp when this notification was created. You cannot change this value. + , notificationsDatabaseNotificationId :: !(Maybe Int) -- ^ "id" - The unique, numeric id of this notification. + , notificationsDatabaseNotificationName :: !(Maybe Text) -- ^ "name" - The name of the notification + , notificationsDatabaseNotificationNotification :: !(Maybe A.Value) -- ^ "notification" - The actual content of the notification. + , notificationsDatabaseNotificationReadAt :: !(Maybe Text) -- ^ "read_at" - When this notification is marked as read, this will be updated with the current timestamp. + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON NotificationsDatabaseNotification +instance A.FromJSON NotificationsDatabaseNotification where + parseJSON = A.withObject "NotificationsDatabaseNotification" $ \o -> + NotificationsDatabaseNotification + <$> (o .:? "created") + <*> (o .:? "id") + <*> (o .:? "name") + <*> (o .:? "notification") + <*> (o .:? "read_at") + +-- | ToJSON NotificationsDatabaseNotification +instance A.ToJSON NotificationsDatabaseNotification where + toJSON NotificationsDatabaseNotification {..} = + _omitNulls + [ "created" .= notificationsDatabaseNotificationCreated + , "id" .= notificationsDatabaseNotificationId + , "name" .= notificationsDatabaseNotificationName + , "notification" .= notificationsDatabaseNotificationNotification + , "read_at" .= notificationsDatabaseNotificationReadAt + ] + + +-- | Construct a value of type 'NotificationsDatabaseNotification' (by applying it's required fields, if any) +mkNotificationsDatabaseNotification + :: NotificationsDatabaseNotification +mkNotificationsDatabaseNotification = + NotificationsDatabaseNotification + { notificationsDatabaseNotificationCreated = Nothing + , notificationsDatabaseNotificationId = Nothing + , notificationsDatabaseNotificationName = Nothing + , notificationsDatabaseNotificationNotification = Nothing + , notificationsDatabaseNotificationReadAt = Nothing + } + +-- ** OpenidCallback +-- | OpenidCallback +data OpenidCallback = OpenidCallback + { openidCallbackCode :: !(Maybe Text) -- ^ "code" + , openidCallbackRedirectUrl :: !(Maybe Text) -- ^ "redirect_url" + , openidCallbackScope :: !(Maybe Text) -- ^ "scope" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON OpenidCallback +instance A.FromJSON OpenidCallback where + parseJSON = A.withObject "OpenidCallback" $ \o -> + OpenidCallback + <$> (o .:? "code") + <*> (o .:? "redirect_url") + <*> (o .:? "scope") + +-- | ToJSON OpenidCallback +instance A.ToJSON OpenidCallback where + toJSON OpenidCallback {..} = + _omitNulls + [ "code" .= openidCallbackCode + , "redirect_url" .= openidCallbackRedirectUrl + , "scope" .= openidCallbackScope + ] + + +-- | Construct a value of type 'OpenidCallback' (by applying it's required fields, if any) +mkOpenidCallback + :: OpenidCallback +mkOpenidCallback = + OpenidCallback + { openidCallbackCode = Nothing + , openidCallbackRedirectUrl = Nothing + , openidCallbackScope = Nothing + } + +-- ** OpenidProvider +-- | OpenidProvider +data OpenidProvider = OpenidProvider + { openidProviderAuthUrl :: !(Maybe Text) -- ^ "auth_url" + , openidProviderClientId :: !(Maybe Text) -- ^ "client_id" + , openidProviderKey :: !(Maybe Text) -- ^ "key" + , openidProviderLogoutUrl :: !(Maybe Text) -- ^ "logout_url" + , openidProviderName :: !(Maybe Text) -- ^ "name" + , openidProviderScope :: !(Maybe Text) -- ^ "scope" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON OpenidProvider +instance A.FromJSON OpenidProvider where + parseJSON = A.withObject "OpenidProvider" $ \o -> + OpenidProvider + <$> (o .:? "auth_url") + <*> (o .:? "client_id") + <*> (o .:? "key") + <*> (o .:? "logout_url") + <*> (o .:? "name") + <*> (o .:? "scope") + +-- | ToJSON OpenidProvider +instance A.ToJSON OpenidProvider where + toJSON OpenidProvider {..} = + _omitNulls + [ "auth_url" .= openidProviderAuthUrl + , "client_id" .= openidProviderClientId + , "key" .= openidProviderKey + , "logout_url" .= openidProviderLogoutUrl + , "name" .= openidProviderName + , "scope" .= openidProviderScope + ] + + +-- | Construct a value of type 'OpenidProvider' (by applying it's required fields, if any) +mkOpenidProvider + :: OpenidProvider +mkOpenidProvider = + OpenidProvider + { openidProviderAuthUrl = Nothing + , openidProviderClientId = Nothing + , openidProviderKey = Nothing + , openidProviderLogoutUrl = Nothing + , openidProviderName = Nothing + , openidProviderScope = Nothing + } + +-- ** TodoistMigration +-- | TodoistMigration +data TodoistMigration = TodoistMigration + { todoistMigrationCode :: !(Maybe Text) -- ^ "code" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON TodoistMigration +instance A.FromJSON TodoistMigration where + parseJSON = A.withObject "TodoistMigration" $ \o -> + TodoistMigration + <$> (o .:? "code") + +-- | ToJSON TodoistMigration +instance A.ToJSON TodoistMigration where + toJSON TodoistMigration {..} = + _omitNulls + [ "code" .= todoistMigrationCode + ] + + +-- | Construct a value of type 'TodoistMigration' (by applying it's required fields, if any) +mkTodoistMigration + :: TodoistMigration +mkTodoistMigration = + TodoistMigration + { todoistMigrationCode = Nothing + } + +-- ** TrelloMigration +-- | TrelloMigration +data TrelloMigration = TrelloMigration + { trelloMigrationCode :: !(Maybe Text) -- ^ "code" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON TrelloMigration +instance A.FromJSON TrelloMigration where + parseJSON = A.withObject "TrelloMigration" $ \o -> + TrelloMigration + <$> (o .:? "code") + +-- | ToJSON TrelloMigration +instance A.ToJSON TrelloMigration where + toJSON TrelloMigration {..} = + _omitNulls + [ "code" .= trelloMigrationCode + ] + + +-- | Construct a value of type 'TrelloMigration' (by applying it's required fields, if any) +mkTrelloMigration + :: TrelloMigration +mkTrelloMigration = + TrelloMigration + { trelloMigrationCode = Nothing + } + +-- ** UserAPIUserPassword +-- | UserAPIUserPassword +data UserAPIUserPassword = UserAPIUserPassword + { userAPIUserPasswordEmail :: !(Maybe Text) -- ^ "email" - The user's email address + , userAPIUserPasswordId :: !(Maybe Int) -- ^ "id" - The unique, numeric id of this user. + , userAPIUserPasswordPassword :: !(Maybe Text) -- ^ "password" - The user's password in clear text. Only used when registering the user. The maximum limi is 72 bytes, which may be less than 72 characters. This is due to the limit in the bcrypt hashing algorithm used to store passwords in Vikunja. + , userAPIUserPasswordUsername :: !(Maybe Text) -- ^ "username" - The user's username. Cannot contain anything that looks like an url or whitespaces. + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON UserAPIUserPassword +instance A.FromJSON UserAPIUserPassword where + parseJSON = A.withObject "UserAPIUserPassword" $ \o -> + UserAPIUserPassword + <$> (o .:? "email") + <*> (o .:? "id") + <*> (o .:? "password") + <*> (o .:? "username") + +-- | ToJSON UserAPIUserPassword +instance A.ToJSON UserAPIUserPassword where + toJSON UserAPIUserPassword {..} = + _omitNulls + [ "email" .= userAPIUserPasswordEmail + , "id" .= userAPIUserPasswordId + , "password" .= userAPIUserPasswordPassword + , "username" .= userAPIUserPasswordUsername + ] + + +-- | Construct a value of type 'UserAPIUserPassword' (by applying it's required fields, if any) +mkUserAPIUserPassword + :: UserAPIUserPassword +mkUserAPIUserPassword = + UserAPIUserPassword + { userAPIUserPasswordEmail = Nothing + , userAPIUserPasswordId = Nothing + , userAPIUserPasswordPassword = Nothing + , userAPIUserPasswordUsername = Nothing + } + +-- ** UserEmailConfirm +-- | UserEmailConfirm +data UserEmailConfirm = UserEmailConfirm + { userEmailConfirmToken :: !(Maybe Text) -- ^ "token" - The email confirm token sent via email. + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON UserEmailConfirm +instance A.FromJSON UserEmailConfirm where + parseJSON = A.withObject "UserEmailConfirm" $ \o -> + UserEmailConfirm + <$> (o .:? "token") + +-- | ToJSON UserEmailConfirm +instance A.ToJSON UserEmailConfirm where + toJSON UserEmailConfirm {..} = + _omitNulls + [ "token" .= userEmailConfirmToken + ] + + +-- | Construct a value of type 'UserEmailConfirm' (by applying it's required fields, if any) +mkUserEmailConfirm + :: UserEmailConfirm +mkUserEmailConfirm = + UserEmailConfirm + { userEmailConfirmToken = Nothing + } + +-- ** UserEmailUpdate +-- | UserEmailUpdate +data UserEmailUpdate = UserEmailUpdate + { userEmailUpdateNewEmail :: !(Maybe Text) -- ^ "new_email" - The new email address. Needs to be a valid email address. + , userEmailUpdatePassword :: !(Maybe Text) -- ^ "password" - The password of the user for confirmation. + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON UserEmailUpdate +instance A.FromJSON UserEmailUpdate where + parseJSON = A.withObject "UserEmailUpdate" $ \o -> + UserEmailUpdate + <$> (o .:? "new_email") + <*> (o .:? "password") + +-- | ToJSON UserEmailUpdate +instance A.ToJSON UserEmailUpdate where + toJSON UserEmailUpdate {..} = + _omitNulls + [ "new_email" .= userEmailUpdateNewEmail + , "password" .= userEmailUpdatePassword + ] + + +-- | Construct a value of type 'UserEmailUpdate' (by applying it's required fields, if any) +mkUserEmailUpdate + :: UserEmailUpdate +mkUserEmailUpdate = + UserEmailUpdate + { userEmailUpdateNewEmail = Nothing + , userEmailUpdatePassword = Nothing + } + +-- ** UserLogin +-- | UserLogin +data UserLogin = UserLogin + { userLoginLongToken :: !(Maybe Bool) -- ^ "long_token" - If true, the token returned will be valid a lot longer than default. Useful for \"remember me\" style logins. + , userLoginPassword :: !(Maybe Text) -- ^ "password" - The password for the user. + , userLoginTotpPasscode :: !(Maybe Text) -- ^ "totp_passcode" - The totp passcode of a user. Only needs to be provided when enabled. + , userLoginUsername :: !(Maybe Text) -- ^ "username" - The username used to log in. + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON UserLogin +instance A.FromJSON UserLogin where + parseJSON = A.withObject "UserLogin" $ \o -> + UserLogin + <$> (o .:? "long_token") + <*> (o .:? "password") + <*> (o .:? "totp_passcode") + <*> (o .:? "username") + +-- | ToJSON UserLogin +instance A.ToJSON UserLogin where + toJSON UserLogin {..} = + _omitNulls + [ "long_token" .= userLoginLongToken + , "password" .= userLoginPassword + , "totp_passcode" .= userLoginTotpPasscode + , "username" .= userLoginUsername + ] + + +-- | Construct a value of type 'UserLogin' (by applying it's required fields, if any) +mkUserLogin + :: UserLogin +mkUserLogin = + UserLogin + { userLoginLongToken = Nothing + , userLoginPassword = Nothing + , userLoginTotpPasscode = Nothing + , userLoginUsername = Nothing + } + +-- ** UserPasswordReset +-- | UserPasswordReset +data UserPasswordReset = UserPasswordReset + { userPasswordResetNewPassword :: !(Maybe Text) -- ^ "new_password" - The new password for this user. + , userPasswordResetToken :: !(Maybe Text) -- ^ "token" - The previously issued reset token. + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON UserPasswordReset +instance A.FromJSON UserPasswordReset where + parseJSON = A.withObject "UserPasswordReset" $ \o -> + UserPasswordReset + <$> (o .:? "new_password") + <*> (o .:? "token") + +-- | ToJSON UserPasswordReset +instance A.ToJSON UserPasswordReset where + toJSON UserPasswordReset {..} = + _omitNulls + [ "new_password" .= userPasswordResetNewPassword + , "token" .= userPasswordResetToken + ] + + +-- | Construct a value of type 'UserPasswordReset' (by applying it's required fields, if any) +mkUserPasswordReset + :: UserPasswordReset +mkUserPasswordReset = + UserPasswordReset + { userPasswordResetNewPassword = Nothing + , userPasswordResetToken = Nothing + } + +-- ** UserPasswordTokenRequest +-- | UserPasswordTokenRequest +data UserPasswordTokenRequest = UserPasswordTokenRequest + { userPasswordTokenRequestEmail :: !(Maybe Text) -- ^ "email" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON UserPasswordTokenRequest +instance A.FromJSON UserPasswordTokenRequest where + parseJSON = A.withObject "UserPasswordTokenRequest" $ \o -> + UserPasswordTokenRequest + <$> (o .:? "email") + +-- | ToJSON UserPasswordTokenRequest +instance A.ToJSON UserPasswordTokenRequest where + toJSON UserPasswordTokenRequest {..} = + _omitNulls + [ "email" .= userPasswordTokenRequestEmail + ] + + +-- | Construct a value of type 'UserPasswordTokenRequest' (by applying it's required fields, if any) +mkUserPasswordTokenRequest + :: UserPasswordTokenRequest +mkUserPasswordTokenRequest = + UserPasswordTokenRequest + { userPasswordTokenRequestEmail = Nothing + } + +-- ** UserTOTP +-- | UserTOTP +data UserTOTP = UserTOTP + { userTOTPEnabled :: !(Maybe Bool) -- ^ "enabled" - The totp entry will only be enabled after the user verified they have a working totp setup. + , userTOTPSecret :: !(Maybe Text) -- ^ "secret" + , userTOTPUrl :: !(Maybe Text) -- ^ "url" - The totp url used to be able to enroll the user later + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON UserTOTP +instance A.FromJSON UserTOTP where + parseJSON = A.withObject "UserTOTP" $ \o -> + UserTOTP + <$> (o .:? "enabled") + <*> (o .:? "secret") + <*> (o .:? "url") + +-- | ToJSON UserTOTP +instance A.ToJSON UserTOTP where + toJSON UserTOTP {..} = + _omitNulls + [ "enabled" .= userTOTPEnabled + , "secret" .= userTOTPSecret + , "url" .= userTOTPUrl + ] + + +-- | Construct a value of type 'UserTOTP' (by applying it's required fields, if any) +mkUserTOTP + :: UserTOTP +mkUserTOTP = + UserTOTP + { userTOTPEnabled = Nothing + , userTOTPSecret = Nothing + , userTOTPUrl = Nothing + } + +-- ** UserTOTPPasscode +-- | UserTOTPPasscode +data UserTOTPPasscode = UserTOTPPasscode + { userTOTPPasscodePasscode :: !(Maybe Text) -- ^ "passcode" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON UserTOTPPasscode +instance A.FromJSON UserTOTPPasscode where + parseJSON = A.withObject "UserTOTPPasscode" $ \o -> + UserTOTPPasscode + <$> (o .:? "passcode") + +-- | ToJSON UserTOTPPasscode +instance A.ToJSON UserTOTPPasscode where + toJSON UserTOTPPasscode {..} = + _omitNulls + [ "passcode" .= userTOTPPasscodePasscode + ] + + +-- | Construct a value of type 'UserTOTPPasscode' (by applying it's required fields, if any) +mkUserTOTPPasscode + :: UserTOTPPasscode +mkUserTOTPPasscode = + UserTOTPPasscode + { userTOTPPasscodePasscode = Nothing + } + +-- ** UserToken +-- | UserToken +data UserToken = UserToken + { userTokenCreated :: !(Maybe Text) -- ^ "created" + , userTokenId :: !(Maybe Int) -- ^ "id" + , userTokenToken :: !(Maybe Text) -- ^ "token" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON UserToken +instance A.FromJSON UserToken where + parseJSON = A.withObject "UserToken" $ \o -> + UserToken + <$> (o .:? "created") + <*> (o .:? "id") + <*> (o .:? "token") + +-- | ToJSON UserToken +instance A.ToJSON UserToken where + toJSON UserToken {..} = + _omitNulls + [ "created" .= userTokenCreated + , "id" .= userTokenId + , "token" .= userTokenToken + ] + + +-- | Construct a value of type 'UserToken' (by applying it's required fields, if any) +mkUserToken + :: UserToken +mkUserToken = + UserToken + { userTokenCreated = Nothing + , userTokenId = Nothing + , userTokenToken = Nothing + } + +-- ** UserUser +-- | UserUser +data UserUser = UserUser + { userUserCreated :: !(Maybe Text) -- ^ "created" - A timestamp when this task was created. You cannot change this value. + , userUserEmail :: !(Maybe Text) -- ^ "email" - The user's email address. + , userUserId :: !(Maybe Int) -- ^ "id" - The unique, numeric id of this user. + , userUserName :: !(Maybe Text) -- ^ "name" - The full name of the user. + , userUserUpdated :: !(Maybe Text) -- ^ "updated" - A timestamp when this task was last updated. You cannot change this value. + , userUserUsername :: !(Maybe Text) -- ^ "username" - The username of the user. Is always unique. + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON UserUser +instance A.FromJSON UserUser where + parseJSON = A.withObject "UserUser" $ \o -> + UserUser + <$> (o .:? "created") + <*> (o .:? "email") + <*> (o .:? "id") + <*> (o .:? "name") + <*> (o .:? "updated") + <*> (o .:? "username") + +-- | ToJSON UserUser +instance A.ToJSON UserUser where + toJSON UserUser {..} = + _omitNulls + [ "created" .= userUserCreated + , "email" .= userUserEmail + , "id" .= userUserId + , "name" .= userUserName + , "updated" .= userUserUpdated + , "username" .= userUserUsername + ] + + +-- | Construct a value of type 'UserUser' (by applying it's required fields, if any) +mkUserUser + :: UserUser +mkUserUser = + UserUser + { userUserCreated = Nothing + , userUserEmail = Nothing + , userUserId = Nothing + , userUserName = Nothing + , userUserUpdated = Nothing + , userUserUsername = Nothing + } + +-- ** V1AuthInfo +-- | V1AuthInfo +data V1AuthInfo = V1AuthInfo + { v1AuthInfoLocal :: !(Maybe V1LocalAuthInfo) -- ^ "local" + , v1AuthInfoOpenidConnect :: !(Maybe V1OpenIDAuthInfo) -- ^ "openid_connect" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON V1AuthInfo +instance A.FromJSON V1AuthInfo where + parseJSON = A.withObject "V1AuthInfo" $ \o -> + V1AuthInfo + <$> (o .:? "local") + <*> (o .:? "openid_connect") + +-- | ToJSON V1AuthInfo +instance A.ToJSON V1AuthInfo where + toJSON V1AuthInfo {..} = + _omitNulls + [ "local" .= v1AuthInfoLocal + , "openid_connect" .= v1AuthInfoOpenidConnect + ] + + +-- | Construct a value of type 'V1AuthInfo' (by applying it's required fields, if any) +mkV1AuthInfo + :: V1AuthInfo +mkV1AuthInfo = + V1AuthInfo + { v1AuthInfoLocal = Nothing + , v1AuthInfoOpenidConnect = Nothing + } + +-- ** V1LegalInfo +-- | V1LegalInfo +data V1LegalInfo = V1LegalInfo + { v1LegalInfoImprintUrl :: !(Maybe Text) -- ^ "imprint_url" + , v1LegalInfoPrivacyPolicyUrl :: !(Maybe Text) -- ^ "privacy_policy_url" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON V1LegalInfo +instance A.FromJSON V1LegalInfo where + parseJSON = A.withObject "V1LegalInfo" $ \o -> + V1LegalInfo + <$> (o .:? "imprint_url") + <*> (o .:? "privacy_policy_url") + +-- | ToJSON V1LegalInfo +instance A.ToJSON V1LegalInfo where + toJSON V1LegalInfo {..} = + _omitNulls + [ "imprint_url" .= v1LegalInfoImprintUrl + , "privacy_policy_url" .= v1LegalInfoPrivacyPolicyUrl + ] + + +-- | Construct a value of type 'V1LegalInfo' (by applying it's required fields, if any) +mkV1LegalInfo + :: V1LegalInfo +mkV1LegalInfo = + V1LegalInfo + { v1LegalInfoImprintUrl = Nothing + , v1LegalInfoPrivacyPolicyUrl = Nothing + } + +-- ** V1LinkShareAuth +-- | V1LinkShareAuth +data V1LinkShareAuth = V1LinkShareAuth + { v1LinkShareAuthPassword :: !(Maybe Text) -- ^ "password" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON V1LinkShareAuth +instance A.FromJSON V1LinkShareAuth where + parseJSON = A.withObject "V1LinkShareAuth" $ \o -> + V1LinkShareAuth + <$> (o .:? "password") + +-- | ToJSON V1LinkShareAuth +instance A.ToJSON V1LinkShareAuth where + toJSON V1LinkShareAuth {..} = + _omitNulls + [ "password" .= v1LinkShareAuthPassword + ] + + +-- | Construct a value of type 'V1LinkShareAuth' (by applying it's required fields, if any) +mkV1LinkShareAuth + :: V1LinkShareAuth +mkV1LinkShareAuth = + V1LinkShareAuth + { v1LinkShareAuthPassword = Nothing + } + +-- ** V1LocalAuthInfo +-- | V1LocalAuthInfo +data V1LocalAuthInfo = V1LocalAuthInfo + { v1LocalAuthInfoEnabled :: !(Maybe Bool) -- ^ "enabled" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON V1LocalAuthInfo +instance A.FromJSON V1LocalAuthInfo where + parseJSON = A.withObject "V1LocalAuthInfo" $ \o -> + V1LocalAuthInfo + <$> (o .:? "enabled") + +-- | ToJSON V1LocalAuthInfo +instance A.ToJSON V1LocalAuthInfo where + toJSON V1LocalAuthInfo {..} = + _omitNulls + [ "enabled" .= v1LocalAuthInfoEnabled + ] + + +-- | Construct a value of type 'V1LocalAuthInfo' (by applying it's required fields, if any) +mkV1LocalAuthInfo + :: V1LocalAuthInfo +mkV1LocalAuthInfo = + V1LocalAuthInfo + { v1LocalAuthInfoEnabled = Nothing + } + +-- ** V1OpenIDAuthInfo +-- | V1OpenIDAuthInfo +data V1OpenIDAuthInfo = V1OpenIDAuthInfo + { v1OpenIDAuthInfoEnabled :: !(Maybe Bool) -- ^ "enabled" + , v1OpenIDAuthInfoProviders :: !(Maybe [OpenidProvider]) -- ^ "providers" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON V1OpenIDAuthInfo +instance A.FromJSON V1OpenIDAuthInfo where + parseJSON = A.withObject "V1OpenIDAuthInfo" $ \o -> + V1OpenIDAuthInfo + <$> (o .:? "enabled") + <*> (o .:? "providers") + +-- | ToJSON V1OpenIDAuthInfo +instance A.ToJSON V1OpenIDAuthInfo where + toJSON V1OpenIDAuthInfo {..} = + _omitNulls + [ "enabled" .= v1OpenIDAuthInfoEnabled + , "providers" .= v1OpenIDAuthInfoProviders + ] + + +-- | Construct a value of type 'V1OpenIDAuthInfo' (by applying it's required fields, if any) +mkV1OpenIDAuthInfo + :: V1OpenIDAuthInfo +mkV1OpenIDAuthInfo = + V1OpenIDAuthInfo + { v1OpenIDAuthInfoEnabled = Nothing + , v1OpenIDAuthInfoProviders = Nothing + } + +-- ** V1UserAvatarProvider +-- | V1UserAvatarProvider +data V1UserAvatarProvider = V1UserAvatarProvider + { v1UserAvatarProviderAvatarProvider :: !(Maybe Text) -- ^ "avatar_provider" - The avatar provider. Valid types are `gravatar` (uses the user email), `upload`, `initials`, `marble` (generates a random avatar for each user), `default`. + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON V1UserAvatarProvider +instance A.FromJSON V1UserAvatarProvider where + parseJSON = A.withObject "V1UserAvatarProvider" $ \o -> + V1UserAvatarProvider + <$> (o .:? "avatar_provider") + +-- | ToJSON V1UserAvatarProvider +instance A.ToJSON V1UserAvatarProvider where + toJSON V1UserAvatarProvider {..} = + _omitNulls + [ "avatar_provider" .= v1UserAvatarProviderAvatarProvider + ] + + +-- | Construct a value of type 'V1UserAvatarProvider' (by applying it's required fields, if any) +mkV1UserAvatarProvider + :: V1UserAvatarProvider +mkV1UserAvatarProvider = + V1UserAvatarProvider + { v1UserAvatarProviderAvatarProvider = Nothing + } + +-- ** V1UserDeletionRequestConfirm +-- | V1UserDeletionRequestConfirm +data V1UserDeletionRequestConfirm = V1UserDeletionRequestConfirm + { v1UserDeletionRequestConfirmToken :: !(Maybe Text) -- ^ "token" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON V1UserDeletionRequestConfirm +instance A.FromJSON V1UserDeletionRequestConfirm where + parseJSON = A.withObject "V1UserDeletionRequestConfirm" $ \o -> + V1UserDeletionRequestConfirm + <$> (o .:? "token") + +-- | ToJSON V1UserDeletionRequestConfirm +instance A.ToJSON V1UserDeletionRequestConfirm where + toJSON V1UserDeletionRequestConfirm {..} = + _omitNulls + [ "token" .= v1UserDeletionRequestConfirmToken + ] + + +-- | Construct a value of type 'V1UserDeletionRequestConfirm' (by applying it's required fields, if any) +mkV1UserDeletionRequestConfirm + :: V1UserDeletionRequestConfirm +mkV1UserDeletionRequestConfirm = + V1UserDeletionRequestConfirm + { v1UserDeletionRequestConfirmToken = Nothing + } + +-- ** V1UserPassword +-- | V1UserPassword +data V1UserPassword = V1UserPassword + { v1UserPasswordNewPassword :: !(Maybe Text) -- ^ "new_password" + , v1UserPasswordOldPassword :: !(Maybe Text) -- ^ "old_password" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON V1UserPassword +instance A.FromJSON V1UserPassword where + parseJSON = A.withObject "V1UserPassword" $ \o -> + V1UserPassword + <$> (o .:? "new_password") + <*> (o .:? "old_password") + +-- | ToJSON V1UserPassword +instance A.ToJSON V1UserPassword where + toJSON V1UserPassword {..} = + _omitNulls + [ "new_password" .= v1UserPasswordNewPassword + , "old_password" .= v1UserPasswordOldPassword + ] + + +-- | Construct a value of type 'V1UserPassword' (by applying it's required fields, if any) +mkV1UserPassword + :: V1UserPassword +mkV1UserPassword = + V1UserPassword + { v1UserPasswordNewPassword = Nothing + , v1UserPasswordOldPassword = Nothing + } + +-- ** V1UserPasswordConfirmation +-- | V1UserPasswordConfirmation +data V1UserPasswordConfirmation = V1UserPasswordConfirmation + { v1UserPasswordConfirmationPassword :: !(Maybe Text) -- ^ "password" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON V1UserPasswordConfirmation +instance A.FromJSON V1UserPasswordConfirmation where + parseJSON = A.withObject "V1UserPasswordConfirmation" $ \o -> + V1UserPasswordConfirmation + <$> (o .:? "password") + +-- | ToJSON V1UserPasswordConfirmation +instance A.ToJSON V1UserPasswordConfirmation where + toJSON V1UserPasswordConfirmation {..} = + _omitNulls + [ "password" .= v1UserPasswordConfirmationPassword + ] + + +-- | Construct a value of type 'V1UserPasswordConfirmation' (by applying it's required fields, if any) +mkV1UserPasswordConfirmation + :: V1UserPasswordConfirmation +mkV1UserPasswordConfirmation = + V1UserPasswordConfirmation + { v1UserPasswordConfirmationPassword = Nothing + } + +-- ** V1UserSettings +-- | V1UserSettings +data V1UserSettings = V1UserSettings + { v1UserSettingsDefaultProjectId :: !(Maybe Int) -- ^ "default_project_id" - If a task is created without a specified project this value should be used. Applies to tasks made directly in API and from clients. + , v1UserSettingsDiscoverableByEmail :: !(Maybe Bool) -- ^ "discoverable_by_email" - If true, the user can be found when searching for their exact email. + , v1UserSettingsDiscoverableByName :: !(Maybe Bool) -- ^ "discoverable_by_name" - If true, this user can be found by their name or parts of it when searching for it. + , v1UserSettingsEmailRemindersEnabled :: !(Maybe Bool) -- ^ "email_reminders_enabled" - If enabled, sends email reminders of tasks to the user. + , v1UserSettingsFrontendSettings :: !(Maybe A.Value) -- ^ "frontend_settings" - Additional settings only used by the frontend + , v1UserSettingsLanguage :: !(Maybe Text) -- ^ "language" - The user's language + , v1UserSettingsName :: !(Maybe Text) -- ^ "name" - The new name of the current user. + , v1UserSettingsOverdueTasksRemindersEnabled :: !(Maybe Bool) -- ^ "overdue_tasks_reminders_enabled" - If enabled, the user will get an email for their overdue tasks each morning. + , v1UserSettingsOverdueTasksRemindersTime :: !(Maybe Text) -- ^ "overdue_tasks_reminders_time" - The time when the daily summary of overdue tasks will be sent via email. + , v1UserSettingsTimezone :: !(Maybe Text) -- ^ "timezone" - The user's time zone. Used to send task reminders in the time zone of the user. + , v1UserSettingsWeekStart :: !(Maybe Int) -- ^ "week_start" - The day when the week starts for this user. 0 = sunday, 1 = monday, etc. + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON V1UserSettings +instance A.FromJSON V1UserSettings where + parseJSON = A.withObject "V1UserSettings" $ \o -> + V1UserSettings + <$> (o .:? "default_project_id") + <*> (o .:? "discoverable_by_email") + <*> (o .:? "discoverable_by_name") + <*> (o .:? "email_reminders_enabled") + <*> (o .:? "frontend_settings") + <*> (o .:? "language") + <*> (o .:? "name") + <*> (o .:? "overdue_tasks_reminders_enabled") + <*> (o .:? "overdue_tasks_reminders_time") + <*> (o .:? "timezone") + <*> (o .:? "week_start") + +-- | ToJSON V1UserSettings +instance A.ToJSON V1UserSettings where + toJSON V1UserSettings {..} = + _omitNulls + [ "default_project_id" .= v1UserSettingsDefaultProjectId + , "discoverable_by_email" .= v1UserSettingsDiscoverableByEmail + , "discoverable_by_name" .= v1UserSettingsDiscoverableByName + , "email_reminders_enabled" .= v1UserSettingsEmailRemindersEnabled + , "frontend_settings" .= v1UserSettingsFrontendSettings + , "language" .= v1UserSettingsLanguage + , "name" .= v1UserSettingsName + , "overdue_tasks_reminders_enabled" .= v1UserSettingsOverdueTasksRemindersEnabled + , "overdue_tasks_reminders_time" .= v1UserSettingsOverdueTasksRemindersTime + , "timezone" .= v1UserSettingsTimezone + , "week_start" .= v1UserSettingsWeekStart + ] + + +-- | Construct a value of type 'V1UserSettings' (by applying it's required fields, if any) +mkV1UserSettings + :: V1UserSettings +mkV1UserSettings = + V1UserSettings + { v1UserSettingsDefaultProjectId = Nothing + , v1UserSettingsDiscoverableByEmail = Nothing + , v1UserSettingsDiscoverableByName = Nothing + , v1UserSettingsEmailRemindersEnabled = Nothing + , v1UserSettingsFrontendSettings = Nothing + , v1UserSettingsLanguage = Nothing + , v1UserSettingsName = Nothing + , v1UserSettingsOverdueTasksRemindersEnabled = Nothing + , v1UserSettingsOverdueTasksRemindersTime = Nothing + , v1UserSettingsTimezone = Nothing + , v1UserSettingsWeekStart = Nothing + } + +-- ** V1UserWithSettings +-- | V1UserWithSettings +data V1UserWithSettings = V1UserWithSettings + { v1UserWithSettingsCreated :: !(Maybe Text) -- ^ "created" - A timestamp when this task was created. You cannot change this value. + , v1UserWithSettingsDeletionScheduledAt :: !(Maybe Text) -- ^ "deletion_scheduled_at" + , v1UserWithSettingsEmail :: !(Maybe Text) -- ^ "email" - The user's email address. + , v1UserWithSettingsId :: !(Maybe Int) -- ^ "id" - The unique, numeric id of this user. + , v1UserWithSettingsIsLocalUser :: !(Maybe Bool) -- ^ "is_local_user" + , v1UserWithSettingsName :: !(Maybe Text) -- ^ "name" - The full name of the user. + , v1UserWithSettingsSettings :: !(Maybe V1UserSettings) -- ^ "settings" + , v1UserWithSettingsUpdated :: !(Maybe Text) -- ^ "updated" - A timestamp when this task was last updated. You cannot change this value. + , v1UserWithSettingsUsername :: !(Maybe Text) -- ^ "username" - The username of the user. Is always unique. + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON V1UserWithSettings +instance A.FromJSON V1UserWithSettings where + parseJSON = A.withObject "V1UserWithSettings" $ \o -> + V1UserWithSettings + <$> (o .:? "created") + <*> (o .:? "deletion_scheduled_at") + <*> (o .:? "email") + <*> (o .:? "id") + <*> (o .:? "is_local_user") + <*> (o .:? "name") + <*> (o .:? "settings") + <*> (o .:? "updated") + <*> (o .:? "username") + +-- | ToJSON V1UserWithSettings +instance A.ToJSON V1UserWithSettings where + toJSON V1UserWithSettings {..} = + _omitNulls + [ "created" .= v1UserWithSettingsCreated + , "deletion_scheduled_at" .= v1UserWithSettingsDeletionScheduledAt + , "email" .= v1UserWithSettingsEmail + , "id" .= v1UserWithSettingsId + , "is_local_user" .= v1UserWithSettingsIsLocalUser + , "name" .= v1UserWithSettingsName + , "settings" .= v1UserWithSettingsSettings + , "updated" .= v1UserWithSettingsUpdated + , "username" .= v1UserWithSettingsUsername + ] + + +-- | Construct a value of type 'V1UserWithSettings' (by applying it's required fields, if any) +mkV1UserWithSettings + :: V1UserWithSettings +mkV1UserWithSettings = + V1UserWithSettings + { v1UserWithSettingsCreated = Nothing + , v1UserWithSettingsDeletionScheduledAt = Nothing + , v1UserWithSettingsEmail = Nothing + , v1UserWithSettingsId = Nothing + , v1UserWithSettingsIsLocalUser = Nothing + , v1UserWithSettingsName = Nothing + , v1UserWithSettingsSettings = Nothing + , v1UserWithSettingsUpdated = Nothing + , v1UserWithSettingsUsername = Nothing + } + +-- ** V1VikunjaInfos +-- | V1VikunjaInfos +data V1VikunjaInfos = V1VikunjaInfos + { v1VikunjaInfosAuth :: !(Maybe V1AuthInfo) -- ^ "auth" + , v1VikunjaInfosAvailableMigrators :: !(Maybe [Text]) -- ^ "available_migrators" + , v1VikunjaInfosCaldavEnabled :: !(Maybe Bool) -- ^ "caldav_enabled" + , v1VikunjaInfosDemoModeEnabled :: !(Maybe Bool) -- ^ "demo_mode_enabled" + , v1VikunjaInfosEmailRemindersEnabled :: !(Maybe Bool) -- ^ "email_reminders_enabled" + , v1VikunjaInfosEnabledBackgroundProviders :: !(Maybe [Text]) -- ^ "enabled_background_providers" + , v1VikunjaInfosFrontendUrl :: !(Maybe Text) -- ^ "frontend_url" + , v1VikunjaInfosLegal :: !(Maybe V1LegalInfo) -- ^ "legal" + , v1VikunjaInfosLinkSharingEnabled :: !(Maybe Bool) -- ^ "link_sharing_enabled" + , v1VikunjaInfosMaxFileSize :: !(Maybe Text) -- ^ "max_file_size" + , v1VikunjaInfosMotd :: !(Maybe Text) -- ^ "motd" + , v1VikunjaInfosPublicTeamsEnabled :: !(Maybe Bool) -- ^ "public_teams_enabled" + , v1VikunjaInfosRegistrationEnabled :: !(Maybe Bool) -- ^ "registration_enabled" + , v1VikunjaInfosTaskAttachmentsEnabled :: !(Maybe Bool) -- ^ "task_attachments_enabled" + , v1VikunjaInfosTaskCommentsEnabled :: !(Maybe Bool) -- ^ "task_comments_enabled" + , v1VikunjaInfosTotpEnabled :: !(Maybe Bool) -- ^ "totp_enabled" + , v1VikunjaInfosUserDeletionEnabled :: !(Maybe Bool) -- ^ "user_deletion_enabled" + , v1VikunjaInfosVersion :: !(Maybe Text) -- ^ "version" + , v1VikunjaInfosWebhooksEnabled :: !(Maybe Bool) -- ^ "webhooks_enabled" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON V1VikunjaInfos +instance A.FromJSON V1VikunjaInfos where + parseJSON = A.withObject "V1VikunjaInfos" $ \o -> + V1VikunjaInfos + <$> (o .:? "auth") + <*> (o .:? "available_migrators") + <*> (o .:? "caldav_enabled") + <*> (o .:? "demo_mode_enabled") + <*> (o .:? "email_reminders_enabled") + <*> (o .:? "enabled_background_providers") + <*> (o .:? "frontend_url") + <*> (o .:? "legal") + <*> (o .:? "link_sharing_enabled") + <*> (o .:? "max_file_size") + <*> (o .:? "motd") + <*> (o .:? "public_teams_enabled") + <*> (o .:? "registration_enabled") + <*> (o .:? "task_attachments_enabled") + <*> (o .:? "task_comments_enabled") + <*> (o .:? "totp_enabled") + <*> (o .:? "user_deletion_enabled") + <*> (o .:? "version") + <*> (o .:? "webhooks_enabled") + +-- | ToJSON V1VikunjaInfos +instance A.ToJSON V1VikunjaInfos where + toJSON V1VikunjaInfos {..} = + _omitNulls + [ "auth" .= v1VikunjaInfosAuth + , "available_migrators" .= v1VikunjaInfosAvailableMigrators + , "caldav_enabled" .= v1VikunjaInfosCaldavEnabled + , "demo_mode_enabled" .= v1VikunjaInfosDemoModeEnabled + , "email_reminders_enabled" .= v1VikunjaInfosEmailRemindersEnabled + , "enabled_background_providers" .= v1VikunjaInfosEnabledBackgroundProviders + , "frontend_url" .= v1VikunjaInfosFrontendUrl + , "legal" .= v1VikunjaInfosLegal + , "link_sharing_enabled" .= v1VikunjaInfosLinkSharingEnabled + , "max_file_size" .= v1VikunjaInfosMaxFileSize + , "motd" .= v1VikunjaInfosMotd + , "public_teams_enabled" .= v1VikunjaInfosPublicTeamsEnabled + , "registration_enabled" .= v1VikunjaInfosRegistrationEnabled + , "task_attachments_enabled" .= v1VikunjaInfosTaskAttachmentsEnabled + , "task_comments_enabled" .= v1VikunjaInfosTaskCommentsEnabled + , "totp_enabled" .= v1VikunjaInfosTotpEnabled + , "user_deletion_enabled" .= v1VikunjaInfosUserDeletionEnabled + , "version" .= v1VikunjaInfosVersion + , "webhooks_enabled" .= v1VikunjaInfosWebhooksEnabled + ] + + +-- | Construct a value of type 'V1VikunjaInfos' (by applying it's required fields, if any) +mkV1VikunjaInfos + :: V1VikunjaInfos +mkV1VikunjaInfos = + V1VikunjaInfos + { v1VikunjaInfosAuth = Nothing + , v1VikunjaInfosAvailableMigrators = Nothing + , v1VikunjaInfosCaldavEnabled = Nothing + , v1VikunjaInfosDemoModeEnabled = Nothing + , v1VikunjaInfosEmailRemindersEnabled = Nothing + , v1VikunjaInfosEnabledBackgroundProviders = Nothing + , v1VikunjaInfosFrontendUrl = Nothing + , v1VikunjaInfosLegal = Nothing + , v1VikunjaInfosLinkSharingEnabled = Nothing + , v1VikunjaInfosMaxFileSize = Nothing + , v1VikunjaInfosMotd = Nothing + , v1VikunjaInfosPublicTeamsEnabled = Nothing + , v1VikunjaInfosRegistrationEnabled = Nothing + , v1VikunjaInfosTaskAttachmentsEnabled = Nothing + , v1VikunjaInfosTaskCommentsEnabled = Nothing + , v1VikunjaInfosTotpEnabled = Nothing + , v1VikunjaInfosUserDeletionEnabled = Nothing + , v1VikunjaInfosVersion = Nothing + , v1VikunjaInfosWebhooksEnabled = Nothing + } + +-- ** WebHTTPError +-- | WebHTTPError +data WebHTTPError = WebHTTPError + { webHTTPErrorCode :: !(Maybe Int) -- ^ "code" + , webHTTPErrorMessage :: !(Maybe Text) -- ^ "message" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON WebHTTPError +instance A.FromJSON WebHTTPError where + parseJSON = A.withObject "WebHTTPError" $ \o -> + WebHTTPError + <$> (o .:? "code") + <*> (o .:? "message") + +-- | ToJSON WebHTTPError +instance A.ToJSON WebHTTPError where + toJSON WebHTTPError {..} = + _omitNulls + [ "code" .= webHTTPErrorCode + , "message" .= webHTTPErrorMessage + ] + + +-- | Construct a value of type 'WebHTTPError' (by applying it's required fields, if any) +mkWebHTTPError + :: WebHTTPError +mkWebHTTPError = + WebHTTPError + { webHTTPErrorCode = Nothing + , webHTTPErrorMessage = Nothing + } + + +-- * Enums + + +-- ** ModelsBucketConfigurationModeKind + +-- | Enum of 'Int' +data ModelsBucketConfigurationModeKind + = ModelsBucketConfigurationModeKindBucketConfigurationModeNone -- ^ @0@ + | ModelsBucketConfigurationModeKindBucketConfigurationModeManual -- ^ @1@ + | ModelsBucketConfigurationModeKindBucketConfigurationModeFilter -- ^ @2@ + deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) + +instance A.ToJSON ModelsBucketConfigurationModeKind where toJSON = A.toJSON . fromModelsBucketConfigurationModeKind +instance A.FromJSON ModelsBucketConfigurationModeKind where parseJSON o = P.either P.fail (pure . P.id) . toModelsBucketConfigurationModeKind =<< A.parseJSON o +instance WH.ToHttpApiData ModelsBucketConfigurationModeKind where toQueryParam = WH.toQueryParam . fromModelsBucketConfigurationModeKind +instance WH.FromHttpApiData ModelsBucketConfigurationModeKind where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toModelsBucketConfigurationModeKind +instance MimeRender MimeMultipartFormData ModelsBucketConfigurationModeKind where mimeRender _ = mimeRenderDefaultMultipartFormData + +-- | unwrap 'ModelsBucketConfigurationModeKind' enum +fromModelsBucketConfigurationModeKind :: ModelsBucketConfigurationModeKind -> Int +fromModelsBucketConfigurationModeKind = \case + ModelsBucketConfigurationModeKindBucketConfigurationModeNone -> 0 + ModelsBucketConfigurationModeKindBucketConfigurationModeManual -> 1 + ModelsBucketConfigurationModeKindBucketConfigurationModeFilter -> 2 + +-- | parse 'ModelsBucketConfigurationModeKind' enum +toModelsBucketConfigurationModeKind :: Int -> P.Either String ModelsBucketConfigurationModeKind +toModelsBucketConfigurationModeKind = \case + 0 -> P.Right ModelsBucketConfigurationModeKindBucketConfigurationModeNone + 1 -> P.Right ModelsBucketConfigurationModeKindBucketConfigurationModeManual + 2 -> P.Right ModelsBucketConfigurationModeKindBucketConfigurationModeFilter + s -> P.Left $ "toModelsBucketConfigurationModeKind: enum parse failure: " P.++ P.show s + + +-- ** ModelsProjectViewKind + +-- | Enum of 'Int' +data ModelsProjectViewKind + = ModelsProjectViewKindProjectViewKindList -- ^ @0@ + | ModelsProjectViewKindProjectViewKindGantt -- ^ @1@ + | ModelsProjectViewKindProjectViewKindTable -- ^ @2@ + | ModelsProjectViewKindProjectViewKindKanban -- ^ @3@ + deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) + +instance A.ToJSON ModelsProjectViewKind where toJSON = A.toJSON . fromModelsProjectViewKind +instance A.FromJSON ModelsProjectViewKind where parseJSON o = P.either P.fail (pure . P.id) . toModelsProjectViewKind =<< A.parseJSON o +instance WH.ToHttpApiData ModelsProjectViewKind where toQueryParam = WH.toQueryParam . fromModelsProjectViewKind +instance WH.FromHttpApiData ModelsProjectViewKind where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toModelsProjectViewKind +instance MimeRender MimeMultipartFormData ModelsProjectViewKind where mimeRender _ = mimeRenderDefaultMultipartFormData + +-- | unwrap 'ModelsProjectViewKind' enum +fromModelsProjectViewKind :: ModelsProjectViewKind -> Int +fromModelsProjectViewKind = \case + ModelsProjectViewKindProjectViewKindList -> 0 + ModelsProjectViewKindProjectViewKindGantt -> 1 + ModelsProjectViewKindProjectViewKindTable -> 2 + ModelsProjectViewKindProjectViewKindKanban -> 3 + +-- | parse 'ModelsProjectViewKind' enum +toModelsProjectViewKind :: Int -> P.Either String ModelsProjectViewKind +toModelsProjectViewKind = \case + 0 -> P.Right ModelsProjectViewKindProjectViewKindList + 1 -> P.Right ModelsProjectViewKindProjectViewKindGantt + 2 -> P.Right ModelsProjectViewKindProjectViewKindTable + 3 -> P.Right ModelsProjectViewKindProjectViewKindKanban + s -> P.Left $ "toModelsProjectViewKind: enum parse failure: " P.++ P.show s + + +-- ** ModelsRelationKind + +-- | Enum of 'Text' +data ModelsRelationKind + = ModelsRelationKindRelationKindUnknown -- ^ @"unknown"@ + | ModelsRelationKindRelationKindSubtask -- ^ @"subtask"@ + | ModelsRelationKindRelationKindParenttask -- ^ @"parenttask"@ + | ModelsRelationKindRelationKindRelated -- ^ @"related"@ + | ModelsRelationKindRelationKindDuplicateOf -- ^ @"duplicateof"@ + | ModelsRelationKindRelationKindDuplicates -- ^ @"duplicates"@ + | ModelsRelationKindRelationKindBlocking -- ^ @"blocking"@ + | ModelsRelationKindRelationKindBlocked -- ^ @"blocked"@ + | ModelsRelationKindRelationKindPreceeds -- ^ @"precedes"@ + | ModelsRelationKindRelationKindFollows -- ^ @"follows"@ + | ModelsRelationKindRelationKindCopiedFrom -- ^ @"copiedfrom"@ + | ModelsRelationKindRelationKindCopiedTo -- ^ @"copiedto"@ + deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) + +instance A.ToJSON ModelsRelationKind where toJSON = A.toJSON . fromModelsRelationKind +instance A.FromJSON ModelsRelationKind where parseJSON o = P.either P.fail (pure . P.id) . toModelsRelationKind =<< A.parseJSON o +instance WH.ToHttpApiData ModelsRelationKind where toQueryParam = WH.toQueryParam . fromModelsRelationKind +instance WH.FromHttpApiData ModelsRelationKind where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toModelsRelationKind +instance MimeRender MimeMultipartFormData ModelsRelationKind where mimeRender _ = mimeRenderDefaultMultipartFormData + +-- | unwrap 'ModelsRelationKind' enum +fromModelsRelationKind :: ModelsRelationKind -> Text +fromModelsRelationKind = \case + ModelsRelationKindRelationKindUnknown -> "unknown" + ModelsRelationKindRelationKindSubtask -> "subtask" + ModelsRelationKindRelationKindParenttask -> "parenttask" + ModelsRelationKindRelationKindRelated -> "related" + ModelsRelationKindRelationKindDuplicateOf -> "duplicateof" + ModelsRelationKindRelationKindDuplicates -> "duplicates" + ModelsRelationKindRelationKindBlocking -> "blocking" + ModelsRelationKindRelationKindBlocked -> "blocked" + ModelsRelationKindRelationKindPreceeds -> "precedes" + ModelsRelationKindRelationKindFollows -> "follows" + ModelsRelationKindRelationKindCopiedFrom -> "copiedfrom" + ModelsRelationKindRelationKindCopiedTo -> "copiedto" + +-- | parse 'ModelsRelationKind' enum +toModelsRelationKind :: Text -> P.Either String ModelsRelationKind +toModelsRelationKind = \case + "unknown" -> P.Right ModelsRelationKindRelationKindUnknown + "subtask" -> P.Right ModelsRelationKindRelationKindSubtask + "parenttask" -> P.Right ModelsRelationKindRelationKindParenttask + "related" -> P.Right ModelsRelationKindRelationKindRelated + "duplicateof" -> P.Right ModelsRelationKindRelationKindDuplicateOf + "duplicates" -> P.Right ModelsRelationKindRelationKindDuplicates + "blocking" -> P.Right ModelsRelationKindRelationKindBlocking + "blocked" -> P.Right ModelsRelationKindRelationKindBlocked + "precedes" -> P.Right ModelsRelationKindRelationKindPreceeds + "follows" -> P.Right ModelsRelationKindRelationKindFollows + "copiedfrom" -> P.Right ModelsRelationKindRelationKindCopiedFrom + "copiedto" -> P.Right ModelsRelationKindRelationKindCopiedTo + s -> P.Left $ "toModelsRelationKind: enum parse failure: " P.++ P.show s + + +-- ** ModelsReminderRelation + +-- | Enum of 'Text' +data ModelsReminderRelation + = ModelsReminderRelationReminderRelationDueDate -- ^ @"due_date"@ + | ModelsReminderRelationReminderRelationStartDate -- ^ @"start_date"@ + | ModelsReminderRelationReminderRelationEndDate -- ^ @"end_date"@ + deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) + +instance A.ToJSON ModelsReminderRelation where toJSON = A.toJSON . fromModelsReminderRelation +instance A.FromJSON ModelsReminderRelation where parseJSON o = P.either P.fail (pure . P.id) . toModelsReminderRelation =<< A.parseJSON o +instance WH.ToHttpApiData ModelsReminderRelation where toQueryParam = WH.toQueryParam . fromModelsReminderRelation +instance WH.FromHttpApiData ModelsReminderRelation where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toModelsReminderRelation +instance MimeRender MimeMultipartFormData ModelsReminderRelation where mimeRender _ = mimeRenderDefaultMultipartFormData + +-- | unwrap 'ModelsReminderRelation' enum +fromModelsReminderRelation :: ModelsReminderRelation -> Text +fromModelsReminderRelation = \case + ModelsReminderRelationReminderRelationDueDate -> "due_date" + ModelsReminderRelationReminderRelationStartDate -> "start_date" + ModelsReminderRelationReminderRelationEndDate -> "end_date" + +-- | parse 'ModelsReminderRelation' enum +toModelsReminderRelation :: Text -> P.Either String ModelsReminderRelation +toModelsReminderRelation = \case + "due_date" -> P.Right ModelsReminderRelationReminderRelationDueDate + "start_date" -> P.Right ModelsReminderRelationReminderRelationStartDate + "end_date" -> P.Right ModelsReminderRelationReminderRelationEndDate + s -> P.Left $ "toModelsReminderRelation: enum parse failure: " P.++ P.show s + + +-- ** ModelsRight + +-- | Enum of 'Int' +data ModelsRight + = ModelsRightRightRead -- ^ @0@ + | ModelsRightRightWrite -- ^ @1@ + | ModelsRightRightAdmin -- ^ @2@ + deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) + +instance A.ToJSON ModelsRight where toJSON = A.toJSON . fromModelsRight +instance A.FromJSON ModelsRight where parseJSON o = P.either P.fail (pure . P.id) . toModelsRight =<< A.parseJSON o +instance WH.ToHttpApiData ModelsRight where toQueryParam = WH.toQueryParam . fromModelsRight +instance WH.FromHttpApiData ModelsRight where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toModelsRight +instance MimeRender MimeMultipartFormData ModelsRight where mimeRender _ = mimeRenderDefaultMultipartFormData + +-- | unwrap 'ModelsRight' enum +fromModelsRight :: ModelsRight -> Int +fromModelsRight = \case + ModelsRightRightRead -> 0 + ModelsRightRightWrite -> 1 + ModelsRightRightAdmin -> 2 + +-- | parse 'ModelsRight' enum +toModelsRight :: Int -> P.Either String ModelsRight +toModelsRight = \case + 0 -> P.Right ModelsRightRightRead + 1 -> P.Right ModelsRightRightWrite + 2 -> P.Right ModelsRightRightAdmin + s -> P.Left $ "toModelsRight: enum parse failure: " P.++ P.show s + + +-- ** ModelsSharingType + +-- | Enum of 'Int' +data ModelsSharingType + = ModelsSharingTypeSharingTypeUnknown -- ^ @0@ + | ModelsSharingTypeSharingTypeWithoutPassword -- ^ @1@ + | ModelsSharingTypeSharingTypeWithPassword -- ^ @2@ + deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) + +instance A.ToJSON ModelsSharingType where toJSON = A.toJSON . fromModelsSharingType +instance A.FromJSON ModelsSharingType where parseJSON o = P.either P.fail (pure . P.id) . toModelsSharingType =<< A.parseJSON o +instance WH.ToHttpApiData ModelsSharingType where toQueryParam = WH.toQueryParam . fromModelsSharingType +instance WH.FromHttpApiData ModelsSharingType where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toModelsSharingType +instance MimeRender MimeMultipartFormData ModelsSharingType where mimeRender _ = mimeRenderDefaultMultipartFormData + +-- | unwrap 'ModelsSharingType' enum +fromModelsSharingType :: ModelsSharingType -> Int +fromModelsSharingType = \case + ModelsSharingTypeSharingTypeUnknown -> 0 + ModelsSharingTypeSharingTypeWithoutPassword -> 1 + ModelsSharingTypeSharingTypeWithPassword -> 2 + +-- | parse 'ModelsSharingType' enum +toModelsSharingType :: Int -> P.Either String ModelsSharingType +toModelsSharingType = \case + 0 -> P.Right ModelsSharingTypeSharingTypeUnknown + 1 -> P.Right ModelsSharingTypeSharingTypeWithoutPassword + 2 -> P.Right ModelsSharingTypeSharingTypeWithPassword + s -> P.Left $ "toModelsSharingType: enum parse failure: " P.++ P.show s + + +-- ** ModelsTaskRepeatMode + +-- | Enum of 'Int' +data ModelsTaskRepeatMode + = ModelsTaskRepeatModeTaskRepeatModeDefault -- ^ @0@ + | ModelsTaskRepeatModeTaskRepeatModeMonth -- ^ @1@ + | ModelsTaskRepeatModeTaskRepeatModeFromCurrentDate -- ^ @2@ + deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) + +instance A.ToJSON ModelsTaskRepeatMode where toJSON = A.toJSON . fromModelsTaskRepeatMode +instance A.FromJSON ModelsTaskRepeatMode where parseJSON o = P.either P.fail (pure . P.id) . toModelsTaskRepeatMode =<< A.parseJSON o +instance WH.ToHttpApiData ModelsTaskRepeatMode where toQueryParam = WH.toQueryParam . fromModelsTaskRepeatMode +instance WH.FromHttpApiData ModelsTaskRepeatMode where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toModelsTaskRepeatMode +instance MimeRender MimeMultipartFormData ModelsTaskRepeatMode where mimeRender _ = mimeRenderDefaultMultipartFormData + +-- | unwrap 'ModelsTaskRepeatMode' enum +fromModelsTaskRepeatMode :: ModelsTaskRepeatMode -> Int +fromModelsTaskRepeatMode = \case + ModelsTaskRepeatModeTaskRepeatModeDefault -> 0 + ModelsTaskRepeatModeTaskRepeatModeMonth -> 1 + ModelsTaskRepeatModeTaskRepeatModeFromCurrentDate -> 2 + +-- | parse 'ModelsTaskRepeatMode' enum +toModelsTaskRepeatMode :: Int -> P.Either String ModelsTaskRepeatMode +toModelsTaskRepeatMode = \case + 0 -> P.Right ModelsTaskRepeatModeTaskRepeatModeDefault + 1 -> P.Right ModelsTaskRepeatModeTaskRepeatModeMonth + 2 -> P.Right ModelsTaskRepeatModeTaskRepeatModeFromCurrentDate + s -> P.Left $ "toModelsTaskRepeatMode: enum parse failure: " P.++ P.show s + + +-- * Auth Methods + +-- ** AuthBasicBasicAuth +data AuthBasicBasicAuth = + AuthBasicBasicAuth B.ByteString B.ByteString -- ^ username password + deriving (P.Eq, P.Show, P.Typeable) + +instance AuthMethod AuthBasicBasicAuth where + applyAuthMethod _ a@(AuthBasicBasicAuth user pw) req = + P.pure $ + if (P.typeOf a `P.elem` rAuthTypes req) + then req `setHeader` toHeader ("Authorization", T.decodeUtf8 cred) + & L.over rAuthTypesL (P.filter (/= P.typeOf a)) + else req + where cred = BC.append "Basic " (B64.encode $ BC.concat [ user, ":", pw ]) + +-- ** AuthApiKeyJWTKeyAuth +data AuthApiKeyJWTKeyAuth = + AuthApiKeyJWTKeyAuth Text -- ^ secret + deriving (P.Eq, P.Show, P.Typeable) + +instance AuthMethod AuthApiKeyJWTKeyAuth where + applyAuthMethod _ a@(AuthApiKeyJWTKeyAuth secret) req = + P.pure $ + if (P.typeOf a `P.elem` rAuthTypes req) + then req `setHeader` toHeader ("Authorization", secret) + & L.over rAuthTypesL (P.filter (/= P.typeOf a)) + else req + + diff --git a/lib/Vikunja/ModelLens.hs b/lib/Vikunja/ModelLens.hs new file mode 100644 index 0000000..7ddef68 --- /dev/null +++ b/lib/Vikunja/ModelLens.hs @@ -0,0 +1,2618 @@ +{- + Vikunja API + + # Pagination Every endpoint capable of pagination will return two headers: * `x-pagination-total-pages`: The total number of available pages for this request * `x-pagination-result-count`: The number of items returned for this request. # Rights All endpoints which return a single item (project, task, etc.) - no array - will also return a `x-max-right` header with the max right the user has on this item as an int where `0` is `Read Only`, `1` is `Read & Write` and `2` is `Admin`. This can be used to show or hide ui elements based on the rights the user has. # Errors All errors have an error code and a human-readable error message in addition to the http status code. You should always check for the status code in the response, not only the http status code. Due to limitations in the swagger library we're using for this document, only one error per http status code is documented here. Make sure to check the [error docs](https://vikunja.io/docs/errors/) in Vikunja's documentation for a full list of available error codes. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. **API Token:** You can create scoped API tokens for your user and use the token to make authenticated requests in the context of that user. The token must be provided via an `Authorization: Bearer ` header, similar to jwt auth. See the documentation for the `api` group to manage token creation and revocation. **BasicAuth:** Only used when requesting tasks via CalDAV. + + OpenAPI Version: 3.0.1 + Vikunja API API version: 0.24.6 + Contact: hello@vikunja.io + Generated by OpenAPI Generator (https://openapi-generator.tech) +-} + +{-| +Module : Vikunja.Lens +-} + +{-# LANGUAGE KindSignatures #-} +{-# LANGUAGE NamedFieldPuns #-} +{-# LANGUAGE RankNTypes #-} +{-# LANGUAGE RecordWildCards #-} +{-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-matches -fno-warn-unused-binds -fno-warn-unused-imports #-} + +module Vikunja.ModelLens where + +import qualified Data.Aeson as A +import qualified Data.ByteString.Lazy as BL +import qualified Data.Data as P (Data, Typeable) +import qualified Data.Map as Map +import qualified Data.Set as Set +import qualified Data.Time as TI + +import Data.Text (Text) + +import Prelude (($), (.),(<$>),(<*>),(=<<),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty,maybe,pure,Monad,Applicative,Functor) +import qualified Prelude as P + +import Vikunja.Model +import Vikunja.Core + + +-- * AuthToken + +-- | 'authTokenToken' Lens +authTokenTokenL :: Lens_' AuthToken (Maybe Text) +authTokenTokenL f AuthToken{..} = (\authTokenToken -> AuthToken { authTokenToken, ..} ) <$> f authTokenToken +{-# INLINE authTokenTokenL #-} + + + +-- * BackgroundImage + +-- | 'backgroundImageBlurHash' Lens +backgroundImageBlurHashL :: Lens_' BackgroundImage (Maybe Text) +backgroundImageBlurHashL f BackgroundImage{..} = (\backgroundImageBlurHash -> BackgroundImage { backgroundImageBlurHash, ..} ) <$> f backgroundImageBlurHash +{-# INLINE backgroundImageBlurHashL #-} + +-- | 'backgroundImageId' Lens +backgroundImageIdL :: Lens_' BackgroundImage (Maybe Text) +backgroundImageIdL f BackgroundImage{..} = (\backgroundImageId -> BackgroundImage { backgroundImageId, ..} ) <$> f backgroundImageId +{-# INLINE backgroundImageIdL #-} + +-- | 'backgroundImageInfo' Lens +backgroundImageInfoL :: Lens_' BackgroundImage (Maybe A.Value) +backgroundImageInfoL f BackgroundImage{..} = (\backgroundImageInfo -> BackgroundImage { backgroundImageInfo, ..} ) <$> f backgroundImageInfo +{-# INLINE backgroundImageInfoL #-} + +-- | 'backgroundImageThumb' Lens +backgroundImageThumbL :: Lens_' BackgroundImage (Maybe Text) +backgroundImageThumbL f BackgroundImage{..} = (\backgroundImageThumb -> BackgroundImage { backgroundImageThumb, ..} ) <$> f backgroundImageThumb +{-# INLINE backgroundImageThumbL #-} + +-- | 'backgroundImageUrl' Lens +backgroundImageUrlL :: Lens_' BackgroundImage (Maybe Text) +backgroundImageUrlL f BackgroundImage{..} = (\backgroundImageUrl -> BackgroundImage { backgroundImageUrl, ..} ) <$> f backgroundImageUrl +{-# INLINE backgroundImageUrlL #-} + + + +-- * FilesFile + +-- | 'filesFileCreated' Lens +filesFileCreatedL :: Lens_' FilesFile (Maybe Text) +filesFileCreatedL f FilesFile{..} = (\filesFileCreated -> FilesFile { filesFileCreated, ..} ) <$> f filesFileCreated +{-# INLINE filesFileCreatedL #-} + +-- | 'filesFileId' Lens +filesFileIdL :: Lens_' FilesFile (Maybe Int) +filesFileIdL f FilesFile{..} = (\filesFileId -> FilesFile { filesFileId, ..} ) <$> f filesFileId +{-# INLINE filesFileIdL #-} + +-- | 'filesFileMime' Lens +filesFileMimeL :: Lens_' FilesFile (Maybe Text) +filesFileMimeL f FilesFile{..} = (\filesFileMime -> FilesFile { filesFileMime, ..} ) <$> f filesFileMime +{-# INLINE filesFileMimeL #-} + +-- | 'filesFileName' Lens +filesFileNameL :: Lens_' FilesFile (Maybe Text) +filesFileNameL f FilesFile{..} = (\filesFileName -> FilesFile { filesFileName, ..} ) <$> f filesFileName +{-# INLINE filesFileNameL #-} + +-- | 'filesFileSize' Lens +filesFileSizeL :: Lens_' FilesFile (Maybe Int) +filesFileSizeL f FilesFile{..} = (\filesFileSize -> FilesFile { filesFileSize, ..} ) <$> f filesFileSize +{-# INLINE filesFileSizeL #-} + + + +-- * HandlerAuthURL + +-- | 'handlerAuthURLUrl' Lens +handlerAuthURLUrlL :: Lens_' HandlerAuthURL (Maybe Text) +handlerAuthURLUrlL f HandlerAuthURL{..} = (\handlerAuthURLUrl -> HandlerAuthURL { handlerAuthURLUrl, ..} ) <$> f handlerAuthURLUrl +{-# INLINE handlerAuthURLUrlL #-} + + + +-- * MicrosofttodoMigration + +-- | 'microsofttodoMigrationCode' Lens +microsofttodoMigrationCodeL :: Lens_' MicrosofttodoMigration (Maybe Text) +microsofttodoMigrationCodeL f MicrosofttodoMigration{..} = (\microsofttodoMigrationCode -> MicrosofttodoMigration { microsofttodoMigrationCode, ..} ) <$> f microsofttodoMigrationCode +{-# INLINE microsofttodoMigrationCodeL #-} + + + +-- * MigrationStatus + +-- | 'migrationStatusFinishedAt' Lens +migrationStatusFinishedAtL :: Lens_' MigrationStatus (Maybe Text) +migrationStatusFinishedAtL f MigrationStatus{..} = (\migrationStatusFinishedAt -> MigrationStatus { migrationStatusFinishedAt, ..} ) <$> f migrationStatusFinishedAt +{-# INLINE migrationStatusFinishedAtL #-} + +-- | 'migrationStatusId' Lens +migrationStatusIdL :: Lens_' MigrationStatus (Maybe Int) +migrationStatusIdL f MigrationStatus{..} = (\migrationStatusId -> MigrationStatus { migrationStatusId, ..} ) <$> f migrationStatusId +{-# INLINE migrationStatusIdL #-} + +-- | 'migrationStatusMigratorName' Lens +migrationStatusMigratorNameL :: Lens_' MigrationStatus (Maybe Text) +migrationStatusMigratorNameL f MigrationStatus{..} = (\migrationStatusMigratorName -> MigrationStatus { migrationStatusMigratorName, ..} ) <$> f migrationStatusMigratorName +{-# INLINE migrationStatusMigratorNameL #-} + +-- | 'migrationStatusStartedAt' Lens +migrationStatusStartedAtL :: Lens_' MigrationStatus (Maybe Text) +migrationStatusStartedAtL f MigrationStatus{..} = (\migrationStatusStartedAt -> MigrationStatus { migrationStatusStartedAt, ..} ) <$> f migrationStatusStartedAt +{-# INLINE migrationStatusStartedAtL #-} + + + +-- * ModelsAPIToken + +-- | 'modelsAPITokenCreated' Lens +modelsAPITokenCreatedL :: Lens_' ModelsAPIToken (Maybe Text) +modelsAPITokenCreatedL f ModelsAPIToken{..} = (\modelsAPITokenCreated -> ModelsAPIToken { modelsAPITokenCreated, ..} ) <$> f modelsAPITokenCreated +{-# INLINE modelsAPITokenCreatedL #-} + +-- | 'modelsAPITokenExpiresAt' Lens +modelsAPITokenExpiresAtL :: Lens_' ModelsAPIToken (Maybe Text) +modelsAPITokenExpiresAtL f ModelsAPIToken{..} = (\modelsAPITokenExpiresAt -> ModelsAPIToken { modelsAPITokenExpiresAt, ..} ) <$> f modelsAPITokenExpiresAt +{-# INLINE modelsAPITokenExpiresAtL #-} + +-- | 'modelsAPITokenId' Lens +modelsAPITokenIdL :: Lens_' ModelsAPIToken (Maybe Int) +modelsAPITokenIdL f ModelsAPIToken{..} = (\modelsAPITokenId -> ModelsAPIToken { modelsAPITokenId, ..} ) <$> f modelsAPITokenId +{-# INLINE modelsAPITokenIdL #-} + +-- | 'modelsAPITokenPermissions' Lens +modelsAPITokenPermissionsL :: Lens_' ModelsAPIToken (Maybe Map) +modelsAPITokenPermissionsL f ModelsAPIToken{..} = (\modelsAPITokenPermissions -> ModelsAPIToken { modelsAPITokenPermissions, ..} ) <$> f modelsAPITokenPermissions +{-# INLINE modelsAPITokenPermissionsL #-} + +-- | 'modelsAPITokenTitle' Lens +modelsAPITokenTitleL :: Lens_' ModelsAPIToken (Maybe Text) +modelsAPITokenTitleL f ModelsAPIToken{..} = (\modelsAPITokenTitle -> ModelsAPIToken { modelsAPITokenTitle, ..} ) <$> f modelsAPITokenTitle +{-# INLINE modelsAPITokenTitleL #-} + +-- | 'modelsAPITokenToken' Lens +modelsAPITokenTokenL :: Lens_' ModelsAPIToken (Maybe Text) +modelsAPITokenTokenL f ModelsAPIToken{..} = (\modelsAPITokenToken -> ModelsAPIToken { modelsAPITokenToken, ..} ) <$> f modelsAPITokenToken +{-# INLINE modelsAPITokenTokenL #-} + + + +-- * ModelsBucket + +-- | 'modelsBucketCount' Lens +modelsBucketCountL :: Lens_' ModelsBucket (Maybe Int) +modelsBucketCountL f ModelsBucket{..} = (\modelsBucketCount -> ModelsBucket { modelsBucketCount, ..} ) <$> f modelsBucketCount +{-# INLINE modelsBucketCountL #-} + +-- | 'modelsBucketCreated' Lens +modelsBucketCreatedL :: Lens_' ModelsBucket (Maybe Text) +modelsBucketCreatedL f ModelsBucket{..} = (\modelsBucketCreated -> ModelsBucket { modelsBucketCreated, ..} ) <$> f modelsBucketCreated +{-# INLINE modelsBucketCreatedL #-} + +-- | 'modelsBucketCreatedBy' Lens +modelsBucketCreatedByL :: Lens_' ModelsBucket (Maybe ModelsBucketCreatedBy) +modelsBucketCreatedByL f ModelsBucket{..} = (\modelsBucketCreatedBy -> ModelsBucket { modelsBucketCreatedBy, ..} ) <$> f modelsBucketCreatedBy +{-# INLINE modelsBucketCreatedByL #-} + +-- | 'modelsBucketId' Lens +modelsBucketIdL :: Lens_' ModelsBucket (Maybe Int) +modelsBucketIdL f ModelsBucket{..} = (\modelsBucketId -> ModelsBucket { modelsBucketId, ..} ) <$> f modelsBucketId +{-# INLINE modelsBucketIdL #-} + +-- | 'modelsBucketLimit' Lens +modelsBucketLimitL :: Lens_' ModelsBucket (Maybe Int) +modelsBucketLimitL f ModelsBucket{..} = (\modelsBucketLimit -> ModelsBucket { modelsBucketLimit, ..} ) <$> f modelsBucketLimit +{-# INLINE modelsBucketLimitL #-} + +-- | 'modelsBucketPosition' Lens +modelsBucketPositionL :: Lens_' ModelsBucket (Maybe Double) +modelsBucketPositionL f ModelsBucket{..} = (\modelsBucketPosition -> ModelsBucket { modelsBucketPosition, ..} ) <$> f modelsBucketPosition +{-# INLINE modelsBucketPositionL #-} + +-- | 'modelsBucketProjectViewId' Lens +modelsBucketProjectViewIdL :: Lens_' ModelsBucket (Maybe Int) +modelsBucketProjectViewIdL f ModelsBucket{..} = (\modelsBucketProjectViewId -> ModelsBucket { modelsBucketProjectViewId, ..} ) <$> f modelsBucketProjectViewId +{-# INLINE modelsBucketProjectViewIdL #-} + +-- | 'modelsBucketTasks' Lens +modelsBucketTasksL :: Lens_' ModelsBucket (Maybe [ModelsTask]) +modelsBucketTasksL f ModelsBucket{..} = (\modelsBucketTasks -> ModelsBucket { modelsBucketTasks, ..} ) <$> f modelsBucketTasks +{-# INLINE modelsBucketTasksL #-} + +-- | 'modelsBucketTitle' Lens +modelsBucketTitleL :: Lens_' ModelsBucket (Maybe Text) +modelsBucketTitleL f ModelsBucket{..} = (\modelsBucketTitle -> ModelsBucket { modelsBucketTitle, ..} ) <$> f modelsBucketTitle +{-# INLINE modelsBucketTitleL #-} + +-- | 'modelsBucketUpdated' Lens +modelsBucketUpdatedL :: Lens_' ModelsBucket (Maybe Text) +modelsBucketUpdatedL f ModelsBucket{..} = (\modelsBucketUpdated -> ModelsBucket { modelsBucketUpdated, ..} ) <$> f modelsBucketUpdated +{-# INLINE modelsBucketUpdatedL #-} + + + +-- * ModelsBucketConfigurationModeKind + + + +-- * ModelsBucketCreatedBy + +-- | 'modelsBucketCreatedByCreated' Lens +modelsBucketCreatedByCreatedL :: Lens_' ModelsBucketCreatedBy (Maybe Text) +modelsBucketCreatedByCreatedL f ModelsBucketCreatedBy{..} = (\modelsBucketCreatedByCreated -> ModelsBucketCreatedBy { modelsBucketCreatedByCreated, ..} ) <$> f modelsBucketCreatedByCreated +{-# INLINE modelsBucketCreatedByCreatedL #-} + +-- | 'modelsBucketCreatedByEmail' Lens +modelsBucketCreatedByEmailL :: Lens_' ModelsBucketCreatedBy (Maybe Text) +modelsBucketCreatedByEmailL f ModelsBucketCreatedBy{..} = (\modelsBucketCreatedByEmail -> ModelsBucketCreatedBy { modelsBucketCreatedByEmail, ..} ) <$> f modelsBucketCreatedByEmail +{-# INLINE modelsBucketCreatedByEmailL #-} + +-- | 'modelsBucketCreatedById' Lens +modelsBucketCreatedByIdL :: Lens_' ModelsBucketCreatedBy (Maybe Int) +modelsBucketCreatedByIdL f ModelsBucketCreatedBy{..} = (\modelsBucketCreatedById -> ModelsBucketCreatedBy { modelsBucketCreatedById, ..} ) <$> f modelsBucketCreatedById +{-# INLINE modelsBucketCreatedByIdL #-} + +-- | 'modelsBucketCreatedByName' Lens +modelsBucketCreatedByNameL :: Lens_' ModelsBucketCreatedBy (Maybe Text) +modelsBucketCreatedByNameL f ModelsBucketCreatedBy{..} = (\modelsBucketCreatedByName -> ModelsBucketCreatedBy { modelsBucketCreatedByName, ..} ) <$> f modelsBucketCreatedByName +{-# INLINE modelsBucketCreatedByNameL #-} + +-- | 'modelsBucketCreatedByUpdated' Lens +modelsBucketCreatedByUpdatedL :: Lens_' ModelsBucketCreatedBy (Maybe Text) +modelsBucketCreatedByUpdatedL f ModelsBucketCreatedBy{..} = (\modelsBucketCreatedByUpdated -> ModelsBucketCreatedBy { modelsBucketCreatedByUpdated, ..} ) <$> f modelsBucketCreatedByUpdated +{-# INLINE modelsBucketCreatedByUpdatedL #-} + +-- | 'modelsBucketCreatedByUsername' Lens +modelsBucketCreatedByUsernameL :: Lens_' ModelsBucketCreatedBy (Maybe Text) +modelsBucketCreatedByUsernameL f ModelsBucketCreatedBy{..} = (\modelsBucketCreatedByUsername -> ModelsBucketCreatedBy { modelsBucketCreatedByUsername, ..} ) <$> f modelsBucketCreatedByUsername +{-# INLINE modelsBucketCreatedByUsernameL #-} + + + +-- * ModelsBulkAssignees + +-- | 'modelsBulkAssigneesAssignees' Lens +modelsBulkAssigneesAssigneesL :: Lens_' ModelsBulkAssignees (Maybe [UserUser]) +modelsBulkAssigneesAssigneesL f ModelsBulkAssignees{..} = (\modelsBulkAssigneesAssignees -> ModelsBulkAssignees { modelsBulkAssigneesAssignees, ..} ) <$> f modelsBulkAssigneesAssignees +{-# INLINE modelsBulkAssigneesAssigneesL #-} + + + +-- * ModelsBulkTask + +-- | 'modelsBulkTaskAssignees' Lens +modelsBulkTaskAssigneesL :: Lens_' ModelsBulkTask (Maybe [UserUser]) +modelsBulkTaskAssigneesL f ModelsBulkTask{..} = (\modelsBulkTaskAssignees -> ModelsBulkTask { modelsBulkTaskAssignees, ..} ) <$> f modelsBulkTaskAssignees +{-# INLINE modelsBulkTaskAssigneesL #-} + +-- | 'modelsBulkTaskAttachments' Lens +modelsBulkTaskAttachmentsL :: Lens_' ModelsBulkTask (Maybe [ModelsTaskAttachment]) +modelsBulkTaskAttachmentsL f ModelsBulkTask{..} = (\modelsBulkTaskAttachments -> ModelsBulkTask { modelsBulkTaskAttachments, ..} ) <$> f modelsBulkTaskAttachments +{-# INLINE modelsBulkTaskAttachmentsL #-} + +-- | 'modelsBulkTaskBucketId' Lens +modelsBulkTaskBucketIdL :: Lens_' ModelsBulkTask (Maybe Int) +modelsBulkTaskBucketIdL f ModelsBulkTask{..} = (\modelsBulkTaskBucketId -> ModelsBulkTask { modelsBulkTaskBucketId, ..} ) <$> f modelsBulkTaskBucketId +{-# INLINE modelsBulkTaskBucketIdL #-} + +-- | 'modelsBulkTaskCoverImageAttachmentId' Lens +modelsBulkTaskCoverImageAttachmentIdL :: Lens_' ModelsBulkTask (Maybe Int) +modelsBulkTaskCoverImageAttachmentIdL f ModelsBulkTask{..} = (\modelsBulkTaskCoverImageAttachmentId -> ModelsBulkTask { modelsBulkTaskCoverImageAttachmentId, ..} ) <$> f modelsBulkTaskCoverImageAttachmentId +{-# INLINE modelsBulkTaskCoverImageAttachmentIdL #-} + +-- | 'modelsBulkTaskCreated' Lens +modelsBulkTaskCreatedL :: Lens_' ModelsBulkTask (Maybe Text) +modelsBulkTaskCreatedL f ModelsBulkTask{..} = (\modelsBulkTaskCreated -> ModelsBulkTask { modelsBulkTaskCreated, ..} ) <$> f modelsBulkTaskCreated +{-# INLINE modelsBulkTaskCreatedL #-} + +-- | 'modelsBulkTaskCreatedBy' Lens +modelsBulkTaskCreatedByL :: Lens_' ModelsBulkTask (Maybe ModelsBulkTaskCreatedBy) +modelsBulkTaskCreatedByL f ModelsBulkTask{..} = (\modelsBulkTaskCreatedBy -> ModelsBulkTask { modelsBulkTaskCreatedBy, ..} ) <$> f modelsBulkTaskCreatedBy +{-# INLINE modelsBulkTaskCreatedByL #-} + +-- | 'modelsBulkTaskDescription' Lens +modelsBulkTaskDescriptionL :: Lens_' ModelsBulkTask (Maybe Text) +modelsBulkTaskDescriptionL f ModelsBulkTask{..} = (\modelsBulkTaskDescription -> ModelsBulkTask { modelsBulkTaskDescription, ..} ) <$> f modelsBulkTaskDescription +{-# INLINE modelsBulkTaskDescriptionL #-} + +-- | 'modelsBulkTaskDone' Lens +modelsBulkTaskDoneL :: Lens_' ModelsBulkTask (Maybe Bool) +modelsBulkTaskDoneL f ModelsBulkTask{..} = (\modelsBulkTaskDone -> ModelsBulkTask { modelsBulkTaskDone, ..} ) <$> f modelsBulkTaskDone +{-# INLINE modelsBulkTaskDoneL #-} + +-- | 'modelsBulkTaskDoneAt' Lens +modelsBulkTaskDoneAtL :: Lens_' ModelsBulkTask (Maybe Text) +modelsBulkTaskDoneAtL f ModelsBulkTask{..} = (\modelsBulkTaskDoneAt -> ModelsBulkTask { modelsBulkTaskDoneAt, ..} ) <$> f modelsBulkTaskDoneAt +{-# INLINE modelsBulkTaskDoneAtL #-} + +-- | 'modelsBulkTaskDueDate' Lens +modelsBulkTaskDueDateL :: Lens_' ModelsBulkTask (Maybe Text) +modelsBulkTaskDueDateL f ModelsBulkTask{..} = (\modelsBulkTaskDueDate -> ModelsBulkTask { modelsBulkTaskDueDate, ..} ) <$> f modelsBulkTaskDueDate +{-# INLINE modelsBulkTaskDueDateL #-} + +-- | 'modelsBulkTaskEndDate' Lens +modelsBulkTaskEndDateL :: Lens_' ModelsBulkTask (Maybe Text) +modelsBulkTaskEndDateL f ModelsBulkTask{..} = (\modelsBulkTaskEndDate -> ModelsBulkTask { modelsBulkTaskEndDate, ..} ) <$> f modelsBulkTaskEndDate +{-# INLINE modelsBulkTaskEndDateL #-} + +-- | 'modelsBulkTaskHexColor' Lens +modelsBulkTaskHexColorL :: Lens_' ModelsBulkTask (Maybe Text) +modelsBulkTaskHexColorL f ModelsBulkTask{..} = (\modelsBulkTaskHexColor -> ModelsBulkTask { modelsBulkTaskHexColor, ..} ) <$> f modelsBulkTaskHexColor +{-# INLINE modelsBulkTaskHexColorL #-} + +-- | 'modelsBulkTaskId' Lens +modelsBulkTaskIdL :: Lens_' ModelsBulkTask (Maybe Int) +modelsBulkTaskIdL f ModelsBulkTask{..} = (\modelsBulkTaskId -> ModelsBulkTask { modelsBulkTaskId, ..} ) <$> f modelsBulkTaskId +{-# INLINE modelsBulkTaskIdL #-} + +-- | 'modelsBulkTaskIdentifier' Lens +modelsBulkTaskIdentifierL :: Lens_' ModelsBulkTask (Maybe Text) +modelsBulkTaskIdentifierL f ModelsBulkTask{..} = (\modelsBulkTaskIdentifier -> ModelsBulkTask { modelsBulkTaskIdentifier, ..} ) <$> f modelsBulkTaskIdentifier +{-# INLINE modelsBulkTaskIdentifierL #-} + +-- | 'modelsBulkTaskIndex' Lens +modelsBulkTaskIndexL :: Lens_' ModelsBulkTask (Maybe Int) +modelsBulkTaskIndexL f ModelsBulkTask{..} = (\modelsBulkTaskIndex -> ModelsBulkTask { modelsBulkTaskIndex, ..} ) <$> f modelsBulkTaskIndex +{-# INLINE modelsBulkTaskIndexL #-} + +-- | 'modelsBulkTaskIsFavorite' Lens +modelsBulkTaskIsFavoriteL :: Lens_' ModelsBulkTask (Maybe Bool) +modelsBulkTaskIsFavoriteL f ModelsBulkTask{..} = (\modelsBulkTaskIsFavorite -> ModelsBulkTask { modelsBulkTaskIsFavorite, ..} ) <$> f modelsBulkTaskIsFavorite +{-# INLINE modelsBulkTaskIsFavoriteL #-} + +-- | 'modelsBulkTaskLabels' Lens +modelsBulkTaskLabelsL :: Lens_' ModelsBulkTask (Maybe [ModelsLabel]) +modelsBulkTaskLabelsL f ModelsBulkTask{..} = (\modelsBulkTaskLabels -> ModelsBulkTask { modelsBulkTaskLabels, ..} ) <$> f modelsBulkTaskLabels +{-# INLINE modelsBulkTaskLabelsL #-} + +-- | 'modelsBulkTaskPercentDone' Lens +modelsBulkTaskPercentDoneL :: Lens_' ModelsBulkTask (Maybe Double) +modelsBulkTaskPercentDoneL f ModelsBulkTask{..} = (\modelsBulkTaskPercentDone -> ModelsBulkTask { modelsBulkTaskPercentDone, ..} ) <$> f modelsBulkTaskPercentDone +{-# INLINE modelsBulkTaskPercentDoneL #-} + +-- | 'modelsBulkTaskPosition' Lens +modelsBulkTaskPositionL :: Lens_' ModelsBulkTask (Maybe Double) +modelsBulkTaskPositionL f ModelsBulkTask{..} = (\modelsBulkTaskPosition -> ModelsBulkTask { modelsBulkTaskPosition, ..} ) <$> f modelsBulkTaskPosition +{-# INLINE modelsBulkTaskPositionL #-} + +-- | 'modelsBulkTaskPriority' Lens +modelsBulkTaskPriorityL :: Lens_' ModelsBulkTask (Maybe Int) +modelsBulkTaskPriorityL f ModelsBulkTask{..} = (\modelsBulkTaskPriority -> ModelsBulkTask { modelsBulkTaskPriority, ..} ) <$> f modelsBulkTaskPriority +{-# INLINE modelsBulkTaskPriorityL #-} + +-- | 'modelsBulkTaskProjectId' Lens +modelsBulkTaskProjectIdL :: Lens_' ModelsBulkTask (Maybe Int) +modelsBulkTaskProjectIdL f ModelsBulkTask{..} = (\modelsBulkTaskProjectId -> ModelsBulkTask { modelsBulkTaskProjectId, ..} ) <$> f modelsBulkTaskProjectId +{-# INLINE modelsBulkTaskProjectIdL #-} + +-- | 'modelsBulkTaskReactions' Lens +modelsBulkTaskReactionsL :: Lens_' ModelsBulkTask (Maybe Map) +modelsBulkTaskReactionsL f ModelsBulkTask{..} = (\modelsBulkTaskReactions -> ModelsBulkTask { modelsBulkTaskReactions, ..} ) <$> f modelsBulkTaskReactions +{-# INLINE modelsBulkTaskReactionsL #-} + +-- | 'modelsBulkTaskRelatedTasks' Lens +modelsBulkTaskRelatedTasksL :: Lens_' ModelsBulkTask (Maybe Map) +modelsBulkTaskRelatedTasksL f ModelsBulkTask{..} = (\modelsBulkTaskRelatedTasks -> ModelsBulkTask { modelsBulkTaskRelatedTasks, ..} ) <$> f modelsBulkTaskRelatedTasks +{-# INLINE modelsBulkTaskRelatedTasksL #-} + +-- | 'modelsBulkTaskReminders' Lens +modelsBulkTaskRemindersL :: Lens_' ModelsBulkTask (Maybe [ModelsTaskReminder]) +modelsBulkTaskRemindersL f ModelsBulkTask{..} = (\modelsBulkTaskReminders -> ModelsBulkTask { modelsBulkTaskReminders, ..} ) <$> f modelsBulkTaskReminders +{-# INLINE modelsBulkTaskRemindersL #-} + +-- | 'modelsBulkTaskRepeatAfter' Lens +modelsBulkTaskRepeatAfterL :: Lens_' ModelsBulkTask (Maybe Int) +modelsBulkTaskRepeatAfterL f ModelsBulkTask{..} = (\modelsBulkTaskRepeatAfter -> ModelsBulkTask { modelsBulkTaskRepeatAfter, ..} ) <$> f modelsBulkTaskRepeatAfter +{-# INLINE modelsBulkTaskRepeatAfterL #-} + +-- | 'modelsBulkTaskRepeatMode' Lens +modelsBulkTaskRepeatModeL :: Lens_' ModelsBulkTask (Maybe ModelsTaskRepeatMode) +modelsBulkTaskRepeatModeL f ModelsBulkTask{..} = (\modelsBulkTaskRepeatMode -> ModelsBulkTask { modelsBulkTaskRepeatMode, ..} ) <$> f modelsBulkTaskRepeatMode +{-# INLINE modelsBulkTaskRepeatModeL #-} + +-- | 'modelsBulkTaskStartDate' Lens +modelsBulkTaskStartDateL :: Lens_' ModelsBulkTask (Maybe Text) +modelsBulkTaskStartDateL f ModelsBulkTask{..} = (\modelsBulkTaskStartDate -> ModelsBulkTask { modelsBulkTaskStartDate, ..} ) <$> f modelsBulkTaskStartDate +{-# INLINE modelsBulkTaskStartDateL #-} + +-- | 'modelsBulkTaskSubscription' Lens +modelsBulkTaskSubscriptionL :: Lens_' ModelsBulkTask (Maybe ModelsBulkTaskSubscription) +modelsBulkTaskSubscriptionL f ModelsBulkTask{..} = (\modelsBulkTaskSubscription -> ModelsBulkTask { modelsBulkTaskSubscription, ..} ) <$> f modelsBulkTaskSubscription +{-# INLINE modelsBulkTaskSubscriptionL #-} + +-- | 'modelsBulkTaskTaskIds' Lens +modelsBulkTaskTaskIdsL :: Lens_' ModelsBulkTask (Maybe [Int]) +modelsBulkTaskTaskIdsL f ModelsBulkTask{..} = (\modelsBulkTaskTaskIds -> ModelsBulkTask { modelsBulkTaskTaskIds, ..} ) <$> f modelsBulkTaskTaskIds +{-# INLINE modelsBulkTaskTaskIdsL #-} + +-- | 'modelsBulkTaskTitle' Lens +modelsBulkTaskTitleL :: Lens_' ModelsBulkTask (Maybe Text) +modelsBulkTaskTitleL f ModelsBulkTask{..} = (\modelsBulkTaskTitle -> ModelsBulkTask { modelsBulkTaskTitle, ..} ) <$> f modelsBulkTaskTitle +{-# INLINE modelsBulkTaskTitleL #-} + +-- | 'modelsBulkTaskUpdated' Lens +modelsBulkTaskUpdatedL :: Lens_' ModelsBulkTask (Maybe Text) +modelsBulkTaskUpdatedL f ModelsBulkTask{..} = (\modelsBulkTaskUpdated -> ModelsBulkTask { modelsBulkTaskUpdated, ..} ) <$> f modelsBulkTaskUpdated +{-# INLINE modelsBulkTaskUpdatedL #-} + + + +-- * ModelsBulkTaskCreatedBy + +-- | 'modelsBulkTaskCreatedByCreated' Lens +modelsBulkTaskCreatedByCreatedL :: Lens_' ModelsBulkTaskCreatedBy (Maybe Text) +modelsBulkTaskCreatedByCreatedL f ModelsBulkTaskCreatedBy{..} = (\modelsBulkTaskCreatedByCreated -> ModelsBulkTaskCreatedBy { modelsBulkTaskCreatedByCreated, ..} ) <$> f modelsBulkTaskCreatedByCreated +{-# INLINE modelsBulkTaskCreatedByCreatedL #-} + +-- | 'modelsBulkTaskCreatedByEmail' Lens +modelsBulkTaskCreatedByEmailL :: Lens_' ModelsBulkTaskCreatedBy (Maybe Text) +modelsBulkTaskCreatedByEmailL f ModelsBulkTaskCreatedBy{..} = (\modelsBulkTaskCreatedByEmail -> ModelsBulkTaskCreatedBy { modelsBulkTaskCreatedByEmail, ..} ) <$> f modelsBulkTaskCreatedByEmail +{-# INLINE modelsBulkTaskCreatedByEmailL #-} + +-- | 'modelsBulkTaskCreatedById' Lens +modelsBulkTaskCreatedByIdL :: Lens_' ModelsBulkTaskCreatedBy (Maybe Int) +modelsBulkTaskCreatedByIdL f ModelsBulkTaskCreatedBy{..} = (\modelsBulkTaskCreatedById -> ModelsBulkTaskCreatedBy { modelsBulkTaskCreatedById, ..} ) <$> f modelsBulkTaskCreatedById +{-# INLINE modelsBulkTaskCreatedByIdL #-} + +-- | 'modelsBulkTaskCreatedByName' Lens +modelsBulkTaskCreatedByNameL :: Lens_' ModelsBulkTaskCreatedBy (Maybe Text) +modelsBulkTaskCreatedByNameL f ModelsBulkTaskCreatedBy{..} = (\modelsBulkTaskCreatedByName -> ModelsBulkTaskCreatedBy { modelsBulkTaskCreatedByName, ..} ) <$> f modelsBulkTaskCreatedByName +{-# INLINE modelsBulkTaskCreatedByNameL #-} + +-- | 'modelsBulkTaskCreatedByUpdated' Lens +modelsBulkTaskCreatedByUpdatedL :: Lens_' ModelsBulkTaskCreatedBy (Maybe Text) +modelsBulkTaskCreatedByUpdatedL f ModelsBulkTaskCreatedBy{..} = (\modelsBulkTaskCreatedByUpdated -> ModelsBulkTaskCreatedBy { modelsBulkTaskCreatedByUpdated, ..} ) <$> f modelsBulkTaskCreatedByUpdated +{-# INLINE modelsBulkTaskCreatedByUpdatedL #-} + +-- | 'modelsBulkTaskCreatedByUsername' Lens +modelsBulkTaskCreatedByUsernameL :: Lens_' ModelsBulkTaskCreatedBy (Maybe Text) +modelsBulkTaskCreatedByUsernameL f ModelsBulkTaskCreatedBy{..} = (\modelsBulkTaskCreatedByUsername -> ModelsBulkTaskCreatedBy { modelsBulkTaskCreatedByUsername, ..} ) <$> f modelsBulkTaskCreatedByUsername +{-# INLINE modelsBulkTaskCreatedByUsernameL #-} + + + +-- * ModelsBulkTaskSubscription + +-- | 'modelsBulkTaskSubscriptionCreated' Lens +modelsBulkTaskSubscriptionCreatedL :: Lens_' ModelsBulkTaskSubscription (Maybe Text) +modelsBulkTaskSubscriptionCreatedL f ModelsBulkTaskSubscription{..} = (\modelsBulkTaskSubscriptionCreated -> ModelsBulkTaskSubscription { modelsBulkTaskSubscriptionCreated, ..} ) <$> f modelsBulkTaskSubscriptionCreated +{-# INLINE modelsBulkTaskSubscriptionCreatedL #-} + +-- | 'modelsBulkTaskSubscriptionEntity' Lens +modelsBulkTaskSubscriptionEntityL :: Lens_' ModelsBulkTaskSubscription (Maybe Int) +modelsBulkTaskSubscriptionEntityL f ModelsBulkTaskSubscription{..} = (\modelsBulkTaskSubscriptionEntity -> ModelsBulkTaskSubscription { modelsBulkTaskSubscriptionEntity, ..} ) <$> f modelsBulkTaskSubscriptionEntity +{-# INLINE modelsBulkTaskSubscriptionEntityL #-} + +-- | 'modelsBulkTaskSubscriptionEntityId' Lens +modelsBulkTaskSubscriptionEntityIdL :: Lens_' ModelsBulkTaskSubscription (Maybe Int) +modelsBulkTaskSubscriptionEntityIdL f ModelsBulkTaskSubscription{..} = (\modelsBulkTaskSubscriptionEntityId -> ModelsBulkTaskSubscription { modelsBulkTaskSubscriptionEntityId, ..} ) <$> f modelsBulkTaskSubscriptionEntityId +{-# INLINE modelsBulkTaskSubscriptionEntityIdL #-} + +-- | 'modelsBulkTaskSubscriptionId' Lens +modelsBulkTaskSubscriptionIdL :: Lens_' ModelsBulkTaskSubscription (Maybe Int) +modelsBulkTaskSubscriptionIdL f ModelsBulkTaskSubscription{..} = (\modelsBulkTaskSubscriptionId -> ModelsBulkTaskSubscription { modelsBulkTaskSubscriptionId, ..} ) <$> f modelsBulkTaskSubscriptionId +{-# INLINE modelsBulkTaskSubscriptionIdL #-} + + + +-- * ModelsDatabaseNotifications + +-- | 'modelsDatabaseNotificationsCreated' Lens +modelsDatabaseNotificationsCreatedL :: Lens_' ModelsDatabaseNotifications (Maybe Text) +modelsDatabaseNotificationsCreatedL f ModelsDatabaseNotifications{..} = (\modelsDatabaseNotificationsCreated -> ModelsDatabaseNotifications { modelsDatabaseNotificationsCreated, ..} ) <$> f modelsDatabaseNotificationsCreated +{-# INLINE modelsDatabaseNotificationsCreatedL #-} + +-- | 'modelsDatabaseNotificationsId' Lens +modelsDatabaseNotificationsIdL :: Lens_' ModelsDatabaseNotifications (Maybe Int) +modelsDatabaseNotificationsIdL f ModelsDatabaseNotifications{..} = (\modelsDatabaseNotificationsId -> ModelsDatabaseNotifications { modelsDatabaseNotificationsId, ..} ) <$> f modelsDatabaseNotificationsId +{-# INLINE modelsDatabaseNotificationsIdL #-} + +-- | 'modelsDatabaseNotificationsName' Lens +modelsDatabaseNotificationsNameL :: Lens_' ModelsDatabaseNotifications (Maybe Text) +modelsDatabaseNotificationsNameL f ModelsDatabaseNotifications{..} = (\modelsDatabaseNotificationsName -> ModelsDatabaseNotifications { modelsDatabaseNotificationsName, ..} ) <$> f modelsDatabaseNotificationsName +{-# INLINE modelsDatabaseNotificationsNameL #-} + +-- | 'modelsDatabaseNotificationsNotification' Lens +modelsDatabaseNotificationsNotificationL :: Lens_' ModelsDatabaseNotifications (Maybe A.Value) +modelsDatabaseNotificationsNotificationL f ModelsDatabaseNotifications{..} = (\modelsDatabaseNotificationsNotification -> ModelsDatabaseNotifications { modelsDatabaseNotificationsNotification, ..} ) <$> f modelsDatabaseNotificationsNotification +{-# INLINE modelsDatabaseNotificationsNotificationL #-} + +-- | 'modelsDatabaseNotificationsRead' Lens +modelsDatabaseNotificationsReadL :: Lens_' ModelsDatabaseNotifications (Maybe Bool) +modelsDatabaseNotificationsReadL f ModelsDatabaseNotifications{..} = (\modelsDatabaseNotificationsRead -> ModelsDatabaseNotifications { modelsDatabaseNotificationsRead, ..} ) <$> f modelsDatabaseNotificationsRead +{-# INLINE modelsDatabaseNotificationsReadL #-} + +-- | 'modelsDatabaseNotificationsReadAt' Lens +modelsDatabaseNotificationsReadAtL :: Lens_' ModelsDatabaseNotifications (Maybe Text) +modelsDatabaseNotificationsReadAtL f ModelsDatabaseNotifications{..} = (\modelsDatabaseNotificationsReadAt -> ModelsDatabaseNotifications { modelsDatabaseNotificationsReadAt, ..} ) <$> f modelsDatabaseNotificationsReadAt +{-# INLINE modelsDatabaseNotificationsReadAtL #-} + + + +-- * ModelsLabel + +-- | 'modelsLabelCreated' Lens +modelsLabelCreatedL :: Lens_' ModelsLabel (Maybe Text) +modelsLabelCreatedL f ModelsLabel{..} = (\modelsLabelCreated -> ModelsLabel { modelsLabelCreated, ..} ) <$> f modelsLabelCreated +{-# INLINE modelsLabelCreatedL #-} + +-- | 'modelsLabelCreatedBy' Lens +modelsLabelCreatedByL :: Lens_' ModelsLabel (Maybe ModelsLabelCreatedBy) +modelsLabelCreatedByL f ModelsLabel{..} = (\modelsLabelCreatedBy -> ModelsLabel { modelsLabelCreatedBy, ..} ) <$> f modelsLabelCreatedBy +{-# INLINE modelsLabelCreatedByL #-} + +-- | 'modelsLabelDescription' Lens +modelsLabelDescriptionL :: Lens_' ModelsLabel (Maybe Text) +modelsLabelDescriptionL f ModelsLabel{..} = (\modelsLabelDescription -> ModelsLabel { modelsLabelDescription, ..} ) <$> f modelsLabelDescription +{-# INLINE modelsLabelDescriptionL #-} + +-- | 'modelsLabelHexColor' Lens +modelsLabelHexColorL :: Lens_' ModelsLabel (Maybe Text) +modelsLabelHexColorL f ModelsLabel{..} = (\modelsLabelHexColor -> ModelsLabel { modelsLabelHexColor, ..} ) <$> f modelsLabelHexColor +{-# INLINE modelsLabelHexColorL #-} + +-- | 'modelsLabelId' Lens +modelsLabelIdL :: Lens_' ModelsLabel (Maybe Int) +modelsLabelIdL f ModelsLabel{..} = (\modelsLabelId -> ModelsLabel { modelsLabelId, ..} ) <$> f modelsLabelId +{-# INLINE modelsLabelIdL #-} + +-- | 'modelsLabelTitle' Lens +modelsLabelTitleL :: Lens_' ModelsLabel (Maybe Text) +modelsLabelTitleL f ModelsLabel{..} = (\modelsLabelTitle -> ModelsLabel { modelsLabelTitle, ..} ) <$> f modelsLabelTitle +{-# INLINE modelsLabelTitleL #-} + +-- | 'modelsLabelUpdated' Lens +modelsLabelUpdatedL :: Lens_' ModelsLabel (Maybe Text) +modelsLabelUpdatedL f ModelsLabel{..} = (\modelsLabelUpdated -> ModelsLabel { modelsLabelUpdated, ..} ) <$> f modelsLabelUpdated +{-# INLINE modelsLabelUpdatedL #-} + + + +-- * ModelsLabelCreatedBy + +-- | 'modelsLabelCreatedByCreated' Lens +modelsLabelCreatedByCreatedL :: Lens_' ModelsLabelCreatedBy (Maybe Text) +modelsLabelCreatedByCreatedL f ModelsLabelCreatedBy{..} = (\modelsLabelCreatedByCreated -> ModelsLabelCreatedBy { modelsLabelCreatedByCreated, ..} ) <$> f modelsLabelCreatedByCreated +{-# INLINE modelsLabelCreatedByCreatedL #-} + +-- | 'modelsLabelCreatedByEmail' Lens +modelsLabelCreatedByEmailL :: Lens_' ModelsLabelCreatedBy (Maybe Text) +modelsLabelCreatedByEmailL f ModelsLabelCreatedBy{..} = (\modelsLabelCreatedByEmail -> ModelsLabelCreatedBy { modelsLabelCreatedByEmail, ..} ) <$> f modelsLabelCreatedByEmail +{-# INLINE modelsLabelCreatedByEmailL #-} + +-- | 'modelsLabelCreatedById' Lens +modelsLabelCreatedByIdL :: Lens_' ModelsLabelCreatedBy (Maybe Int) +modelsLabelCreatedByIdL f ModelsLabelCreatedBy{..} = (\modelsLabelCreatedById -> ModelsLabelCreatedBy { modelsLabelCreatedById, ..} ) <$> f modelsLabelCreatedById +{-# INLINE modelsLabelCreatedByIdL #-} + +-- | 'modelsLabelCreatedByName' Lens +modelsLabelCreatedByNameL :: Lens_' ModelsLabelCreatedBy (Maybe Text) +modelsLabelCreatedByNameL f ModelsLabelCreatedBy{..} = (\modelsLabelCreatedByName -> ModelsLabelCreatedBy { modelsLabelCreatedByName, ..} ) <$> f modelsLabelCreatedByName +{-# INLINE modelsLabelCreatedByNameL #-} + +-- | 'modelsLabelCreatedByUpdated' Lens +modelsLabelCreatedByUpdatedL :: Lens_' ModelsLabelCreatedBy (Maybe Text) +modelsLabelCreatedByUpdatedL f ModelsLabelCreatedBy{..} = (\modelsLabelCreatedByUpdated -> ModelsLabelCreatedBy { modelsLabelCreatedByUpdated, ..} ) <$> f modelsLabelCreatedByUpdated +{-# INLINE modelsLabelCreatedByUpdatedL #-} + +-- | 'modelsLabelCreatedByUsername' Lens +modelsLabelCreatedByUsernameL :: Lens_' ModelsLabelCreatedBy (Maybe Text) +modelsLabelCreatedByUsernameL f ModelsLabelCreatedBy{..} = (\modelsLabelCreatedByUsername -> ModelsLabelCreatedBy { modelsLabelCreatedByUsername, ..} ) <$> f modelsLabelCreatedByUsername +{-# INLINE modelsLabelCreatedByUsernameL #-} + + + +-- * ModelsLabelTask + +-- | 'modelsLabelTaskCreated' Lens +modelsLabelTaskCreatedL :: Lens_' ModelsLabelTask (Maybe Text) +modelsLabelTaskCreatedL f ModelsLabelTask{..} = (\modelsLabelTaskCreated -> ModelsLabelTask { modelsLabelTaskCreated, ..} ) <$> f modelsLabelTaskCreated +{-# INLINE modelsLabelTaskCreatedL #-} + +-- | 'modelsLabelTaskLabelId' Lens +modelsLabelTaskLabelIdL :: Lens_' ModelsLabelTask (Maybe Int) +modelsLabelTaskLabelIdL f ModelsLabelTask{..} = (\modelsLabelTaskLabelId -> ModelsLabelTask { modelsLabelTaskLabelId, ..} ) <$> f modelsLabelTaskLabelId +{-# INLINE modelsLabelTaskLabelIdL #-} + + + +-- * ModelsLabelTaskBulk + +-- | 'modelsLabelTaskBulkLabels' Lens +modelsLabelTaskBulkLabelsL :: Lens_' ModelsLabelTaskBulk (Maybe [ModelsLabel]) +modelsLabelTaskBulkLabelsL f ModelsLabelTaskBulk{..} = (\modelsLabelTaskBulkLabels -> ModelsLabelTaskBulk { modelsLabelTaskBulkLabels, ..} ) <$> f modelsLabelTaskBulkLabels +{-# INLINE modelsLabelTaskBulkLabelsL #-} + + + +-- * ModelsLinkSharing + +-- | 'modelsLinkSharingCreated' Lens +modelsLinkSharingCreatedL :: Lens_' ModelsLinkSharing (Maybe Text) +modelsLinkSharingCreatedL f ModelsLinkSharing{..} = (\modelsLinkSharingCreated -> ModelsLinkSharing { modelsLinkSharingCreated, ..} ) <$> f modelsLinkSharingCreated +{-# INLINE modelsLinkSharingCreatedL #-} + +-- | 'modelsLinkSharingHash' Lens +modelsLinkSharingHashL :: Lens_' ModelsLinkSharing (Maybe Text) +modelsLinkSharingHashL f ModelsLinkSharing{..} = (\modelsLinkSharingHash -> ModelsLinkSharing { modelsLinkSharingHash, ..} ) <$> f modelsLinkSharingHash +{-# INLINE modelsLinkSharingHashL #-} + +-- | 'modelsLinkSharingId' Lens +modelsLinkSharingIdL :: Lens_' ModelsLinkSharing (Maybe Int) +modelsLinkSharingIdL f ModelsLinkSharing{..} = (\modelsLinkSharingId -> ModelsLinkSharing { modelsLinkSharingId, ..} ) <$> f modelsLinkSharingId +{-# INLINE modelsLinkSharingIdL #-} + +-- | 'modelsLinkSharingName' Lens +modelsLinkSharingNameL :: Lens_' ModelsLinkSharing (Maybe Text) +modelsLinkSharingNameL f ModelsLinkSharing{..} = (\modelsLinkSharingName -> ModelsLinkSharing { modelsLinkSharingName, ..} ) <$> f modelsLinkSharingName +{-# INLINE modelsLinkSharingNameL #-} + +-- | 'modelsLinkSharingPassword' Lens +modelsLinkSharingPasswordL :: Lens_' ModelsLinkSharing (Maybe Text) +modelsLinkSharingPasswordL f ModelsLinkSharing{..} = (\modelsLinkSharingPassword -> ModelsLinkSharing { modelsLinkSharingPassword, ..} ) <$> f modelsLinkSharingPassword +{-# INLINE modelsLinkSharingPasswordL #-} + +-- | 'modelsLinkSharingRight' Lens +modelsLinkSharingRightL :: Lens_' ModelsLinkSharing (Maybe ModelsRight) +modelsLinkSharingRightL f ModelsLinkSharing{..} = (\modelsLinkSharingRight -> ModelsLinkSharing { modelsLinkSharingRight, ..} ) <$> f modelsLinkSharingRight +{-# INLINE modelsLinkSharingRightL #-} + +-- | 'modelsLinkSharingSharedBy' Lens +modelsLinkSharingSharedByL :: Lens_' ModelsLinkSharing (Maybe ModelsLinkSharingSharedBy) +modelsLinkSharingSharedByL f ModelsLinkSharing{..} = (\modelsLinkSharingSharedBy -> ModelsLinkSharing { modelsLinkSharingSharedBy, ..} ) <$> f modelsLinkSharingSharedBy +{-# INLINE modelsLinkSharingSharedByL #-} + +-- | 'modelsLinkSharingSharingType' Lens +modelsLinkSharingSharingTypeL :: Lens_' ModelsLinkSharing (Maybe ModelsSharingType) +modelsLinkSharingSharingTypeL f ModelsLinkSharing{..} = (\modelsLinkSharingSharingType -> ModelsLinkSharing { modelsLinkSharingSharingType, ..} ) <$> f modelsLinkSharingSharingType +{-# INLINE modelsLinkSharingSharingTypeL #-} + +-- | 'modelsLinkSharingUpdated' Lens +modelsLinkSharingUpdatedL :: Lens_' ModelsLinkSharing (Maybe Text) +modelsLinkSharingUpdatedL f ModelsLinkSharing{..} = (\modelsLinkSharingUpdated -> ModelsLinkSharing { modelsLinkSharingUpdated, ..} ) <$> f modelsLinkSharingUpdated +{-# INLINE modelsLinkSharingUpdatedL #-} + + + +-- * ModelsLinkSharingSharedBy + +-- | 'modelsLinkSharingSharedByCreated' Lens +modelsLinkSharingSharedByCreatedL :: Lens_' ModelsLinkSharingSharedBy (Maybe Text) +modelsLinkSharingSharedByCreatedL f ModelsLinkSharingSharedBy{..} = (\modelsLinkSharingSharedByCreated -> ModelsLinkSharingSharedBy { modelsLinkSharingSharedByCreated, ..} ) <$> f modelsLinkSharingSharedByCreated +{-# INLINE modelsLinkSharingSharedByCreatedL #-} + +-- | 'modelsLinkSharingSharedByEmail' Lens +modelsLinkSharingSharedByEmailL :: Lens_' ModelsLinkSharingSharedBy (Maybe Text) +modelsLinkSharingSharedByEmailL f ModelsLinkSharingSharedBy{..} = (\modelsLinkSharingSharedByEmail -> ModelsLinkSharingSharedBy { modelsLinkSharingSharedByEmail, ..} ) <$> f modelsLinkSharingSharedByEmail +{-# INLINE modelsLinkSharingSharedByEmailL #-} + +-- | 'modelsLinkSharingSharedById' Lens +modelsLinkSharingSharedByIdL :: Lens_' ModelsLinkSharingSharedBy (Maybe Int) +modelsLinkSharingSharedByIdL f ModelsLinkSharingSharedBy{..} = (\modelsLinkSharingSharedById -> ModelsLinkSharingSharedBy { modelsLinkSharingSharedById, ..} ) <$> f modelsLinkSharingSharedById +{-# INLINE modelsLinkSharingSharedByIdL #-} + +-- | 'modelsLinkSharingSharedByName' Lens +modelsLinkSharingSharedByNameL :: Lens_' ModelsLinkSharingSharedBy (Maybe Text) +modelsLinkSharingSharedByNameL f ModelsLinkSharingSharedBy{..} = (\modelsLinkSharingSharedByName -> ModelsLinkSharingSharedBy { modelsLinkSharingSharedByName, ..} ) <$> f modelsLinkSharingSharedByName +{-# INLINE modelsLinkSharingSharedByNameL #-} + +-- | 'modelsLinkSharingSharedByUpdated' Lens +modelsLinkSharingSharedByUpdatedL :: Lens_' ModelsLinkSharingSharedBy (Maybe Text) +modelsLinkSharingSharedByUpdatedL f ModelsLinkSharingSharedBy{..} = (\modelsLinkSharingSharedByUpdated -> ModelsLinkSharingSharedBy { modelsLinkSharingSharedByUpdated, ..} ) <$> f modelsLinkSharingSharedByUpdated +{-# INLINE modelsLinkSharingSharedByUpdatedL #-} + +-- | 'modelsLinkSharingSharedByUsername' Lens +modelsLinkSharingSharedByUsernameL :: Lens_' ModelsLinkSharingSharedBy (Maybe Text) +modelsLinkSharingSharedByUsernameL f ModelsLinkSharingSharedBy{..} = (\modelsLinkSharingSharedByUsername -> ModelsLinkSharingSharedBy { modelsLinkSharingSharedByUsername, ..} ) <$> f modelsLinkSharingSharedByUsername +{-# INLINE modelsLinkSharingSharedByUsernameL #-} + + + +-- * ModelsMessage + +-- | 'modelsMessageMessage' Lens +modelsMessageMessageL :: Lens_' ModelsMessage (Maybe Text) +modelsMessageMessageL f ModelsMessage{..} = (\modelsMessageMessage -> ModelsMessage { modelsMessageMessage, ..} ) <$> f modelsMessageMessage +{-# INLINE modelsMessageMessageL #-} + + + +-- * ModelsProject + +-- | 'modelsProjectBackgroundBlurHash' Lens +modelsProjectBackgroundBlurHashL :: Lens_' ModelsProject (Maybe Text) +modelsProjectBackgroundBlurHashL f ModelsProject{..} = (\modelsProjectBackgroundBlurHash -> ModelsProject { modelsProjectBackgroundBlurHash, ..} ) <$> f modelsProjectBackgroundBlurHash +{-# INLINE modelsProjectBackgroundBlurHashL #-} + +-- | 'modelsProjectBackgroundInformation' Lens +modelsProjectBackgroundInformationL :: Lens_' ModelsProject (Maybe A.Value) +modelsProjectBackgroundInformationL f ModelsProject{..} = (\modelsProjectBackgroundInformation -> ModelsProject { modelsProjectBackgroundInformation, ..} ) <$> f modelsProjectBackgroundInformation +{-# INLINE modelsProjectBackgroundInformationL #-} + +-- | 'modelsProjectCreated' Lens +modelsProjectCreatedL :: Lens_' ModelsProject (Maybe Text) +modelsProjectCreatedL f ModelsProject{..} = (\modelsProjectCreated -> ModelsProject { modelsProjectCreated, ..} ) <$> f modelsProjectCreated +{-# INLINE modelsProjectCreatedL #-} + +-- | 'modelsProjectDescription' Lens +modelsProjectDescriptionL :: Lens_' ModelsProject (Maybe Text) +modelsProjectDescriptionL f ModelsProject{..} = (\modelsProjectDescription -> ModelsProject { modelsProjectDescription, ..} ) <$> f modelsProjectDescription +{-# INLINE modelsProjectDescriptionL #-} + +-- | 'modelsProjectHexColor' Lens +modelsProjectHexColorL :: Lens_' ModelsProject (Maybe Text) +modelsProjectHexColorL f ModelsProject{..} = (\modelsProjectHexColor -> ModelsProject { modelsProjectHexColor, ..} ) <$> f modelsProjectHexColor +{-# INLINE modelsProjectHexColorL #-} + +-- | 'modelsProjectId' Lens +modelsProjectIdL :: Lens_' ModelsProject (Maybe Int) +modelsProjectIdL f ModelsProject{..} = (\modelsProjectId -> ModelsProject { modelsProjectId, ..} ) <$> f modelsProjectId +{-# INLINE modelsProjectIdL #-} + +-- | 'modelsProjectIdentifier' Lens +modelsProjectIdentifierL :: Lens_' ModelsProject (Maybe Text) +modelsProjectIdentifierL f ModelsProject{..} = (\modelsProjectIdentifier -> ModelsProject { modelsProjectIdentifier, ..} ) <$> f modelsProjectIdentifier +{-# INLINE modelsProjectIdentifierL #-} + +-- | 'modelsProjectIsArchived' Lens +modelsProjectIsArchivedL :: Lens_' ModelsProject (Maybe Bool) +modelsProjectIsArchivedL f ModelsProject{..} = (\modelsProjectIsArchived -> ModelsProject { modelsProjectIsArchived, ..} ) <$> f modelsProjectIsArchived +{-# INLINE modelsProjectIsArchivedL #-} + +-- | 'modelsProjectIsFavorite' Lens +modelsProjectIsFavoriteL :: Lens_' ModelsProject (Maybe Bool) +modelsProjectIsFavoriteL f ModelsProject{..} = (\modelsProjectIsFavorite -> ModelsProject { modelsProjectIsFavorite, ..} ) <$> f modelsProjectIsFavorite +{-# INLINE modelsProjectIsFavoriteL #-} + +-- | 'modelsProjectOwner' Lens +modelsProjectOwnerL :: Lens_' ModelsProject (Maybe ModelsProjectOwner) +modelsProjectOwnerL f ModelsProject{..} = (\modelsProjectOwner -> ModelsProject { modelsProjectOwner, ..} ) <$> f modelsProjectOwner +{-# INLINE modelsProjectOwnerL #-} + +-- | 'modelsProjectParentProjectId' Lens +modelsProjectParentProjectIdL :: Lens_' ModelsProject (Maybe Int) +modelsProjectParentProjectIdL f ModelsProject{..} = (\modelsProjectParentProjectId -> ModelsProject { modelsProjectParentProjectId, ..} ) <$> f modelsProjectParentProjectId +{-# INLINE modelsProjectParentProjectIdL #-} + +-- | 'modelsProjectPosition' Lens +modelsProjectPositionL :: Lens_' ModelsProject (Maybe Double) +modelsProjectPositionL f ModelsProject{..} = (\modelsProjectPosition -> ModelsProject { modelsProjectPosition, ..} ) <$> f modelsProjectPosition +{-# INLINE modelsProjectPositionL #-} + +-- | 'modelsProjectSubscription' Lens +modelsProjectSubscriptionL :: Lens_' ModelsProject (Maybe ModelsProjectSubscription) +modelsProjectSubscriptionL f ModelsProject{..} = (\modelsProjectSubscription -> ModelsProject { modelsProjectSubscription, ..} ) <$> f modelsProjectSubscription +{-# INLINE modelsProjectSubscriptionL #-} + +-- | 'modelsProjectTitle' Lens +modelsProjectTitleL :: Lens_' ModelsProject (Maybe Text) +modelsProjectTitleL f ModelsProject{..} = (\modelsProjectTitle -> ModelsProject { modelsProjectTitle, ..} ) <$> f modelsProjectTitle +{-# INLINE modelsProjectTitleL #-} + +-- | 'modelsProjectUpdated' Lens +modelsProjectUpdatedL :: Lens_' ModelsProject (Maybe Text) +modelsProjectUpdatedL f ModelsProject{..} = (\modelsProjectUpdated -> ModelsProject { modelsProjectUpdated, ..} ) <$> f modelsProjectUpdated +{-# INLINE modelsProjectUpdatedL #-} + +-- | 'modelsProjectViews' Lens +modelsProjectViewsL :: Lens_' ModelsProject (Maybe [ModelsProjectView]) +modelsProjectViewsL f ModelsProject{..} = (\modelsProjectViews -> ModelsProject { modelsProjectViews, ..} ) <$> f modelsProjectViews +{-# INLINE modelsProjectViewsL #-} + + + +-- * ModelsProjectDuplicate + +-- | 'modelsProjectDuplicateDuplicatedProject' Lens +modelsProjectDuplicateDuplicatedProjectL :: Lens_' ModelsProjectDuplicate (Maybe ModelsProjectDuplicateDuplicatedProject) +modelsProjectDuplicateDuplicatedProjectL f ModelsProjectDuplicate{..} = (\modelsProjectDuplicateDuplicatedProject -> ModelsProjectDuplicate { modelsProjectDuplicateDuplicatedProject, ..} ) <$> f modelsProjectDuplicateDuplicatedProject +{-# INLINE modelsProjectDuplicateDuplicatedProjectL #-} + +-- | 'modelsProjectDuplicateParentProjectId' Lens +modelsProjectDuplicateParentProjectIdL :: Lens_' ModelsProjectDuplicate (Maybe Int) +modelsProjectDuplicateParentProjectIdL f ModelsProjectDuplicate{..} = (\modelsProjectDuplicateParentProjectId -> ModelsProjectDuplicate { modelsProjectDuplicateParentProjectId, ..} ) <$> f modelsProjectDuplicateParentProjectId +{-# INLINE modelsProjectDuplicateParentProjectIdL #-} + + + +-- * ModelsProjectDuplicateDuplicatedProject + +-- | 'modelsProjectDuplicateDuplicatedProjectBackgroundBlurHash' Lens +modelsProjectDuplicateDuplicatedProjectBackgroundBlurHashL :: Lens_' ModelsProjectDuplicateDuplicatedProject (Maybe Text) +modelsProjectDuplicateDuplicatedProjectBackgroundBlurHashL f ModelsProjectDuplicateDuplicatedProject{..} = (\modelsProjectDuplicateDuplicatedProjectBackgroundBlurHash -> ModelsProjectDuplicateDuplicatedProject { modelsProjectDuplicateDuplicatedProjectBackgroundBlurHash, ..} ) <$> f modelsProjectDuplicateDuplicatedProjectBackgroundBlurHash +{-# INLINE modelsProjectDuplicateDuplicatedProjectBackgroundBlurHashL #-} + +-- | 'modelsProjectDuplicateDuplicatedProjectBackgroundInformation' Lens +modelsProjectDuplicateDuplicatedProjectBackgroundInformationL :: Lens_' ModelsProjectDuplicateDuplicatedProject (Maybe A.Value) +modelsProjectDuplicateDuplicatedProjectBackgroundInformationL f ModelsProjectDuplicateDuplicatedProject{..} = (\modelsProjectDuplicateDuplicatedProjectBackgroundInformation -> ModelsProjectDuplicateDuplicatedProject { modelsProjectDuplicateDuplicatedProjectBackgroundInformation, ..} ) <$> f modelsProjectDuplicateDuplicatedProjectBackgroundInformation +{-# INLINE modelsProjectDuplicateDuplicatedProjectBackgroundInformationL #-} + +-- | 'modelsProjectDuplicateDuplicatedProjectCreated' Lens +modelsProjectDuplicateDuplicatedProjectCreatedL :: Lens_' ModelsProjectDuplicateDuplicatedProject (Maybe Text) +modelsProjectDuplicateDuplicatedProjectCreatedL f ModelsProjectDuplicateDuplicatedProject{..} = (\modelsProjectDuplicateDuplicatedProjectCreated -> ModelsProjectDuplicateDuplicatedProject { modelsProjectDuplicateDuplicatedProjectCreated, ..} ) <$> f modelsProjectDuplicateDuplicatedProjectCreated +{-# INLINE modelsProjectDuplicateDuplicatedProjectCreatedL #-} + +-- | 'modelsProjectDuplicateDuplicatedProjectDescription' Lens +modelsProjectDuplicateDuplicatedProjectDescriptionL :: Lens_' ModelsProjectDuplicateDuplicatedProject (Maybe Text) +modelsProjectDuplicateDuplicatedProjectDescriptionL f ModelsProjectDuplicateDuplicatedProject{..} = (\modelsProjectDuplicateDuplicatedProjectDescription -> ModelsProjectDuplicateDuplicatedProject { modelsProjectDuplicateDuplicatedProjectDescription, ..} ) <$> f modelsProjectDuplicateDuplicatedProjectDescription +{-# INLINE modelsProjectDuplicateDuplicatedProjectDescriptionL #-} + +-- | 'modelsProjectDuplicateDuplicatedProjectHexColor' Lens +modelsProjectDuplicateDuplicatedProjectHexColorL :: Lens_' ModelsProjectDuplicateDuplicatedProject (Maybe Text) +modelsProjectDuplicateDuplicatedProjectHexColorL f ModelsProjectDuplicateDuplicatedProject{..} = (\modelsProjectDuplicateDuplicatedProjectHexColor -> ModelsProjectDuplicateDuplicatedProject { modelsProjectDuplicateDuplicatedProjectHexColor, ..} ) <$> f modelsProjectDuplicateDuplicatedProjectHexColor +{-# INLINE modelsProjectDuplicateDuplicatedProjectHexColorL #-} + +-- | 'modelsProjectDuplicateDuplicatedProjectId' Lens +modelsProjectDuplicateDuplicatedProjectIdL :: Lens_' ModelsProjectDuplicateDuplicatedProject (Maybe Int) +modelsProjectDuplicateDuplicatedProjectIdL f ModelsProjectDuplicateDuplicatedProject{..} = (\modelsProjectDuplicateDuplicatedProjectId -> ModelsProjectDuplicateDuplicatedProject { modelsProjectDuplicateDuplicatedProjectId, ..} ) <$> f modelsProjectDuplicateDuplicatedProjectId +{-# INLINE modelsProjectDuplicateDuplicatedProjectIdL #-} + +-- | 'modelsProjectDuplicateDuplicatedProjectIdentifier' Lens +modelsProjectDuplicateDuplicatedProjectIdentifierL :: Lens_' ModelsProjectDuplicateDuplicatedProject (Maybe Text) +modelsProjectDuplicateDuplicatedProjectIdentifierL f ModelsProjectDuplicateDuplicatedProject{..} = (\modelsProjectDuplicateDuplicatedProjectIdentifier -> ModelsProjectDuplicateDuplicatedProject { modelsProjectDuplicateDuplicatedProjectIdentifier, ..} ) <$> f modelsProjectDuplicateDuplicatedProjectIdentifier +{-# INLINE modelsProjectDuplicateDuplicatedProjectIdentifierL #-} + +-- | 'modelsProjectDuplicateDuplicatedProjectIsArchived' Lens +modelsProjectDuplicateDuplicatedProjectIsArchivedL :: Lens_' ModelsProjectDuplicateDuplicatedProject (Maybe Bool) +modelsProjectDuplicateDuplicatedProjectIsArchivedL f ModelsProjectDuplicateDuplicatedProject{..} = (\modelsProjectDuplicateDuplicatedProjectIsArchived -> ModelsProjectDuplicateDuplicatedProject { modelsProjectDuplicateDuplicatedProjectIsArchived, ..} ) <$> f modelsProjectDuplicateDuplicatedProjectIsArchived +{-# INLINE modelsProjectDuplicateDuplicatedProjectIsArchivedL #-} + +-- | 'modelsProjectDuplicateDuplicatedProjectIsFavorite' Lens +modelsProjectDuplicateDuplicatedProjectIsFavoriteL :: Lens_' ModelsProjectDuplicateDuplicatedProject (Maybe Bool) +modelsProjectDuplicateDuplicatedProjectIsFavoriteL f ModelsProjectDuplicateDuplicatedProject{..} = (\modelsProjectDuplicateDuplicatedProjectIsFavorite -> ModelsProjectDuplicateDuplicatedProject { modelsProjectDuplicateDuplicatedProjectIsFavorite, ..} ) <$> f modelsProjectDuplicateDuplicatedProjectIsFavorite +{-# INLINE modelsProjectDuplicateDuplicatedProjectIsFavoriteL #-} + +-- | 'modelsProjectDuplicateDuplicatedProjectOwner' Lens +modelsProjectDuplicateDuplicatedProjectOwnerL :: Lens_' ModelsProjectDuplicateDuplicatedProject (Maybe ModelsProjectOwner) +modelsProjectDuplicateDuplicatedProjectOwnerL f ModelsProjectDuplicateDuplicatedProject{..} = (\modelsProjectDuplicateDuplicatedProjectOwner -> ModelsProjectDuplicateDuplicatedProject { modelsProjectDuplicateDuplicatedProjectOwner, ..} ) <$> f modelsProjectDuplicateDuplicatedProjectOwner +{-# INLINE modelsProjectDuplicateDuplicatedProjectOwnerL #-} + +-- | 'modelsProjectDuplicateDuplicatedProjectParentProjectId' Lens +modelsProjectDuplicateDuplicatedProjectParentProjectIdL :: Lens_' ModelsProjectDuplicateDuplicatedProject (Maybe Int) +modelsProjectDuplicateDuplicatedProjectParentProjectIdL f ModelsProjectDuplicateDuplicatedProject{..} = (\modelsProjectDuplicateDuplicatedProjectParentProjectId -> ModelsProjectDuplicateDuplicatedProject { modelsProjectDuplicateDuplicatedProjectParentProjectId, ..} ) <$> f modelsProjectDuplicateDuplicatedProjectParentProjectId +{-# INLINE modelsProjectDuplicateDuplicatedProjectParentProjectIdL #-} + +-- | 'modelsProjectDuplicateDuplicatedProjectPosition' Lens +modelsProjectDuplicateDuplicatedProjectPositionL :: Lens_' ModelsProjectDuplicateDuplicatedProject (Maybe Double) +modelsProjectDuplicateDuplicatedProjectPositionL f ModelsProjectDuplicateDuplicatedProject{..} = (\modelsProjectDuplicateDuplicatedProjectPosition -> ModelsProjectDuplicateDuplicatedProject { modelsProjectDuplicateDuplicatedProjectPosition, ..} ) <$> f modelsProjectDuplicateDuplicatedProjectPosition +{-# INLINE modelsProjectDuplicateDuplicatedProjectPositionL #-} + +-- | 'modelsProjectDuplicateDuplicatedProjectSubscription' Lens +modelsProjectDuplicateDuplicatedProjectSubscriptionL :: Lens_' ModelsProjectDuplicateDuplicatedProject (Maybe ModelsProjectSubscription) +modelsProjectDuplicateDuplicatedProjectSubscriptionL f ModelsProjectDuplicateDuplicatedProject{..} = (\modelsProjectDuplicateDuplicatedProjectSubscription -> ModelsProjectDuplicateDuplicatedProject { modelsProjectDuplicateDuplicatedProjectSubscription, ..} ) <$> f modelsProjectDuplicateDuplicatedProjectSubscription +{-# INLINE modelsProjectDuplicateDuplicatedProjectSubscriptionL #-} + +-- | 'modelsProjectDuplicateDuplicatedProjectTitle' Lens +modelsProjectDuplicateDuplicatedProjectTitleL :: Lens_' ModelsProjectDuplicateDuplicatedProject (Maybe Text) +modelsProjectDuplicateDuplicatedProjectTitleL f ModelsProjectDuplicateDuplicatedProject{..} = (\modelsProjectDuplicateDuplicatedProjectTitle -> ModelsProjectDuplicateDuplicatedProject { modelsProjectDuplicateDuplicatedProjectTitle, ..} ) <$> f modelsProjectDuplicateDuplicatedProjectTitle +{-# INLINE modelsProjectDuplicateDuplicatedProjectTitleL #-} + +-- | 'modelsProjectDuplicateDuplicatedProjectUpdated' Lens +modelsProjectDuplicateDuplicatedProjectUpdatedL :: Lens_' ModelsProjectDuplicateDuplicatedProject (Maybe Text) +modelsProjectDuplicateDuplicatedProjectUpdatedL f ModelsProjectDuplicateDuplicatedProject{..} = (\modelsProjectDuplicateDuplicatedProjectUpdated -> ModelsProjectDuplicateDuplicatedProject { modelsProjectDuplicateDuplicatedProjectUpdated, ..} ) <$> f modelsProjectDuplicateDuplicatedProjectUpdated +{-# INLINE modelsProjectDuplicateDuplicatedProjectUpdatedL #-} + +-- | 'modelsProjectDuplicateDuplicatedProjectViews' Lens +modelsProjectDuplicateDuplicatedProjectViewsL :: Lens_' ModelsProjectDuplicateDuplicatedProject (Maybe [ModelsProjectView]) +modelsProjectDuplicateDuplicatedProjectViewsL f ModelsProjectDuplicateDuplicatedProject{..} = (\modelsProjectDuplicateDuplicatedProjectViews -> ModelsProjectDuplicateDuplicatedProject { modelsProjectDuplicateDuplicatedProjectViews, ..} ) <$> f modelsProjectDuplicateDuplicatedProjectViews +{-# INLINE modelsProjectDuplicateDuplicatedProjectViewsL #-} + + + +-- * ModelsProjectOwner + +-- | 'modelsProjectOwnerCreated' Lens +modelsProjectOwnerCreatedL :: Lens_' ModelsProjectOwner (Maybe Text) +modelsProjectOwnerCreatedL f ModelsProjectOwner{..} = (\modelsProjectOwnerCreated -> ModelsProjectOwner { modelsProjectOwnerCreated, ..} ) <$> f modelsProjectOwnerCreated +{-# INLINE modelsProjectOwnerCreatedL #-} + +-- | 'modelsProjectOwnerEmail' Lens +modelsProjectOwnerEmailL :: Lens_' ModelsProjectOwner (Maybe Text) +modelsProjectOwnerEmailL f ModelsProjectOwner{..} = (\modelsProjectOwnerEmail -> ModelsProjectOwner { modelsProjectOwnerEmail, ..} ) <$> f modelsProjectOwnerEmail +{-# INLINE modelsProjectOwnerEmailL #-} + +-- | 'modelsProjectOwnerId' Lens +modelsProjectOwnerIdL :: Lens_' ModelsProjectOwner (Maybe Int) +modelsProjectOwnerIdL f ModelsProjectOwner{..} = (\modelsProjectOwnerId -> ModelsProjectOwner { modelsProjectOwnerId, ..} ) <$> f modelsProjectOwnerId +{-# INLINE modelsProjectOwnerIdL #-} + +-- | 'modelsProjectOwnerName' Lens +modelsProjectOwnerNameL :: Lens_' ModelsProjectOwner (Maybe Text) +modelsProjectOwnerNameL f ModelsProjectOwner{..} = (\modelsProjectOwnerName -> ModelsProjectOwner { modelsProjectOwnerName, ..} ) <$> f modelsProjectOwnerName +{-# INLINE modelsProjectOwnerNameL #-} + +-- | 'modelsProjectOwnerUpdated' Lens +modelsProjectOwnerUpdatedL :: Lens_' ModelsProjectOwner (Maybe Text) +modelsProjectOwnerUpdatedL f ModelsProjectOwner{..} = (\modelsProjectOwnerUpdated -> ModelsProjectOwner { modelsProjectOwnerUpdated, ..} ) <$> f modelsProjectOwnerUpdated +{-# INLINE modelsProjectOwnerUpdatedL #-} + +-- | 'modelsProjectOwnerUsername' Lens +modelsProjectOwnerUsernameL :: Lens_' ModelsProjectOwner (Maybe Text) +modelsProjectOwnerUsernameL f ModelsProjectOwner{..} = (\modelsProjectOwnerUsername -> ModelsProjectOwner { modelsProjectOwnerUsername, ..} ) <$> f modelsProjectOwnerUsername +{-# INLINE modelsProjectOwnerUsernameL #-} + + + +-- * ModelsProjectSubscription + +-- | 'modelsProjectSubscriptionCreated' Lens +modelsProjectSubscriptionCreatedL :: Lens_' ModelsProjectSubscription (Maybe Text) +modelsProjectSubscriptionCreatedL f ModelsProjectSubscription{..} = (\modelsProjectSubscriptionCreated -> ModelsProjectSubscription { modelsProjectSubscriptionCreated, ..} ) <$> f modelsProjectSubscriptionCreated +{-# INLINE modelsProjectSubscriptionCreatedL #-} + +-- | 'modelsProjectSubscriptionEntity' Lens +modelsProjectSubscriptionEntityL :: Lens_' ModelsProjectSubscription (Maybe Int) +modelsProjectSubscriptionEntityL f ModelsProjectSubscription{..} = (\modelsProjectSubscriptionEntity -> ModelsProjectSubscription { modelsProjectSubscriptionEntity, ..} ) <$> f modelsProjectSubscriptionEntity +{-# INLINE modelsProjectSubscriptionEntityL #-} + +-- | 'modelsProjectSubscriptionEntityId' Lens +modelsProjectSubscriptionEntityIdL :: Lens_' ModelsProjectSubscription (Maybe Int) +modelsProjectSubscriptionEntityIdL f ModelsProjectSubscription{..} = (\modelsProjectSubscriptionEntityId -> ModelsProjectSubscription { modelsProjectSubscriptionEntityId, ..} ) <$> f modelsProjectSubscriptionEntityId +{-# INLINE modelsProjectSubscriptionEntityIdL #-} + +-- | 'modelsProjectSubscriptionId' Lens +modelsProjectSubscriptionIdL :: Lens_' ModelsProjectSubscription (Maybe Int) +modelsProjectSubscriptionIdL f ModelsProjectSubscription{..} = (\modelsProjectSubscriptionId -> ModelsProjectSubscription { modelsProjectSubscriptionId, ..} ) <$> f modelsProjectSubscriptionId +{-# INLINE modelsProjectSubscriptionIdL #-} + + + +-- * ModelsProjectUser + +-- | 'modelsProjectUserCreated' Lens +modelsProjectUserCreatedL :: Lens_' ModelsProjectUser (Maybe Text) +modelsProjectUserCreatedL f ModelsProjectUser{..} = (\modelsProjectUserCreated -> ModelsProjectUser { modelsProjectUserCreated, ..} ) <$> f modelsProjectUserCreated +{-# INLINE modelsProjectUserCreatedL #-} + +-- | 'modelsProjectUserId' Lens +modelsProjectUserIdL :: Lens_' ModelsProjectUser (Maybe Int) +modelsProjectUserIdL f ModelsProjectUser{..} = (\modelsProjectUserId -> ModelsProjectUser { modelsProjectUserId, ..} ) <$> f modelsProjectUserId +{-# INLINE modelsProjectUserIdL #-} + +-- | 'modelsProjectUserRight' Lens +modelsProjectUserRightL :: Lens_' ModelsProjectUser (Maybe ModelsRight) +modelsProjectUserRightL f ModelsProjectUser{..} = (\modelsProjectUserRight -> ModelsProjectUser { modelsProjectUserRight, ..} ) <$> f modelsProjectUserRight +{-# INLINE modelsProjectUserRightL #-} + +-- | 'modelsProjectUserUpdated' Lens +modelsProjectUserUpdatedL :: Lens_' ModelsProjectUser (Maybe Text) +modelsProjectUserUpdatedL f ModelsProjectUser{..} = (\modelsProjectUserUpdated -> ModelsProjectUser { modelsProjectUserUpdated, ..} ) <$> f modelsProjectUserUpdated +{-# INLINE modelsProjectUserUpdatedL #-} + +-- | 'modelsProjectUserUserId' Lens +modelsProjectUserUserIdL :: Lens_' ModelsProjectUser (Maybe Text) +modelsProjectUserUserIdL f ModelsProjectUser{..} = (\modelsProjectUserUserId -> ModelsProjectUser { modelsProjectUserUserId, ..} ) <$> f modelsProjectUserUserId +{-# INLINE modelsProjectUserUserIdL #-} + + + +-- * ModelsProjectView + +-- | 'modelsProjectViewBucketConfiguration' Lens +modelsProjectViewBucketConfigurationL :: Lens_' ModelsProjectView (Maybe [ModelsProjectViewBucketConfiguration]) +modelsProjectViewBucketConfigurationL f ModelsProjectView{..} = (\modelsProjectViewBucketConfiguration -> ModelsProjectView { modelsProjectViewBucketConfiguration, ..} ) <$> f modelsProjectViewBucketConfiguration +{-# INLINE modelsProjectViewBucketConfigurationL #-} + +-- | 'modelsProjectViewBucketConfigurationMode' Lens +modelsProjectViewBucketConfigurationModeL :: Lens_' ModelsProjectView (Maybe ModelsBucketConfigurationModeKind) +modelsProjectViewBucketConfigurationModeL f ModelsProjectView{..} = (\modelsProjectViewBucketConfigurationMode -> ModelsProjectView { modelsProjectViewBucketConfigurationMode, ..} ) <$> f modelsProjectViewBucketConfigurationMode +{-# INLINE modelsProjectViewBucketConfigurationModeL #-} + +-- | 'modelsProjectViewCreated' Lens +modelsProjectViewCreatedL :: Lens_' ModelsProjectView (Maybe Text) +modelsProjectViewCreatedL f ModelsProjectView{..} = (\modelsProjectViewCreated -> ModelsProjectView { modelsProjectViewCreated, ..} ) <$> f modelsProjectViewCreated +{-# INLINE modelsProjectViewCreatedL #-} + +-- | 'modelsProjectViewDefaultBucketId' Lens +modelsProjectViewDefaultBucketIdL :: Lens_' ModelsProjectView (Maybe Int) +modelsProjectViewDefaultBucketIdL f ModelsProjectView{..} = (\modelsProjectViewDefaultBucketId -> ModelsProjectView { modelsProjectViewDefaultBucketId, ..} ) <$> f modelsProjectViewDefaultBucketId +{-# INLINE modelsProjectViewDefaultBucketIdL #-} + +-- | 'modelsProjectViewDoneBucketId' Lens +modelsProjectViewDoneBucketIdL :: Lens_' ModelsProjectView (Maybe Int) +modelsProjectViewDoneBucketIdL f ModelsProjectView{..} = (\modelsProjectViewDoneBucketId -> ModelsProjectView { modelsProjectViewDoneBucketId, ..} ) <$> f modelsProjectViewDoneBucketId +{-# INLINE modelsProjectViewDoneBucketIdL #-} + +-- | 'modelsProjectViewFilter' Lens +modelsProjectViewFilterL :: Lens_' ModelsProjectView (Maybe Text) +modelsProjectViewFilterL f ModelsProjectView{..} = (\modelsProjectViewFilter -> ModelsProjectView { modelsProjectViewFilter, ..} ) <$> f modelsProjectViewFilter +{-# INLINE modelsProjectViewFilterL #-} + +-- | 'modelsProjectViewId' Lens +modelsProjectViewIdL :: Lens_' ModelsProjectView (Maybe Int) +modelsProjectViewIdL f ModelsProjectView{..} = (\modelsProjectViewId -> ModelsProjectView { modelsProjectViewId, ..} ) <$> f modelsProjectViewId +{-# INLINE modelsProjectViewIdL #-} + +-- | 'modelsProjectViewPosition' Lens +modelsProjectViewPositionL :: Lens_' ModelsProjectView (Maybe Double) +modelsProjectViewPositionL f ModelsProjectView{..} = (\modelsProjectViewPosition -> ModelsProjectView { modelsProjectViewPosition, ..} ) <$> f modelsProjectViewPosition +{-# INLINE modelsProjectViewPositionL #-} + +-- | 'modelsProjectViewProjectId' Lens +modelsProjectViewProjectIdL :: Lens_' ModelsProjectView (Maybe Int) +modelsProjectViewProjectIdL f ModelsProjectView{..} = (\modelsProjectViewProjectId -> ModelsProjectView { modelsProjectViewProjectId, ..} ) <$> f modelsProjectViewProjectId +{-# INLINE modelsProjectViewProjectIdL #-} + +-- | 'modelsProjectViewTitle' Lens +modelsProjectViewTitleL :: Lens_' ModelsProjectView (Maybe Text) +modelsProjectViewTitleL f ModelsProjectView{..} = (\modelsProjectViewTitle -> ModelsProjectView { modelsProjectViewTitle, ..} ) <$> f modelsProjectViewTitle +{-# INLINE modelsProjectViewTitleL #-} + +-- | 'modelsProjectViewUpdated' Lens +modelsProjectViewUpdatedL :: Lens_' ModelsProjectView (Maybe Text) +modelsProjectViewUpdatedL f ModelsProjectView{..} = (\modelsProjectViewUpdated -> ModelsProjectView { modelsProjectViewUpdated, ..} ) <$> f modelsProjectViewUpdated +{-# INLINE modelsProjectViewUpdatedL #-} + +-- | 'modelsProjectViewViewKind' Lens +modelsProjectViewViewKindL :: Lens_' ModelsProjectView (Maybe ModelsProjectViewKind) +modelsProjectViewViewKindL f ModelsProjectView{..} = (\modelsProjectViewViewKind -> ModelsProjectView { modelsProjectViewViewKind, ..} ) <$> f modelsProjectViewViewKind +{-# INLINE modelsProjectViewViewKindL #-} + + + +-- * ModelsProjectViewBucketConfiguration + +-- | 'modelsProjectViewBucketConfigurationFilter' Lens +modelsProjectViewBucketConfigurationFilterL :: Lens_' ModelsProjectViewBucketConfiguration (Maybe Text) +modelsProjectViewBucketConfigurationFilterL f ModelsProjectViewBucketConfiguration{..} = (\modelsProjectViewBucketConfigurationFilter -> ModelsProjectViewBucketConfiguration { modelsProjectViewBucketConfigurationFilter, ..} ) <$> f modelsProjectViewBucketConfigurationFilter +{-# INLINE modelsProjectViewBucketConfigurationFilterL #-} + +-- | 'modelsProjectViewBucketConfigurationTitle' Lens +modelsProjectViewBucketConfigurationTitleL :: Lens_' ModelsProjectViewBucketConfiguration (Maybe Text) +modelsProjectViewBucketConfigurationTitleL f ModelsProjectViewBucketConfiguration{..} = (\modelsProjectViewBucketConfigurationTitle -> ModelsProjectViewBucketConfiguration { modelsProjectViewBucketConfigurationTitle, ..} ) <$> f modelsProjectViewBucketConfigurationTitle +{-# INLINE modelsProjectViewBucketConfigurationTitleL #-} + + + +-- * ModelsProjectViewKind + + + +-- * ModelsReaction + +-- | 'modelsReactionCreated' Lens +modelsReactionCreatedL :: Lens_' ModelsReaction (Maybe Text) +modelsReactionCreatedL f ModelsReaction{..} = (\modelsReactionCreated -> ModelsReaction { modelsReactionCreated, ..} ) <$> f modelsReactionCreated +{-# INLINE modelsReactionCreatedL #-} + +-- | 'modelsReactionUser' Lens +modelsReactionUserL :: Lens_' ModelsReaction (Maybe ModelsReactionUser) +modelsReactionUserL f ModelsReaction{..} = (\modelsReactionUser -> ModelsReaction { modelsReactionUser, ..} ) <$> f modelsReactionUser +{-# INLINE modelsReactionUserL #-} + +-- | 'modelsReactionValue' Lens +modelsReactionValueL :: Lens_' ModelsReaction (Maybe Text) +modelsReactionValueL f ModelsReaction{..} = (\modelsReactionValue -> ModelsReaction { modelsReactionValue, ..} ) <$> f modelsReactionValue +{-# INLINE modelsReactionValueL #-} + + + +-- * ModelsReactionUser + +-- | 'modelsReactionUserCreated' Lens +modelsReactionUserCreatedL :: Lens_' ModelsReactionUser (Maybe Text) +modelsReactionUserCreatedL f ModelsReactionUser{..} = (\modelsReactionUserCreated -> ModelsReactionUser { modelsReactionUserCreated, ..} ) <$> f modelsReactionUserCreated +{-# INLINE modelsReactionUserCreatedL #-} + +-- | 'modelsReactionUserEmail' Lens +modelsReactionUserEmailL :: Lens_' ModelsReactionUser (Maybe Text) +modelsReactionUserEmailL f ModelsReactionUser{..} = (\modelsReactionUserEmail -> ModelsReactionUser { modelsReactionUserEmail, ..} ) <$> f modelsReactionUserEmail +{-# INLINE modelsReactionUserEmailL #-} + +-- | 'modelsReactionUserId' Lens +modelsReactionUserIdL :: Lens_' ModelsReactionUser (Maybe Int) +modelsReactionUserIdL f ModelsReactionUser{..} = (\modelsReactionUserId -> ModelsReactionUser { modelsReactionUserId, ..} ) <$> f modelsReactionUserId +{-# INLINE modelsReactionUserIdL #-} + +-- | 'modelsReactionUserName' Lens +modelsReactionUserNameL :: Lens_' ModelsReactionUser (Maybe Text) +modelsReactionUserNameL f ModelsReactionUser{..} = (\modelsReactionUserName -> ModelsReactionUser { modelsReactionUserName, ..} ) <$> f modelsReactionUserName +{-# INLINE modelsReactionUserNameL #-} + +-- | 'modelsReactionUserUpdated' Lens +modelsReactionUserUpdatedL :: Lens_' ModelsReactionUser (Maybe Text) +modelsReactionUserUpdatedL f ModelsReactionUser{..} = (\modelsReactionUserUpdated -> ModelsReactionUser { modelsReactionUserUpdated, ..} ) <$> f modelsReactionUserUpdated +{-# INLINE modelsReactionUserUpdatedL #-} + +-- | 'modelsReactionUserUsername' Lens +modelsReactionUserUsernameL :: Lens_' ModelsReactionUser (Maybe Text) +modelsReactionUserUsernameL f ModelsReactionUser{..} = (\modelsReactionUserUsername -> ModelsReactionUser { modelsReactionUserUsername, ..} ) <$> f modelsReactionUserUsername +{-# INLINE modelsReactionUserUsernameL #-} + + + +-- * ModelsRelationKind + + + +-- * ModelsReminderRelation + + + +-- * ModelsRight + + + +-- * ModelsRouteDetail + +-- | 'modelsRouteDetailMethod' Lens +modelsRouteDetailMethodL :: Lens_' ModelsRouteDetail (Maybe Text) +modelsRouteDetailMethodL f ModelsRouteDetail{..} = (\modelsRouteDetailMethod -> ModelsRouteDetail { modelsRouteDetailMethod, ..} ) <$> f modelsRouteDetailMethod +{-# INLINE modelsRouteDetailMethodL #-} + +-- | 'modelsRouteDetailPath' Lens +modelsRouteDetailPathL :: Lens_' ModelsRouteDetail (Maybe Text) +modelsRouteDetailPathL f ModelsRouteDetail{..} = (\modelsRouteDetailPath -> ModelsRouteDetail { modelsRouteDetailPath, ..} ) <$> f modelsRouteDetailPath +{-# INLINE modelsRouteDetailPathL #-} + + + +-- * ModelsSavedFilter + +-- | 'modelsSavedFilterCreated' Lens +modelsSavedFilterCreatedL :: Lens_' ModelsSavedFilter (Maybe Text) +modelsSavedFilterCreatedL f ModelsSavedFilter{..} = (\modelsSavedFilterCreated -> ModelsSavedFilter { modelsSavedFilterCreated, ..} ) <$> f modelsSavedFilterCreated +{-# INLINE modelsSavedFilterCreatedL #-} + +-- | 'modelsSavedFilterDescription' Lens +modelsSavedFilterDescriptionL :: Lens_' ModelsSavedFilter (Maybe Text) +modelsSavedFilterDescriptionL f ModelsSavedFilter{..} = (\modelsSavedFilterDescription -> ModelsSavedFilter { modelsSavedFilterDescription, ..} ) <$> f modelsSavedFilterDescription +{-# INLINE modelsSavedFilterDescriptionL #-} + +-- | 'modelsSavedFilterFilters' Lens +modelsSavedFilterFiltersL :: Lens_' ModelsSavedFilter (Maybe ModelsSavedFilterFilters) +modelsSavedFilterFiltersL f ModelsSavedFilter{..} = (\modelsSavedFilterFilters -> ModelsSavedFilter { modelsSavedFilterFilters, ..} ) <$> f modelsSavedFilterFilters +{-# INLINE modelsSavedFilterFiltersL #-} + +-- | 'modelsSavedFilterId' Lens +modelsSavedFilterIdL :: Lens_' ModelsSavedFilter (Maybe Int) +modelsSavedFilterIdL f ModelsSavedFilter{..} = (\modelsSavedFilterId -> ModelsSavedFilter { modelsSavedFilterId, ..} ) <$> f modelsSavedFilterId +{-# INLINE modelsSavedFilterIdL #-} + +-- | 'modelsSavedFilterIsFavorite' Lens +modelsSavedFilterIsFavoriteL :: Lens_' ModelsSavedFilter (Maybe Bool) +modelsSavedFilterIsFavoriteL f ModelsSavedFilter{..} = (\modelsSavedFilterIsFavorite -> ModelsSavedFilter { modelsSavedFilterIsFavorite, ..} ) <$> f modelsSavedFilterIsFavorite +{-# INLINE modelsSavedFilterIsFavoriteL #-} + +-- | 'modelsSavedFilterOwner' Lens +modelsSavedFilterOwnerL :: Lens_' ModelsSavedFilter (Maybe ModelsSavedFilterOwner) +modelsSavedFilterOwnerL f ModelsSavedFilter{..} = (\modelsSavedFilterOwner -> ModelsSavedFilter { modelsSavedFilterOwner, ..} ) <$> f modelsSavedFilterOwner +{-# INLINE modelsSavedFilterOwnerL #-} + +-- | 'modelsSavedFilterTitle' Lens +modelsSavedFilterTitleL :: Lens_' ModelsSavedFilter (Maybe Text) +modelsSavedFilterTitleL f ModelsSavedFilter{..} = (\modelsSavedFilterTitle -> ModelsSavedFilter { modelsSavedFilterTitle, ..} ) <$> f modelsSavedFilterTitle +{-# INLINE modelsSavedFilterTitleL #-} + +-- | 'modelsSavedFilterUpdated' Lens +modelsSavedFilterUpdatedL :: Lens_' ModelsSavedFilter (Maybe Text) +modelsSavedFilterUpdatedL f ModelsSavedFilter{..} = (\modelsSavedFilterUpdated -> ModelsSavedFilter { modelsSavedFilterUpdated, ..} ) <$> f modelsSavedFilterUpdated +{-# INLINE modelsSavedFilterUpdatedL #-} + + + +-- * ModelsSavedFilterFilters + +-- | 'modelsSavedFilterFiltersFilter' Lens +modelsSavedFilterFiltersFilterL :: Lens_' ModelsSavedFilterFilters (Maybe Text) +modelsSavedFilterFiltersFilterL f ModelsSavedFilterFilters{..} = (\modelsSavedFilterFiltersFilter -> ModelsSavedFilterFilters { modelsSavedFilterFiltersFilter, ..} ) <$> f modelsSavedFilterFiltersFilter +{-# INLINE modelsSavedFilterFiltersFilterL #-} + +-- | 'modelsSavedFilterFiltersFilterIncludeNulls' Lens +modelsSavedFilterFiltersFilterIncludeNullsL :: Lens_' ModelsSavedFilterFilters (Maybe Bool) +modelsSavedFilterFiltersFilterIncludeNullsL f ModelsSavedFilterFilters{..} = (\modelsSavedFilterFiltersFilterIncludeNulls -> ModelsSavedFilterFilters { modelsSavedFilterFiltersFilterIncludeNulls, ..} ) <$> f modelsSavedFilterFiltersFilterIncludeNulls +{-# INLINE modelsSavedFilterFiltersFilterIncludeNullsL #-} + +-- | 'modelsSavedFilterFiltersOrderBy' Lens +modelsSavedFilterFiltersOrderByL :: Lens_' ModelsSavedFilterFilters (Maybe [Text]) +modelsSavedFilterFiltersOrderByL f ModelsSavedFilterFilters{..} = (\modelsSavedFilterFiltersOrderBy -> ModelsSavedFilterFilters { modelsSavedFilterFiltersOrderBy, ..} ) <$> f modelsSavedFilterFiltersOrderBy +{-# INLINE modelsSavedFilterFiltersOrderByL #-} + +-- | 'modelsSavedFilterFiltersSortBy' Lens +modelsSavedFilterFiltersSortByL :: Lens_' ModelsSavedFilterFilters (Maybe [Text]) +modelsSavedFilterFiltersSortByL f ModelsSavedFilterFilters{..} = (\modelsSavedFilterFiltersSortBy -> ModelsSavedFilterFilters { modelsSavedFilterFiltersSortBy, ..} ) <$> f modelsSavedFilterFiltersSortBy +{-# INLINE modelsSavedFilterFiltersSortByL #-} + + + +-- * ModelsSavedFilterOwner + +-- | 'modelsSavedFilterOwnerCreated' Lens +modelsSavedFilterOwnerCreatedL :: Lens_' ModelsSavedFilterOwner (Maybe Text) +modelsSavedFilterOwnerCreatedL f ModelsSavedFilterOwner{..} = (\modelsSavedFilterOwnerCreated -> ModelsSavedFilterOwner { modelsSavedFilterOwnerCreated, ..} ) <$> f modelsSavedFilterOwnerCreated +{-# INLINE modelsSavedFilterOwnerCreatedL #-} + +-- | 'modelsSavedFilterOwnerEmail' Lens +modelsSavedFilterOwnerEmailL :: Lens_' ModelsSavedFilterOwner (Maybe Text) +modelsSavedFilterOwnerEmailL f ModelsSavedFilterOwner{..} = (\modelsSavedFilterOwnerEmail -> ModelsSavedFilterOwner { modelsSavedFilterOwnerEmail, ..} ) <$> f modelsSavedFilterOwnerEmail +{-# INLINE modelsSavedFilterOwnerEmailL #-} + +-- | 'modelsSavedFilterOwnerId' Lens +modelsSavedFilterOwnerIdL :: Lens_' ModelsSavedFilterOwner (Maybe Int) +modelsSavedFilterOwnerIdL f ModelsSavedFilterOwner{..} = (\modelsSavedFilterOwnerId -> ModelsSavedFilterOwner { modelsSavedFilterOwnerId, ..} ) <$> f modelsSavedFilterOwnerId +{-# INLINE modelsSavedFilterOwnerIdL #-} + +-- | 'modelsSavedFilterOwnerName' Lens +modelsSavedFilterOwnerNameL :: Lens_' ModelsSavedFilterOwner (Maybe Text) +modelsSavedFilterOwnerNameL f ModelsSavedFilterOwner{..} = (\modelsSavedFilterOwnerName -> ModelsSavedFilterOwner { modelsSavedFilterOwnerName, ..} ) <$> f modelsSavedFilterOwnerName +{-# INLINE modelsSavedFilterOwnerNameL #-} + +-- | 'modelsSavedFilterOwnerUpdated' Lens +modelsSavedFilterOwnerUpdatedL :: Lens_' ModelsSavedFilterOwner (Maybe Text) +modelsSavedFilterOwnerUpdatedL f ModelsSavedFilterOwner{..} = (\modelsSavedFilterOwnerUpdated -> ModelsSavedFilterOwner { modelsSavedFilterOwnerUpdated, ..} ) <$> f modelsSavedFilterOwnerUpdated +{-# INLINE modelsSavedFilterOwnerUpdatedL #-} + +-- | 'modelsSavedFilterOwnerUsername' Lens +modelsSavedFilterOwnerUsernameL :: Lens_' ModelsSavedFilterOwner (Maybe Text) +modelsSavedFilterOwnerUsernameL f ModelsSavedFilterOwner{..} = (\modelsSavedFilterOwnerUsername -> ModelsSavedFilterOwner { modelsSavedFilterOwnerUsername, ..} ) <$> f modelsSavedFilterOwnerUsername +{-# INLINE modelsSavedFilterOwnerUsernameL #-} + + + +-- * ModelsSharingType + + + +-- * ModelsSubscription + +-- | 'modelsSubscriptionCreated' Lens +modelsSubscriptionCreatedL :: Lens_' ModelsSubscription (Maybe Text) +modelsSubscriptionCreatedL f ModelsSubscription{..} = (\modelsSubscriptionCreated -> ModelsSubscription { modelsSubscriptionCreated, ..} ) <$> f modelsSubscriptionCreated +{-# INLINE modelsSubscriptionCreatedL #-} + +-- | 'modelsSubscriptionEntity' Lens +modelsSubscriptionEntityL :: Lens_' ModelsSubscription (Maybe Int) +modelsSubscriptionEntityL f ModelsSubscription{..} = (\modelsSubscriptionEntity -> ModelsSubscription { modelsSubscriptionEntity, ..} ) <$> f modelsSubscriptionEntity +{-# INLINE modelsSubscriptionEntityL #-} + +-- | 'modelsSubscriptionEntityId' Lens +modelsSubscriptionEntityIdL :: Lens_' ModelsSubscription (Maybe Int) +modelsSubscriptionEntityIdL f ModelsSubscription{..} = (\modelsSubscriptionEntityId -> ModelsSubscription { modelsSubscriptionEntityId, ..} ) <$> f modelsSubscriptionEntityId +{-# INLINE modelsSubscriptionEntityIdL #-} + +-- | 'modelsSubscriptionId' Lens +modelsSubscriptionIdL :: Lens_' ModelsSubscription (Maybe Int) +modelsSubscriptionIdL f ModelsSubscription{..} = (\modelsSubscriptionId -> ModelsSubscription { modelsSubscriptionId, ..} ) <$> f modelsSubscriptionId +{-# INLINE modelsSubscriptionIdL #-} + + + +-- * ModelsTask + +-- | 'modelsTaskAssignees' Lens +modelsTaskAssigneesL :: Lens_' ModelsTask (Maybe [UserUser]) +modelsTaskAssigneesL f ModelsTask{..} = (\modelsTaskAssignees -> ModelsTask { modelsTaskAssignees, ..} ) <$> f modelsTaskAssignees +{-# INLINE modelsTaskAssigneesL #-} + +-- | 'modelsTaskAttachments' Lens +modelsTaskAttachmentsL :: Lens_' ModelsTask (Maybe [ModelsTaskAttachment]) +modelsTaskAttachmentsL f ModelsTask{..} = (\modelsTaskAttachments -> ModelsTask { modelsTaskAttachments, ..} ) <$> f modelsTaskAttachments +{-# INLINE modelsTaskAttachmentsL #-} + +-- | 'modelsTaskBucketId' Lens +modelsTaskBucketIdL :: Lens_' ModelsTask (Maybe Int) +modelsTaskBucketIdL f ModelsTask{..} = (\modelsTaskBucketId -> ModelsTask { modelsTaskBucketId, ..} ) <$> f modelsTaskBucketId +{-# INLINE modelsTaskBucketIdL #-} + +-- | 'modelsTaskCoverImageAttachmentId' Lens +modelsTaskCoverImageAttachmentIdL :: Lens_' ModelsTask (Maybe Int) +modelsTaskCoverImageAttachmentIdL f ModelsTask{..} = (\modelsTaskCoverImageAttachmentId -> ModelsTask { modelsTaskCoverImageAttachmentId, ..} ) <$> f modelsTaskCoverImageAttachmentId +{-# INLINE modelsTaskCoverImageAttachmentIdL #-} + +-- | 'modelsTaskCreated' Lens +modelsTaskCreatedL :: Lens_' ModelsTask (Maybe Text) +modelsTaskCreatedL f ModelsTask{..} = (\modelsTaskCreated -> ModelsTask { modelsTaskCreated, ..} ) <$> f modelsTaskCreated +{-# INLINE modelsTaskCreatedL #-} + +-- | 'modelsTaskCreatedBy' Lens +modelsTaskCreatedByL :: Lens_' ModelsTask (Maybe ModelsBulkTaskCreatedBy) +modelsTaskCreatedByL f ModelsTask{..} = (\modelsTaskCreatedBy -> ModelsTask { modelsTaskCreatedBy, ..} ) <$> f modelsTaskCreatedBy +{-# INLINE modelsTaskCreatedByL #-} + +-- | 'modelsTaskDescription' Lens +modelsTaskDescriptionL :: Lens_' ModelsTask (Maybe Text) +modelsTaskDescriptionL f ModelsTask{..} = (\modelsTaskDescription -> ModelsTask { modelsTaskDescription, ..} ) <$> f modelsTaskDescription +{-# INLINE modelsTaskDescriptionL #-} + +-- | 'modelsTaskDone' Lens +modelsTaskDoneL :: Lens_' ModelsTask (Maybe Bool) +modelsTaskDoneL f ModelsTask{..} = (\modelsTaskDone -> ModelsTask { modelsTaskDone, ..} ) <$> f modelsTaskDone +{-# INLINE modelsTaskDoneL #-} + +-- | 'modelsTaskDoneAt' Lens +modelsTaskDoneAtL :: Lens_' ModelsTask (Maybe Text) +modelsTaskDoneAtL f ModelsTask{..} = (\modelsTaskDoneAt -> ModelsTask { modelsTaskDoneAt, ..} ) <$> f modelsTaskDoneAt +{-# INLINE modelsTaskDoneAtL #-} + +-- | 'modelsTaskDueDate' Lens +modelsTaskDueDateL :: Lens_' ModelsTask (Maybe Text) +modelsTaskDueDateL f ModelsTask{..} = (\modelsTaskDueDate -> ModelsTask { modelsTaskDueDate, ..} ) <$> f modelsTaskDueDate +{-# INLINE modelsTaskDueDateL #-} + +-- | 'modelsTaskEndDate' Lens +modelsTaskEndDateL :: Lens_' ModelsTask (Maybe Text) +modelsTaskEndDateL f ModelsTask{..} = (\modelsTaskEndDate -> ModelsTask { modelsTaskEndDate, ..} ) <$> f modelsTaskEndDate +{-# INLINE modelsTaskEndDateL #-} + +-- | 'modelsTaskHexColor' Lens +modelsTaskHexColorL :: Lens_' ModelsTask (Maybe Text) +modelsTaskHexColorL f ModelsTask{..} = (\modelsTaskHexColor -> ModelsTask { modelsTaskHexColor, ..} ) <$> f modelsTaskHexColor +{-# INLINE modelsTaskHexColorL #-} + +-- | 'modelsTaskId' Lens +modelsTaskIdL :: Lens_' ModelsTask (Maybe Int) +modelsTaskIdL f ModelsTask{..} = (\modelsTaskId -> ModelsTask { modelsTaskId, ..} ) <$> f modelsTaskId +{-# INLINE modelsTaskIdL #-} + +-- | 'modelsTaskIdentifier' Lens +modelsTaskIdentifierL :: Lens_' ModelsTask (Maybe Text) +modelsTaskIdentifierL f ModelsTask{..} = (\modelsTaskIdentifier -> ModelsTask { modelsTaskIdentifier, ..} ) <$> f modelsTaskIdentifier +{-# INLINE modelsTaskIdentifierL #-} + +-- | 'modelsTaskIndex' Lens +modelsTaskIndexL :: Lens_' ModelsTask (Maybe Int) +modelsTaskIndexL f ModelsTask{..} = (\modelsTaskIndex -> ModelsTask { modelsTaskIndex, ..} ) <$> f modelsTaskIndex +{-# INLINE modelsTaskIndexL #-} + +-- | 'modelsTaskIsFavorite' Lens +modelsTaskIsFavoriteL :: Lens_' ModelsTask (Maybe Bool) +modelsTaskIsFavoriteL f ModelsTask{..} = (\modelsTaskIsFavorite -> ModelsTask { modelsTaskIsFavorite, ..} ) <$> f modelsTaskIsFavorite +{-# INLINE modelsTaskIsFavoriteL #-} + +-- | 'modelsTaskLabels' Lens +modelsTaskLabelsL :: Lens_' ModelsTask (Maybe [ModelsLabel]) +modelsTaskLabelsL f ModelsTask{..} = (\modelsTaskLabels -> ModelsTask { modelsTaskLabels, ..} ) <$> f modelsTaskLabels +{-# INLINE modelsTaskLabelsL #-} + +-- | 'modelsTaskPercentDone' Lens +modelsTaskPercentDoneL :: Lens_' ModelsTask (Maybe Double) +modelsTaskPercentDoneL f ModelsTask{..} = (\modelsTaskPercentDone -> ModelsTask { modelsTaskPercentDone, ..} ) <$> f modelsTaskPercentDone +{-# INLINE modelsTaskPercentDoneL #-} + +-- | 'modelsTaskPosition' Lens +modelsTaskPositionL :: Lens_' ModelsTask (Maybe Double) +modelsTaskPositionL f ModelsTask{..} = (\modelsTaskPosition -> ModelsTask { modelsTaskPosition, ..} ) <$> f modelsTaskPosition +{-# INLINE modelsTaskPositionL #-} + +-- | 'modelsTaskPriority' Lens +modelsTaskPriorityL :: Lens_' ModelsTask (Maybe Int) +modelsTaskPriorityL f ModelsTask{..} = (\modelsTaskPriority -> ModelsTask { modelsTaskPriority, ..} ) <$> f modelsTaskPriority +{-# INLINE modelsTaskPriorityL #-} + +-- | 'modelsTaskProjectId' Lens +modelsTaskProjectIdL :: Lens_' ModelsTask (Maybe Int) +modelsTaskProjectIdL f ModelsTask{..} = (\modelsTaskProjectId -> ModelsTask { modelsTaskProjectId, ..} ) <$> f modelsTaskProjectId +{-# INLINE modelsTaskProjectIdL #-} + +-- | 'modelsTaskReactions' Lens +modelsTaskReactionsL :: Lens_' ModelsTask (Maybe Map) +modelsTaskReactionsL f ModelsTask{..} = (\modelsTaskReactions -> ModelsTask { modelsTaskReactions, ..} ) <$> f modelsTaskReactions +{-# INLINE modelsTaskReactionsL #-} + +-- | 'modelsTaskRelatedTasks' Lens +modelsTaskRelatedTasksL :: Lens_' ModelsTask (Maybe Map) +modelsTaskRelatedTasksL f ModelsTask{..} = (\modelsTaskRelatedTasks -> ModelsTask { modelsTaskRelatedTasks, ..} ) <$> f modelsTaskRelatedTasks +{-# INLINE modelsTaskRelatedTasksL #-} + +-- | 'modelsTaskReminders' Lens +modelsTaskRemindersL :: Lens_' ModelsTask (Maybe [ModelsTaskReminder]) +modelsTaskRemindersL f ModelsTask{..} = (\modelsTaskReminders -> ModelsTask { modelsTaskReminders, ..} ) <$> f modelsTaskReminders +{-# INLINE modelsTaskRemindersL #-} + +-- | 'modelsTaskRepeatAfter' Lens +modelsTaskRepeatAfterL :: Lens_' ModelsTask (Maybe Int) +modelsTaskRepeatAfterL f ModelsTask{..} = (\modelsTaskRepeatAfter -> ModelsTask { modelsTaskRepeatAfter, ..} ) <$> f modelsTaskRepeatAfter +{-# INLINE modelsTaskRepeatAfterL #-} + +-- | 'modelsTaskRepeatMode' Lens +modelsTaskRepeatModeL :: Lens_' ModelsTask (Maybe ModelsTaskRepeatMode) +modelsTaskRepeatModeL f ModelsTask{..} = (\modelsTaskRepeatMode -> ModelsTask { modelsTaskRepeatMode, ..} ) <$> f modelsTaskRepeatMode +{-# INLINE modelsTaskRepeatModeL #-} + +-- | 'modelsTaskStartDate' Lens +modelsTaskStartDateL :: Lens_' ModelsTask (Maybe Text) +modelsTaskStartDateL f ModelsTask{..} = (\modelsTaskStartDate -> ModelsTask { modelsTaskStartDate, ..} ) <$> f modelsTaskStartDate +{-# INLINE modelsTaskStartDateL #-} + +-- | 'modelsTaskSubscription' Lens +modelsTaskSubscriptionL :: Lens_' ModelsTask (Maybe ModelsBulkTaskSubscription) +modelsTaskSubscriptionL f ModelsTask{..} = (\modelsTaskSubscription -> ModelsTask { modelsTaskSubscription, ..} ) <$> f modelsTaskSubscription +{-# INLINE modelsTaskSubscriptionL #-} + +-- | 'modelsTaskTitle' Lens +modelsTaskTitleL :: Lens_' ModelsTask (Maybe Text) +modelsTaskTitleL f ModelsTask{..} = (\modelsTaskTitle -> ModelsTask { modelsTaskTitle, ..} ) <$> f modelsTaskTitle +{-# INLINE modelsTaskTitleL #-} + +-- | 'modelsTaskUpdated' Lens +modelsTaskUpdatedL :: Lens_' ModelsTask (Maybe Text) +modelsTaskUpdatedL f ModelsTask{..} = (\modelsTaskUpdated -> ModelsTask { modelsTaskUpdated, ..} ) <$> f modelsTaskUpdated +{-# INLINE modelsTaskUpdatedL #-} + + + +-- * ModelsTaskAssginee + +-- | 'modelsTaskAssgineeCreated' Lens +modelsTaskAssgineeCreatedL :: Lens_' ModelsTaskAssginee (Maybe Text) +modelsTaskAssgineeCreatedL f ModelsTaskAssginee{..} = (\modelsTaskAssgineeCreated -> ModelsTaskAssginee { modelsTaskAssgineeCreated, ..} ) <$> f modelsTaskAssgineeCreated +{-# INLINE modelsTaskAssgineeCreatedL #-} + +-- | 'modelsTaskAssgineeUserId' Lens +modelsTaskAssgineeUserIdL :: Lens_' ModelsTaskAssginee (Maybe Int) +modelsTaskAssgineeUserIdL f ModelsTaskAssginee{..} = (\modelsTaskAssgineeUserId -> ModelsTaskAssginee { modelsTaskAssgineeUserId, ..} ) <$> f modelsTaskAssgineeUserId +{-# INLINE modelsTaskAssgineeUserIdL #-} + + + +-- * ModelsTaskAttachment + +-- | 'modelsTaskAttachmentCreated' Lens +modelsTaskAttachmentCreatedL :: Lens_' ModelsTaskAttachment (Maybe Text) +modelsTaskAttachmentCreatedL f ModelsTaskAttachment{..} = (\modelsTaskAttachmentCreated -> ModelsTaskAttachment { modelsTaskAttachmentCreated, ..} ) <$> f modelsTaskAttachmentCreated +{-# INLINE modelsTaskAttachmentCreatedL #-} + +-- | 'modelsTaskAttachmentCreatedBy' Lens +modelsTaskAttachmentCreatedByL :: Lens_' ModelsTaskAttachment (Maybe UserUser) +modelsTaskAttachmentCreatedByL f ModelsTaskAttachment{..} = (\modelsTaskAttachmentCreatedBy -> ModelsTaskAttachment { modelsTaskAttachmentCreatedBy, ..} ) <$> f modelsTaskAttachmentCreatedBy +{-# INLINE modelsTaskAttachmentCreatedByL #-} + +-- | 'modelsTaskAttachmentFile' Lens +modelsTaskAttachmentFileL :: Lens_' ModelsTaskAttachment (Maybe FilesFile) +modelsTaskAttachmentFileL f ModelsTaskAttachment{..} = (\modelsTaskAttachmentFile -> ModelsTaskAttachment { modelsTaskAttachmentFile, ..} ) <$> f modelsTaskAttachmentFile +{-# INLINE modelsTaskAttachmentFileL #-} + +-- | 'modelsTaskAttachmentId' Lens +modelsTaskAttachmentIdL :: Lens_' ModelsTaskAttachment (Maybe Int) +modelsTaskAttachmentIdL f ModelsTaskAttachment{..} = (\modelsTaskAttachmentId -> ModelsTaskAttachment { modelsTaskAttachmentId, ..} ) <$> f modelsTaskAttachmentId +{-# INLINE modelsTaskAttachmentIdL #-} + +-- | 'modelsTaskAttachmentTaskId' Lens +modelsTaskAttachmentTaskIdL :: Lens_' ModelsTaskAttachment (Maybe Int) +modelsTaskAttachmentTaskIdL f ModelsTaskAttachment{..} = (\modelsTaskAttachmentTaskId -> ModelsTaskAttachment { modelsTaskAttachmentTaskId, ..} ) <$> f modelsTaskAttachmentTaskId +{-# INLINE modelsTaskAttachmentTaskIdL #-} + + + +-- * ModelsTaskBucket + +-- | 'modelsTaskBucketBucketId' Lens +modelsTaskBucketBucketIdL :: Lens_' ModelsTaskBucket (Maybe Int) +modelsTaskBucketBucketIdL f ModelsTaskBucket{..} = (\modelsTaskBucketBucketId -> ModelsTaskBucket { modelsTaskBucketBucketId, ..} ) <$> f modelsTaskBucketBucketId +{-# INLINE modelsTaskBucketBucketIdL #-} + +-- | 'modelsTaskBucketProjectViewId' Lens +modelsTaskBucketProjectViewIdL :: Lens_' ModelsTaskBucket (Maybe Int) +modelsTaskBucketProjectViewIdL f ModelsTaskBucket{..} = (\modelsTaskBucketProjectViewId -> ModelsTaskBucket { modelsTaskBucketProjectViewId, ..} ) <$> f modelsTaskBucketProjectViewId +{-# INLINE modelsTaskBucketProjectViewIdL #-} + +-- | 'modelsTaskBucketTaskDone' Lens +modelsTaskBucketTaskDoneL :: Lens_' ModelsTaskBucket (Maybe Bool) +modelsTaskBucketTaskDoneL f ModelsTaskBucket{..} = (\modelsTaskBucketTaskDone -> ModelsTaskBucket { modelsTaskBucketTaskDone, ..} ) <$> f modelsTaskBucketTaskDone +{-# INLINE modelsTaskBucketTaskDoneL #-} + +-- | 'modelsTaskBucketTaskId' Lens +modelsTaskBucketTaskIdL :: Lens_' ModelsTaskBucket (Maybe Int) +modelsTaskBucketTaskIdL f ModelsTaskBucket{..} = (\modelsTaskBucketTaskId -> ModelsTaskBucket { modelsTaskBucketTaskId, ..} ) <$> f modelsTaskBucketTaskId +{-# INLINE modelsTaskBucketTaskIdL #-} + + + +-- * ModelsTaskCollection + +-- | 'modelsTaskCollectionFilter' Lens +modelsTaskCollectionFilterL :: Lens_' ModelsTaskCollection (Maybe Text) +modelsTaskCollectionFilterL f ModelsTaskCollection{..} = (\modelsTaskCollectionFilter -> ModelsTaskCollection { modelsTaskCollectionFilter, ..} ) <$> f modelsTaskCollectionFilter +{-# INLINE modelsTaskCollectionFilterL #-} + +-- | 'modelsTaskCollectionFilterIncludeNulls' Lens +modelsTaskCollectionFilterIncludeNullsL :: Lens_' ModelsTaskCollection (Maybe Bool) +modelsTaskCollectionFilterIncludeNullsL f ModelsTaskCollection{..} = (\modelsTaskCollectionFilterIncludeNulls -> ModelsTaskCollection { modelsTaskCollectionFilterIncludeNulls, ..} ) <$> f modelsTaskCollectionFilterIncludeNulls +{-# INLINE modelsTaskCollectionFilterIncludeNullsL #-} + +-- | 'modelsTaskCollectionOrderBy' Lens +modelsTaskCollectionOrderByL :: Lens_' ModelsTaskCollection (Maybe [Text]) +modelsTaskCollectionOrderByL f ModelsTaskCollection{..} = (\modelsTaskCollectionOrderBy -> ModelsTaskCollection { modelsTaskCollectionOrderBy, ..} ) <$> f modelsTaskCollectionOrderBy +{-# INLINE modelsTaskCollectionOrderByL #-} + +-- | 'modelsTaskCollectionSortBy' Lens +modelsTaskCollectionSortByL :: Lens_' ModelsTaskCollection (Maybe [Text]) +modelsTaskCollectionSortByL f ModelsTaskCollection{..} = (\modelsTaskCollectionSortBy -> ModelsTaskCollection { modelsTaskCollectionSortBy, ..} ) <$> f modelsTaskCollectionSortBy +{-# INLINE modelsTaskCollectionSortByL #-} + + + +-- * ModelsTaskComment + +-- | 'modelsTaskCommentAuthor' Lens +modelsTaskCommentAuthorL :: Lens_' ModelsTaskComment (Maybe UserUser) +modelsTaskCommentAuthorL f ModelsTaskComment{..} = (\modelsTaskCommentAuthor -> ModelsTaskComment { modelsTaskCommentAuthor, ..} ) <$> f modelsTaskCommentAuthor +{-# INLINE modelsTaskCommentAuthorL #-} + +-- | 'modelsTaskCommentComment' Lens +modelsTaskCommentCommentL :: Lens_' ModelsTaskComment (Maybe Text) +modelsTaskCommentCommentL f ModelsTaskComment{..} = (\modelsTaskCommentComment -> ModelsTaskComment { modelsTaskCommentComment, ..} ) <$> f modelsTaskCommentComment +{-# INLINE modelsTaskCommentCommentL #-} + +-- | 'modelsTaskCommentCreated' Lens +modelsTaskCommentCreatedL :: Lens_' ModelsTaskComment (Maybe Text) +modelsTaskCommentCreatedL f ModelsTaskComment{..} = (\modelsTaskCommentCreated -> ModelsTaskComment { modelsTaskCommentCreated, ..} ) <$> f modelsTaskCommentCreated +{-# INLINE modelsTaskCommentCreatedL #-} + +-- | 'modelsTaskCommentId' Lens +modelsTaskCommentIdL :: Lens_' ModelsTaskComment (Maybe Int) +modelsTaskCommentIdL f ModelsTaskComment{..} = (\modelsTaskCommentId -> ModelsTaskComment { modelsTaskCommentId, ..} ) <$> f modelsTaskCommentId +{-# INLINE modelsTaskCommentIdL #-} + +-- | 'modelsTaskCommentReactions' Lens +modelsTaskCommentReactionsL :: Lens_' ModelsTaskComment (Maybe (Map.Map String [UserUser])) +modelsTaskCommentReactionsL f ModelsTaskComment{..} = (\modelsTaskCommentReactions -> ModelsTaskComment { modelsTaskCommentReactions, ..} ) <$> f modelsTaskCommentReactions +{-# INLINE modelsTaskCommentReactionsL #-} + +-- | 'modelsTaskCommentUpdated' Lens +modelsTaskCommentUpdatedL :: Lens_' ModelsTaskComment (Maybe Text) +modelsTaskCommentUpdatedL f ModelsTaskComment{..} = (\modelsTaskCommentUpdated -> ModelsTaskComment { modelsTaskCommentUpdated, ..} ) <$> f modelsTaskCommentUpdated +{-# INLINE modelsTaskCommentUpdatedL #-} + + + +-- * ModelsTaskPosition + +-- | 'modelsTaskPositionPosition' Lens +modelsTaskPositionPositionL :: Lens_' ModelsTaskPosition (Maybe Double) +modelsTaskPositionPositionL f ModelsTaskPosition{..} = (\modelsTaskPositionPosition -> ModelsTaskPosition { modelsTaskPositionPosition, ..} ) <$> f modelsTaskPositionPosition +{-# INLINE modelsTaskPositionPositionL #-} + +-- | 'modelsTaskPositionProjectViewId' Lens +modelsTaskPositionProjectViewIdL :: Lens_' ModelsTaskPosition (Maybe Int) +modelsTaskPositionProjectViewIdL f ModelsTaskPosition{..} = (\modelsTaskPositionProjectViewId -> ModelsTaskPosition { modelsTaskPositionProjectViewId, ..} ) <$> f modelsTaskPositionProjectViewId +{-# INLINE modelsTaskPositionProjectViewIdL #-} + +-- | 'modelsTaskPositionTaskId' Lens +modelsTaskPositionTaskIdL :: Lens_' ModelsTaskPosition (Maybe Int) +modelsTaskPositionTaskIdL f ModelsTaskPosition{..} = (\modelsTaskPositionTaskId -> ModelsTaskPosition { modelsTaskPositionTaskId, ..} ) <$> f modelsTaskPositionTaskId +{-# INLINE modelsTaskPositionTaskIdL #-} + + + +-- * ModelsTaskRelation + +-- | 'modelsTaskRelationCreated' Lens +modelsTaskRelationCreatedL :: Lens_' ModelsTaskRelation (Maybe Text) +modelsTaskRelationCreatedL f ModelsTaskRelation{..} = (\modelsTaskRelationCreated -> ModelsTaskRelation { modelsTaskRelationCreated, ..} ) <$> f modelsTaskRelationCreated +{-# INLINE modelsTaskRelationCreatedL #-} + +-- | 'modelsTaskRelationCreatedBy' Lens +modelsTaskRelationCreatedByL :: Lens_' ModelsTaskRelation (Maybe ModelsTaskRelationCreatedBy) +modelsTaskRelationCreatedByL f ModelsTaskRelation{..} = (\modelsTaskRelationCreatedBy -> ModelsTaskRelation { modelsTaskRelationCreatedBy, ..} ) <$> f modelsTaskRelationCreatedBy +{-# INLINE modelsTaskRelationCreatedByL #-} + +-- | 'modelsTaskRelationOtherTaskId' Lens +modelsTaskRelationOtherTaskIdL :: Lens_' ModelsTaskRelation (Maybe Int) +modelsTaskRelationOtherTaskIdL f ModelsTaskRelation{..} = (\modelsTaskRelationOtherTaskId -> ModelsTaskRelation { modelsTaskRelationOtherTaskId, ..} ) <$> f modelsTaskRelationOtherTaskId +{-# INLINE modelsTaskRelationOtherTaskIdL #-} + +-- | 'modelsTaskRelationRelationKind' Lens +modelsTaskRelationRelationKindL :: Lens_' ModelsTaskRelation (Maybe ModelsRelationKind) +modelsTaskRelationRelationKindL f ModelsTaskRelation{..} = (\modelsTaskRelationRelationKind -> ModelsTaskRelation { modelsTaskRelationRelationKind, ..} ) <$> f modelsTaskRelationRelationKind +{-# INLINE modelsTaskRelationRelationKindL #-} + +-- | 'modelsTaskRelationTaskId' Lens +modelsTaskRelationTaskIdL :: Lens_' ModelsTaskRelation (Maybe Int) +modelsTaskRelationTaskIdL f ModelsTaskRelation{..} = (\modelsTaskRelationTaskId -> ModelsTaskRelation { modelsTaskRelationTaskId, ..} ) <$> f modelsTaskRelationTaskId +{-# INLINE modelsTaskRelationTaskIdL #-} + + + +-- * ModelsTaskRelationCreatedBy + +-- | 'modelsTaskRelationCreatedByCreated' Lens +modelsTaskRelationCreatedByCreatedL :: Lens_' ModelsTaskRelationCreatedBy (Maybe Text) +modelsTaskRelationCreatedByCreatedL f ModelsTaskRelationCreatedBy{..} = (\modelsTaskRelationCreatedByCreated -> ModelsTaskRelationCreatedBy { modelsTaskRelationCreatedByCreated, ..} ) <$> f modelsTaskRelationCreatedByCreated +{-# INLINE modelsTaskRelationCreatedByCreatedL #-} + +-- | 'modelsTaskRelationCreatedByEmail' Lens +modelsTaskRelationCreatedByEmailL :: Lens_' ModelsTaskRelationCreatedBy (Maybe Text) +modelsTaskRelationCreatedByEmailL f ModelsTaskRelationCreatedBy{..} = (\modelsTaskRelationCreatedByEmail -> ModelsTaskRelationCreatedBy { modelsTaskRelationCreatedByEmail, ..} ) <$> f modelsTaskRelationCreatedByEmail +{-# INLINE modelsTaskRelationCreatedByEmailL #-} + +-- | 'modelsTaskRelationCreatedById' Lens +modelsTaskRelationCreatedByIdL :: Lens_' ModelsTaskRelationCreatedBy (Maybe Int) +modelsTaskRelationCreatedByIdL f ModelsTaskRelationCreatedBy{..} = (\modelsTaskRelationCreatedById -> ModelsTaskRelationCreatedBy { modelsTaskRelationCreatedById, ..} ) <$> f modelsTaskRelationCreatedById +{-# INLINE modelsTaskRelationCreatedByIdL #-} + +-- | 'modelsTaskRelationCreatedByName' Lens +modelsTaskRelationCreatedByNameL :: Lens_' ModelsTaskRelationCreatedBy (Maybe Text) +modelsTaskRelationCreatedByNameL f ModelsTaskRelationCreatedBy{..} = (\modelsTaskRelationCreatedByName -> ModelsTaskRelationCreatedBy { modelsTaskRelationCreatedByName, ..} ) <$> f modelsTaskRelationCreatedByName +{-# INLINE modelsTaskRelationCreatedByNameL #-} + +-- | 'modelsTaskRelationCreatedByUpdated' Lens +modelsTaskRelationCreatedByUpdatedL :: Lens_' ModelsTaskRelationCreatedBy (Maybe Text) +modelsTaskRelationCreatedByUpdatedL f ModelsTaskRelationCreatedBy{..} = (\modelsTaskRelationCreatedByUpdated -> ModelsTaskRelationCreatedBy { modelsTaskRelationCreatedByUpdated, ..} ) <$> f modelsTaskRelationCreatedByUpdated +{-# INLINE modelsTaskRelationCreatedByUpdatedL #-} + +-- | 'modelsTaskRelationCreatedByUsername' Lens +modelsTaskRelationCreatedByUsernameL :: Lens_' ModelsTaskRelationCreatedBy (Maybe Text) +modelsTaskRelationCreatedByUsernameL f ModelsTaskRelationCreatedBy{..} = (\modelsTaskRelationCreatedByUsername -> ModelsTaskRelationCreatedBy { modelsTaskRelationCreatedByUsername, ..} ) <$> f modelsTaskRelationCreatedByUsername +{-# INLINE modelsTaskRelationCreatedByUsernameL #-} + + + +-- * ModelsTaskReminder + +-- | 'modelsTaskReminderRelativePeriod' Lens +modelsTaskReminderRelativePeriodL :: Lens_' ModelsTaskReminder (Maybe Int) +modelsTaskReminderRelativePeriodL f ModelsTaskReminder{..} = (\modelsTaskReminderRelativePeriod -> ModelsTaskReminder { modelsTaskReminderRelativePeriod, ..} ) <$> f modelsTaskReminderRelativePeriod +{-# INLINE modelsTaskReminderRelativePeriodL #-} + +-- | 'modelsTaskReminderRelativeTo' Lens +modelsTaskReminderRelativeToL :: Lens_' ModelsTaskReminder (Maybe ModelsReminderRelation) +modelsTaskReminderRelativeToL f ModelsTaskReminder{..} = (\modelsTaskReminderRelativeTo -> ModelsTaskReminder { modelsTaskReminderRelativeTo, ..} ) <$> f modelsTaskReminderRelativeTo +{-# INLINE modelsTaskReminderRelativeToL #-} + +-- | 'modelsTaskReminderReminder' Lens +modelsTaskReminderReminderL :: Lens_' ModelsTaskReminder (Maybe Text) +modelsTaskReminderReminderL f ModelsTaskReminder{..} = (\modelsTaskReminderReminder -> ModelsTaskReminder { modelsTaskReminderReminder, ..} ) <$> f modelsTaskReminderReminder +{-# INLINE modelsTaskReminderReminderL #-} + + + +-- * ModelsTaskRepeatMode + + + +-- * ModelsTeam + +-- | 'modelsTeamCreated' Lens +modelsTeamCreatedL :: Lens_' ModelsTeam (Maybe Text) +modelsTeamCreatedL f ModelsTeam{..} = (\modelsTeamCreated -> ModelsTeam { modelsTeamCreated, ..} ) <$> f modelsTeamCreated +{-# INLINE modelsTeamCreatedL #-} + +-- | 'modelsTeamCreatedBy' Lens +modelsTeamCreatedByL :: Lens_' ModelsTeam (Maybe ModelsTeamCreatedBy) +modelsTeamCreatedByL f ModelsTeam{..} = (\modelsTeamCreatedBy -> ModelsTeam { modelsTeamCreatedBy, ..} ) <$> f modelsTeamCreatedBy +{-# INLINE modelsTeamCreatedByL #-} + +-- | 'modelsTeamDescription' Lens +modelsTeamDescriptionL :: Lens_' ModelsTeam (Maybe Text) +modelsTeamDescriptionL f ModelsTeam{..} = (\modelsTeamDescription -> ModelsTeam { modelsTeamDescription, ..} ) <$> f modelsTeamDescription +{-# INLINE modelsTeamDescriptionL #-} + +-- | 'modelsTeamId' Lens +modelsTeamIdL :: Lens_' ModelsTeam (Maybe Int) +modelsTeamIdL f ModelsTeam{..} = (\modelsTeamId -> ModelsTeam { modelsTeamId, ..} ) <$> f modelsTeamId +{-# INLINE modelsTeamIdL #-} + +-- | 'modelsTeamIncludePublic' Lens +modelsTeamIncludePublicL :: Lens_' ModelsTeam (Maybe Bool) +modelsTeamIncludePublicL f ModelsTeam{..} = (\modelsTeamIncludePublic -> ModelsTeam { modelsTeamIncludePublic, ..} ) <$> f modelsTeamIncludePublic +{-# INLINE modelsTeamIncludePublicL #-} + +-- | 'modelsTeamIsPublic' Lens +modelsTeamIsPublicL :: Lens_' ModelsTeam (Maybe Bool) +modelsTeamIsPublicL f ModelsTeam{..} = (\modelsTeamIsPublic -> ModelsTeam { modelsTeamIsPublic, ..} ) <$> f modelsTeamIsPublic +{-# INLINE modelsTeamIsPublicL #-} + +-- | 'modelsTeamMembers' Lens +modelsTeamMembersL :: Lens_' ModelsTeam (Maybe [ModelsTeamUser]) +modelsTeamMembersL f ModelsTeam{..} = (\modelsTeamMembers -> ModelsTeam { modelsTeamMembers, ..} ) <$> f modelsTeamMembers +{-# INLINE modelsTeamMembersL #-} + +-- | 'modelsTeamName' Lens +modelsTeamNameL :: Lens_' ModelsTeam (Maybe Text) +modelsTeamNameL f ModelsTeam{..} = (\modelsTeamName -> ModelsTeam { modelsTeamName, ..} ) <$> f modelsTeamName +{-# INLINE modelsTeamNameL #-} + +-- | 'modelsTeamOidcId' Lens +modelsTeamOidcIdL :: Lens_' ModelsTeam (Maybe Text) +modelsTeamOidcIdL f ModelsTeam{..} = (\modelsTeamOidcId -> ModelsTeam { modelsTeamOidcId, ..} ) <$> f modelsTeamOidcId +{-# INLINE modelsTeamOidcIdL #-} + +-- | 'modelsTeamUpdated' Lens +modelsTeamUpdatedL :: Lens_' ModelsTeam (Maybe Text) +modelsTeamUpdatedL f ModelsTeam{..} = (\modelsTeamUpdated -> ModelsTeam { modelsTeamUpdated, ..} ) <$> f modelsTeamUpdated +{-# INLINE modelsTeamUpdatedL #-} + + + +-- * ModelsTeamCreatedBy + +-- | 'modelsTeamCreatedByCreated' Lens +modelsTeamCreatedByCreatedL :: Lens_' ModelsTeamCreatedBy (Maybe Text) +modelsTeamCreatedByCreatedL f ModelsTeamCreatedBy{..} = (\modelsTeamCreatedByCreated -> ModelsTeamCreatedBy { modelsTeamCreatedByCreated, ..} ) <$> f modelsTeamCreatedByCreated +{-# INLINE modelsTeamCreatedByCreatedL #-} + +-- | 'modelsTeamCreatedByEmail' Lens +modelsTeamCreatedByEmailL :: Lens_' ModelsTeamCreatedBy (Maybe Text) +modelsTeamCreatedByEmailL f ModelsTeamCreatedBy{..} = (\modelsTeamCreatedByEmail -> ModelsTeamCreatedBy { modelsTeamCreatedByEmail, ..} ) <$> f modelsTeamCreatedByEmail +{-# INLINE modelsTeamCreatedByEmailL #-} + +-- | 'modelsTeamCreatedById' Lens +modelsTeamCreatedByIdL :: Lens_' ModelsTeamCreatedBy (Maybe Int) +modelsTeamCreatedByIdL f ModelsTeamCreatedBy{..} = (\modelsTeamCreatedById -> ModelsTeamCreatedBy { modelsTeamCreatedById, ..} ) <$> f modelsTeamCreatedById +{-# INLINE modelsTeamCreatedByIdL #-} + +-- | 'modelsTeamCreatedByName' Lens +modelsTeamCreatedByNameL :: Lens_' ModelsTeamCreatedBy (Maybe Text) +modelsTeamCreatedByNameL f ModelsTeamCreatedBy{..} = (\modelsTeamCreatedByName -> ModelsTeamCreatedBy { modelsTeamCreatedByName, ..} ) <$> f modelsTeamCreatedByName +{-# INLINE modelsTeamCreatedByNameL #-} + +-- | 'modelsTeamCreatedByUpdated' Lens +modelsTeamCreatedByUpdatedL :: Lens_' ModelsTeamCreatedBy (Maybe Text) +modelsTeamCreatedByUpdatedL f ModelsTeamCreatedBy{..} = (\modelsTeamCreatedByUpdated -> ModelsTeamCreatedBy { modelsTeamCreatedByUpdated, ..} ) <$> f modelsTeamCreatedByUpdated +{-# INLINE modelsTeamCreatedByUpdatedL #-} + +-- | 'modelsTeamCreatedByUsername' Lens +modelsTeamCreatedByUsernameL :: Lens_' ModelsTeamCreatedBy (Maybe Text) +modelsTeamCreatedByUsernameL f ModelsTeamCreatedBy{..} = (\modelsTeamCreatedByUsername -> ModelsTeamCreatedBy { modelsTeamCreatedByUsername, ..} ) <$> f modelsTeamCreatedByUsername +{-# INLINE modelsTeamCreatedByUsernameL #-} + + + +-- * ModelsTeamMember + +-- | 'modelsTeamMemberAdmin' Lens +modelsTeamMemberAdminL :: Lens_' ModelsTeamMember (Maybe Bool) +modelsTeamMemberAdminL f ModelsTeamMember{..} = (\modelsTeamMemberAdmin -> ModelsTeamMember { modelsTeamMemberAdmin, ..} ) <$> f modelsTeamMemberAdmin +{-# INLINE modelsTeamMemberAdminL #-} + +-- | 'modelsTeamMemberCreated' Lens +modelsTeamMemberCreatedL :: Lens_' ModelsTeamMember (Maybe Text) +modelsTeamMemberCreatedL f ModelsTeamMember{..} = (\modelsTeamMemberCreated -> ModelsTeamMember { modelsTeamMemberCreated, ..} ) <$> f modelsTeamMemberCreated +{-# INLINE modelsTeamMemberCreatedL #-} + +-- | 'modelsTeamMemberId' Lens +modelsTeamMemberIdL :: Lens_' ModelsTeamMember (Maybe Int) +modelsTeamMemberIdL f ModelsTeamMember{..} = (\modelsTeamMemberId -> ModelsTeamMember { modelsTeamMemberId, ..} ) <$> f modelsTeamMemberId +{-# INLINE modelsTeamMemberIdL #-} + +-- | 'modelsTeamMemberUsername' Lens +modelsTeamMemberUsernameL :: Lens_' ModelsTeamMember (Maybe Text) +modelsTeamMemberUsernameL f ModelsTeamMember{..} = (\modelsTeamMemberUsername -> ModelsTeamMember { modelsTeamMemberUsername, ..} ) <$> f modelsTeamMemberUsername +{-# INLINE modelsTeamMemberUsernameL #-} + + + +-- * ModelsTeamProject + +-- | 'modelsTeamProjectCreated' Lens +modelsTeamProjectCreatedL :: Lens_' ModelsTeamProject (Maybe Text) +modelsTeamProjectCreatedL f ModelsTeamProject{..} = (\modelsTeamProjectCreated -> ModelsTeamProject { modelsTeamProjectCreated, ..} ) <$> f modelsTeamProjectCreated +{-# INLINE modelsTeamProjectCreatedL #-} + +-- | 'modelsTeamProjectId' Lens +modelsTeamProjectIdL :: Lens_' ModelsTeamProject (Maybe Int) +modelsTeamProjectIdL f ModelsTeamProject{..} = (\modelsTeamProjectId -> ModelsTeamProject { modelsTeamProjectId, ..} ) <$> f modelsTeamProjectId +{-# INLINE modelsTeamProjectIdL #-} + +-- | 'modelsTeamProjectRight' Lens +modelsTeamProjectRightL :: Lens_' ModelsTeamProject (Maybe ModelsRight) +modelsTeamProjectRightL f ModelsTeamProject{..} = (\modelsTeamProjectRight -> ModelsTeamProject { modelsTeamProjectRight, ..} ) <$> f modelsTeamProjectRight +{-# INLINE modelsTeamProjectRightL #-} + +-- | 'modelsTeamProjectTeamId' Lens +modelsTeamProjectTeamIdL :: Lens_' ModelsTeamProject (Maybe Int) +modelsTeamProjectTeamIdL f ModelsTeamProject{..} = (\modelsTeamProjectTeamId -> ModelsTeamProject { modelsTeamProjectTeamId, ..} ) <$> f modelsTeamProjectTeamId +{-# INLINE modelsTeamProjectTeamIdL #-} + +-- | 'modelsTeamProjectUpdated' Lens +modelsTeamProjectUpdatedL :: Lens_' ModelsTeamProject (Maybe Text) +modelsTeamProjectUpdatedL f ModelsTeamProject{..} = (\modelsTeamProjectUpdated -> ModelsTeamProject { modelsTeamProjectUpdated, ..} ) <$> f modelsTeamProjectUpdated +{-# INLINE modelsTeamProjectUpdatedL #-} + + + +-- * ModelsTeamUser + +-- | 'modelsTeamUserAdmin' Lens +modelsTeamUserAdminL :: Lens_' ModelsTeamUser (Maybe Bool) +modelsTeamUserAdminL f ModelsTeamUser{..} = (\modelsTeamUserAdmin -> ModelsTeamUser { modelsTeamUserAdmin, ..} ) <$> f modelsTeamUserAdmin +{-# INLINE modelsTeamUserAdminL #-} + +-- | 'modelsTeamUserCreated' Lens +modelsTeamUserCreatedL :: Lens_' ModelsTeamUser (Maybe Text) +modelsTeamUserCreatedL f ModelsTeamUser{..} = (\modelsTeamUserCreated -> ModelsTeamUser { modelsTeamUserCreated, ..} ) <$> f modelsTeamUserCreated +{-# INLINE modelsTeamUserCreatedL #-} + +-- | 'modelsTeamUserEmail' Lens +modelsTeamUserEmailL :: Lens_' ModelsTeamUser (Maybe Text) +modelsTeamUserEmailL f ModelsTeamUser{..} = (\modelsTeamUserEmail -> ModelsTeamUser { modelsTeamUserEmail, ..} ) <$> f modelsTeamUserEmail +{-# INLINE modelsTeamUserEmailL #-} + +-- | 'modelsTeamUserId' Lens +modelsTeamUserIdL :: Lens_' ModelsTeamUser (Maybe Int) +modelsTeamUserIdL f ModelsTeamUser{..} = (\modelsTeamUserId -> ModelsTeamUser { modelsTeamUserId, ..} ) <$> f modelsTeamUserId +{-# INLINE modelsTeamUserIdL #-} + +-- | 'modelsTeamUserName' Lens +modelsTeamUserNameL :: Lens_' ModelsTeamUser (Maybe Text) +modelsTeamUserNameL f ModelsTeamUser{..} = (\modelsTeamUserName -> ModelsTeamUser { modelsTeamUserName, ..} ) <$> f modelsTeamUserName +{-# INLINE modelsTeamUserNameL #-} + +-- | 'modelsTeamUserUpdated' Lens +modelsTeamUserUpdatedL :: Lens_' ModelsTeamUser (Maybe Text) +modelsTeamUserUpdatedL f ModelsTeamUser{..} = (\modelsTeamUserUpdated -> ModelsTeamUser { modelsTeamUserUpdated, ..} ) <$> f modelsTeamUserUpdated +{-# INLINE modelsTeamUserUpdatedL #-} + +-- | 'modelsTeamUserUsername' Lens +modelsTeamUserUsernameL :: Lens_' ModelsTeamUser (Maybe Text) +modelsTeamUserUsernameL f ModelsTeamUser{..} = (\modelsTeamUserUsername -> ModelsTeamUser { modelsTeamUserUsername, ..} ) <$> f modelsTeamUserUsername +{-# INLINE modelsTeamUserUsernameL #-} + + + +-- * ModelsTeamWithRight + +-- | 'modelsTeamWithRightCreated' Lens +modelsTeamWithRightCreatedL :: Lens_' ModelsTeamWithRight (Maybe Text) +modelsTeamWithRightCreatedL f ModelsTeamWithRight{..} = (\modelsTeamWithRightCreated -> ModelsTeamWithRight { modelsTeamWithRightCreated, ..} ) <$> f modelsTeamWithRightCreated +{-# INLINE modelsTeamWithRightCreatedL #-} + +-- | 'modelsTeamWithRightCreatedBy' Lens +modelsTeamWithRightCreatedByL :: Lens_' ModelsTeamWithRight (Maybe ModelsTeamCreatedBy) +modelsTeamWithRightCreatedByL f ModelsTeamWithRight{..} = (\modelsTeamWithRightCreatedBy -> ModelsTeamWithRight { modelsTeamWithRightCreatedBy, ..} ) <$> f modelsTeamWithRightCreatedBy +{-# INLINE modelsTeamWithRightCreatedByL #-} + +-- | 'modelsTeamWithRightDescription' Lens +modelsTeamWithRightDescriptionL :: Lens_' ModelsTeamWithRight (Maybe Text) +modelsTeamWithRightDescriptionL f ModelsTeamWithRight{..} = (\modelsTeamWithRightDescription -> ModelsTeamWithRight { modelsTeamWithRightDescription, ..} ) <$> f modelsTeamWithRightDescription +{-# INLINE modelsTeamWithRightDescriptionL #-} + +-- | 'modelsTeamWithRightId' Lens +modelsTeamWithRightIdL :: Lens_' ModelsTeamWithRight (Maybe Int) +modelsTeamWithRightIdL f ModelsTeamWithRight{..} = (\modelsTeamWithRightId -> ModelsTeamWithRight { modelsTeamWithRightId, ..} ) <$> f modelsTeamWithRightId +{-# INLINE modelsTeamWithRightIdL #-} + +-- | 'modelsTeamWithRightIncludePublic' Lens +modelsTeamWithRightIncludePublicL :: Lens_' ModelsTeamWithRight (Maybe Bool) +modelsTeamWithRightIncludePublicL f ModelsTeamWithRight{..} = (\modelsTeamWithRightIncludePublic -> ModelsTeamWithRight { modelsTeamWithRightIncludePublic, ..} ) <$> f modelsTeamWithRightIncludePublic +{-# INLINE modelsTeamWithRightIncludePublicL #-} + +-- | 'modelsTeamWithRightIsPublic' Lens +modelsTeamWithRightIsPublicL :: Lens_' ModelsTeamWithRight (Maybe Bool) +modelsTeamWithRightIsPublicL f ModelsTeamWithRight{..} = (\modelsTeamWithRightIsPublic -> ModelsTeamWithRight { modelsTeamWithRightIsPublic, ..} ) <$> f modelsTeamWithRightIsPublic +{-# INLINE modelsTeamWithRightIsPublicL #-} + +-- | 'modelsTeamWithRightMembers' Lens +modelsTeamWithRightMembersL :: Lens_' ModelsTeamWithRight (Maybe [ModelsTeamUser]) +modelsTeamWithRightMembersL f ModelsTeamWithRight{..} = (\modelsTeamWithRightMembers -> ModelsTeamWithRight { modelsTeamWithRightMembers, ..} ) <$> f modelsTeamWithRightMembers +{-# INLINE modelsTeamWithRightMembersL #-} + +-- | 'modelsTeamWithRightName' Lens +modelsTeamWithRightNameL :: Lens_' ModelsTeamWithRight (Maybe Text) +modelsTeamWithRightNameL f ModelsTeamWithRight{..} = (\modelsTeamWithRightName -> ModelsTeamWithRight { modelsTeamWithRightName, ..} ) <$> f modelsTeamWithRightName +{-# INLINE modelsTeamWithRightNameL #-} + +-- | 'modelsTeamWithRightOidcId' Lens +modelsTeamWithRightOidcIdL :: Lens_' ModelsTeamWithRight (Maybe Text) +modelsTeamWithRightOidcIdL f ModelsTeamWithRight{..} = (\modelsTeamWithRightOidcId -> ModelsTeamWithRight { modelsTeamWithRightOidcId, ..} ) <$> f modelsTeamWithRightOidcId +{-# INLINE modelsTeamWithRightOidcIdL #-} + +-- | 'modelsTeamWithRightRight' Lens +modelsTeamWithRightRightL :: Lens_' ModelsTeamWithRight (Maybe ModelsRight) +modelsTeamWithRightRightL f ModelsTeamWithRight{..} = (\modelsTeamWithRightRight -> ModelsTeamWithRight { modelsTeamWithRightRight, ..} ) <$> f modelsTeamWithRightRight +{-# INLINE modelsTeamWithRightRightL #-} + +-- | 'modelsTeamWithRightUpdated' Lens +modelsTeamWithRightUpdatedL :: Lens_' ModelsTeamWithRight (Maybe Text) +modelsTeamWithRightUpdatedL f ModelsTeamWithRight{..} = (\modelsTeamWithRightUpdated -> ModelsTeamWithRight { modelsTeamWithRightUpdated, ..} ) <$> f modelsTeamWithRightUpdated +{-# INLINE modelsTeamWithRightUpdatedL #-} + + + +-- * ModelsUserWithRight + +-- | 'modelsUserWithRightCreated' Lens +modelsUserWithRightCreatedL :: Lens_' ModelsUserWithRight (Maybe Text) +modelsUserWithRightCreatedL f ModelsUserWithRight{..} = (\modelsUserWithRightCreated -> ModelsUserWithRight { modelsUserWithRightCreated, ..} ) <$> f modelsUserWithRightCreated +{-# INLINE modelsUserWithRightCreatedL #-} + +-- | 'modelsUserWithRightEmail' Lens +modelsUserWithRightEmailL :: Lens_' ModelsUserWithRight (Maybe Text) +modelsUserWithRightEmailL f ModelsUserWithRight{..} = (\modelsUserWithRightEmail -> ModelsUserWithRight { modelsUserWithRightEmail, ..} ) <$> f modelsUserWithRightEmail +{-# INLINE modelsUserWithRightEmailL #-} + +-- | 'modelsUserWithRightId' Lens +modelsUserWithRightIdL :: Lens_' ModelsUserWithRight (Maybe Int) +modelsUserWithRightIdL f ModelsUserWithRight{..} = (\modelsUserWithRightId -> ModelsUserWithRight { modelsUserWithRightId, ..} ) <$> f modelsUserWithRightId +{-# INLINE modelsUserWithRightIdL #-} + +-- | 'modelsUserWithRightName' Lens +modelsUserWithRightNameL :: Lens_' ModelsUserWithRight (Maybe Text) +modelsUserWithRightNameL f ModelsUserWithRight{..} = (\modelsUserWithRightName -> ModelsUserWithRight { modelsUserWithRightName, ..} ) <$> f modelsUserWithRightName +{-# INLINE modelsUserWithRightNameL #-} + +-- | 'modelsUserWithRightRight' Lens +modelsUserWithRightRightL :: Lens_' ModelsUserWithRight (Maybe ModelsRight) +modelsUserWithRightRightL f ModelsUserWithRight{..} = (\modelsUserWithRightRight -> ModelsUserWithRight { modelsUserWithRightRight, ..} ) <$> f modelsUserWithRightRight +{-# INLINE modelsUserWithRightRightL #-} + +-- | 'modelsUserWithRightUpdated' Lens +modelsUserWithRightUpdatedL :: Lens_' ModelsUserWithRight (Maybe Text) +modelsUserWithRightUpdatedL f ModelsUserWithRight{..} = (\modelsUserWithRightUpdated -> ModelsUserWithRight { modelsUserWithRightUpdated, ..} ) <$> f modelsUserWithRightUpdated +{-# INLINE modelsUserWithRightUpdatedL #-} + +-- | 'modelsUserWithRightUsername' Lens +modelsUserWithRightUsernameL :: Lens_' ModelsUserWithRight (Maybe Text) +modelsUserWithRightUsernameL f ModelsUserWithRight{..} = (\modelsUserWithRightUsername -> ModelsUserWithRight { modelsUserWithRightUsername, ..} ) <$> f modelsUserWithRightUsername +{-# INLINE modelsUserWithRightUsernameL #-} + + + +-- * ModelsWebhook + +-- | 'modelsWebhookCreated' Lens +modelsWebhookCreatedL :: Lens_' ModelsWebhook (Maybe Text) +modelsWebhookCreatedL f ModelsWebhook{..} = (\modelsWebhookCreated -> ModelsWebhook { modelsWebhookCreated, ..} ) <$> f modelsWebhookCreated +{-# INLINE modelsWebhookCreatedL #-} + +-- | 'modelsWebhookCreatedBy' Lens +modelsWebhookCreatedByL :: Lens_' ModelsWebhook (Maybe ModelsWebhookCreatedBy) +modelsWebhookCreatedByL f ModelsWebhook{..} = (\modelsWebhookCreatedBy -> ModelsWebhook { modelsWebhookCreatedBy, ..} ) <$> f modelsWebhookCreatedBy +{-# INLINE modelsWebhookCreatedByL #-} + +-- | 'modelsWebhookEvents' Lens +modelsWebhookEventsL :: Lens_' ModelsWebhook (Maybe [Text]) +modelsWebhookEventsL f ModelsWebhook{..} = (\modelsWebhookEvents -> ModelsWebhook { modelsWebhookEvents, ..} ) <$> f modelsWebhookEvents +{-# INLINE modelsWebhookEventsL #-} + +-- | 'modelsWebhookId' Lens +modelsWebhookIdL :: Lens_' ModelsWebhook (Maybe Int) +modelsWebhookIdL f ModelsWebhook{..} = (\modelsWebhookId -> ModelsWebhook { modelsWebhookId, ..} ) <$> f modelsWebhookId +{-# INLINE modelsWebhookIdL #-} + +-- | 'modelsWebhookProjectId' Lens +modelsWebhookProjectIdL :: Lens_' ModelsWebhook (Maybe Int) +modelsWebhookProjectIdL f ModelsWebhook{..} = (\modelsWebhookProjectId -> ModelsWebhook { modelsWebhookProjectId, ..} ) <$> f modelsWebhookProjectId +{-# INLINE modelsWebhookProjectIdL #-} + +-- | 'modelsWebhookSecret' Lens +modelsWebhookSecretL :: Lens_' ModelsWebhook (Maybe Text) +modelsWebhookSecretL f ModelsWebhook{..} = (\modelsWebhookSecret -> ModelsWebhook { modelsWebhookSecret, ..} ) <$> f modelsWebhookSecret +{-# INLINE modelsWebhookSecretL #-} + +-- | 'modelsWebhookTargetUrl' Lens +modelsWebhookTargetUrlL :: Lens_' ModelsWebhook (Maybe Text) +modelsWebhookTargetUrlL f ModelsWebhook{..} = (\modelsWebhookTargetUrl -> ModelsWebhook { modelsWebhookTargetUrl, ..} ) <$> f modelsWebhookTargetUrl +{-# INLINE modelsWebhookTargetUrlL #-} + +-- | 'modelsWebhookUpdated' Lens +modelsWebhookUpdatedL :: Lens_' ModelsWebhook (Maybe Text) +modelsWebhookUpdatedL f ModelsWebhook{..} = (\modelsWebhookUpdated -> ModelsWebhook { modelsWebhookUpdated, ..} ) <$> f modelsWebhookUpdated +{-# INLINE modelsWebhookUpdatedL #-} + + + +-- * ModelsWebhookCreatedBy + +-- | 'modelsWebhookCreatedByCreated' Lens +modelsWebhookCreatedByCreatedL :: Lens_' ModelsWebhookCreatedBy (Maybe Text) +modelsWebhookCreatedByCreatedL f ModelsWebhookCreatedBy{..} = (\modelsWebhookCreatedByCreated -> ModelsWebhookCreatedBy { modelsWebhookCreatedByCreated, ..} ) <$> f modelsWebhookCreatedByCreated +{-# INLINE modelsWebhookCreatedByCreatedL #-} + +-- | 'modelsWebhookCreatedByEmail' Lens +modelsWebhookCreatedByEmailL :: Lens_' ModelsWebhookCreatedBy (Maybe Text) +modelsWebhookCreatedByEmailL f ModelsWebhookCreatedBy{..} = (\modelsWebhookCreatedByEmail -> ModelsWebhookCreatedBy { modelsWebhookCreatedByEmail, ..} ) <$> f modelsWebhookCreatedByEmail +{-# INLINE modelsWebhookCreatedByEmailL #-} + +-- | 'modelsWebhookCreatedById' Lens +modelsWebhookCreatedByIdL :: Lens_' ModelsWebhookCreatedBy (Maybe Int) +modelsWebhookCreatedByIdL f ModelsWebhookCreatedBy{..} = (\modelsWebhookCreatedById -> ModelsWebhookCreatedBy { modelsWebhookCreatedById, ..} ) <$> f modelsWebhookCreatedById +{-# INLINE modelsWebhookCreatedByIdL #-} + +-- | 'modelsWebhookCreatedByName' Lens +modelsWebhookCreatedByNameL :: Lens_' ModelsWebhookCreatedBy (Maybe Text) +modelsWebhookCreatedByNameL f ModelsWebhookCreatedBy{..} = (\modelsWebhookCreatedByName -> ModelsWebhookCreatedBy { modelsWebhookCreatedByName, ..} ) <$> f modelsWebhookCreatedByName +{-# INLINE modelsWebhookCreatedByNameL #-} + +-- | 'modelsWebhookCreatedByUpdated' Lens +modelsWebhookCreatedByUpdatedL :: Lens_' ModelsWebhookCreatedBy (Maybe Text) +modelsWebhookCreatedByUpdatedL f ModelsWebhookCreatedBy{..} = (\modelsWebhookCreatedByUpdated -> ModelsWebhookCreatedBy { modelsWebhookCreatedByUpdated, ..} ) <$> f modelsWebhookCreatedByUpdated +{-# INLINE modelsWebhookCreatedByUpdatedL #-} + +-- | 'modelsWebhookCreatedByUsername' Lens +modelsWebhookCreatedByUsernameL :: Lens_' ModelsWebhookCreatedBy (Maybe Text) +modelsWebhookCreatedByUsernameL f ModelsWebhookCreatedBy{..} = (\modelsWebhookCreatedByUsername -> ModelsWebhookCreatedBy { modelsWebhookCreatedByUsername, ..} ) <$> f modelsWebhookCreatedByUsername +{-# INLINE modelsWebhookCreatedByUsernameL #-} + + + +-- * NotificationsDatabaseNotification + +-- | 'notificationsDatabaseNotificationCreated' Lens +notificationsDatabaseNotificationCreatedL :: Lens_' NotificationsDatabaseNotification (Maybe Text) +notificationsDatabaseNotificationCreatedL f NotificationsDatabaseNotification{..} = (\notificationsDatabaseNotificationCreated -> NotificationsDatabaseNotification { notificationsDatabaseNotificationCreated, ..} ) <$> f notificationsDatabaseNotificationCreated +{-# INLINE notificationsDatabaseNotificationCreatedL #-} + +-- | 'notificationsDatabaseNotificationId' Lens +notificationsDatabaseNotificationIdL :: Lens_' NotificationsDatabaseNotification (Maybe Int) +notificationsDatabaseNotificationIdL f NotificationsDatabaseNotification{..} = (\notificationsDatabaseNotificationId -> NotificationsDatabaseNotification { notificationsDatabaseNotificationId, ..} ) <$> f notificationsDatabaseNotificationId +{-# INLINE notificationsDatabaseNotificationIdL #-} + +-- | 'notificationsDatabaseNotificationName' Lens +notificationsDatabaseNotificationNameL :: Lens_' NotificationsDatabaseNotification (Maybe Text) +notificationsDatabaseNotificationNameL f NotificationsDatabaseNotification{..} = (\notificationsDatabaseNotificationName -> NotificationsDatabaseNotification { notificationsDatabaseNotificationName, ..} ) <$> f notificationsDatabaseNotificationName +{-# INLINE notificationsDatabaseNotificationNameL #-} + +-- | 'notificationsDatabaseNotificationNotification' Lens +notificationsDatabaseNotificationNotificationL :: Lens_' NotificationsDatabaseNotification (Maybe A.Value) +notificationsDatabaseNotificationNotificationL f NotificationsDatabaseNotification{..} = (\notificationsDatabaseNotificationNotification -> NotificationsDatabaseNotification { notificationsDatabaseNotificationNotification, ..} ) <$> f notificationsDatabaseNotificationNotification +{-# INLINE notificationsDatabaseNotificationNotificationL #-} + +-- | 'notificationsDatabaseNotificationReadAt' Lens +notificationsDatabaseNotificationReadAtL :: Lens_' NotificationsDatabaseNotification (Maybe Text) +notificationsDatabaseNotificationReadAtL f NotificationsDatabaseNotification{..} = (\notificationsDatabaseNotificationReadAt -> NotificationsDatabaseNotification { notificationsDatabaseNotificationReadAt, ..} ) <$> f notificationsDatabaseNotificationReadAt +{-# INLINE notificationsDatabaseNotificationReadAtL #-} + + + +-- * OpenidCallback + +-- | 'openidCallbackCode' Lens +openidCallbackCodeL :: Lens_' OpenidCallback (Maybe Text) +openidCallbackCodeL f OpenidCallback{..} = (\openidCallbackCode -> OpenidCallback { openidCallbackCode, ..} ) <$> f openidCallbackCode +{-# INLINE openidCallbackCodeL #-} + +-- | 'openidCallbackRedirectUrl' Lens +openidCallbackRedirectUrlL :: Lens_' OpenidCallback (Maybe Text) +openidCallbackRedirectUrlL f OpenidCallback{..} = (\openidCallbackRedirectUrl -> OpenidCallback { openidCallbackRedirectUrl, ..} ) <$> f openidCallbackRedirectUrl +{-# INLINE openidCallbackRedirectUrlL #-} + +-- | 'openidCallbackScope' Lens +openidCallbackScopeL :: Lens_' OpenidCallback (Maybe Text) +openidCallbackScopeL f OpenidCallback{..} = (\openidCallbackScope -> OpenidCallback { openidCallbackScope, ..} ) <$> f openidCallbackScope +{-# INLINE openidCallbackScopeL #-} + + + +-- * OpenidProvider + +-- | 'openidProviderAuthUrl' Lens +openidProviderAuthUrlL :: Lens_' OpenidProvider (Maybe Text) +openidProviderAuthUrlL f OpenidProvider{..} = (\openidProviderAuthUrl -> OpenidProvider { openidProviderAuthUrl, ..} ) <$> f openidProviderAuthUrl +{-# INLINE openidProviderAuthUrlL #-} + +-- | 'openidProviderClientId' Lens +openidProviderClientIdL :: Lens_' OpenidProvider (Maybe Text) +openidProviderClientIdL f OpenidProvider{..} = (\openidProviderClientId -> OpenidProvider { openidProviderClientId, ..} ) <$> f openidProviderClientId +{-# INLINE openidProviderClientIdL #-} + +-- | 'openidProviderKey' Lens +openidProviderKeyL :: Lens_' OpenidProvider (Maybe Text) +openidProviderKeyL f OpenidProvider{..} = (\openidProviderKey -> OpenidProvider { openidProviderKey, ..} ) <$> f openidProviderKey +{-# INLINE openidProviderKeyL #-} + +-- | 'openidProviderLogoutUrl' Lens +openidProviderLogoutUrlL :: Lens_' OpenidProvider (Maybe Text) +openidProviderLogoutUrlL f OpenidProvider{..} = (\openidProviderLogoutUrl -> OpenidProvider { openidProviderLogoutUrl, ..} ) <$> f openidProviderLogoutUrl +{-# INLINE openidProviderLogoutUrlL #-} + +-- | 'openidProviderName' Lens +openidProviderNameL :: Lens_' OpenidProvider (Maybe Text) +openidProviderNameL f OpenidProvider{..} = (\openidProviderName -> OpenidProvider { openidProviderName, ..} ) <$> f openidProviderName +{-# INLINE openidProviderNameL #-} + +-- | 'openidProviderScope' Lens +openidProviderScopeL :: Lens_' OpenidProvider (Maybe Text) +openidProviderScopeL f OpenidProvider{..} = (\openidProviderScope -> OpenidProvider { openidProviderScope, ..} ) <$> f openidProviderScope +{-# INLINE openidProviderScopeL #-} + + + +-- * TodoistMigration + +-- | 'todoistMigrationCode' Lens +todoistMigrationCodeL :: Lens_' TodoistMigration (Maybe Text) +todoistMigrationCodeL f TodoistMigration{..} = (\todoistMigrationCode -> TodoistMigration { todoistMigrationCode, ..} ) <$> f todoistMigrationCode +{-# INLINE todoistMigrationCodeL #-} + + + +-- * TrelloMigration + +-- | 'trelloMigrationCode' Lens +trelloMigrationCodeL :: Lens_' TrelloMigration (Maybe Text) +trelloMigrationCodeL f TrelloMigration{..} = (\trelloMigrationCode -> TrelloMigration { trelloMigrationCode, ..} ) <$> f trelloMigrationCode +{-# INLINE trelloMigrationCodeL #-} + + + +-- * UserAPIUserPassword + +-- | 'userAPIUserPasswordEmail' Lens +userAPIUserPasswordEmailL :: Lens_' UserAPIUserPassword (Maybe Text) +userAPIUserPasswordEmailL f UserAPIUserPassword{..} = (\userAPIUserPasswordEmail -> UserAPIUserPassword { userAPIUserPasswordEmail, ..} ) <$> f userAPIUserPasswordEmail +{-# INLINE userAPIUserPasswordEmailL #-} + +-- | 'userAPIUserPasswordId' Lens +userAPIUserPasswordIdL :: Lens_' UserAPIUserPassword (Maybe Int) +userAPIUserPasswordIdL f UserAPIUserPassword{..} = (\userAPIUserPasswordId -> UserAPIUserPassword { userAPIUserPasswordId, ..} ) <$> f userAPIUserPasswordId +{-# INLINE userAPIUserPasswordIdL #-} + +-- | 'userAPIUserPasswordPassword' Lens +userAPIUserPasswordPasswordL :: Lens_' UserAPIUserPassword (Maybe Text) +userAPIUserPasswordPasswordL f UserAPIUserPassword{..} = (\userAPIUserPasswordPassword -> UserAPIUserPassword { userAPIUserPasswordPassword, ..} ) <$> f userAPIUserPasswordPassword +{-# INLINE userAPIUserPasswordPasswordL #-} + +-- | 'userAPIUserPasswordUsername' Lens +userAPIUserPasswordUsernameL :: Lens_' UserAPIUserPassword (Maybe Text) +userAPIUserPasswordUsernameL f UserAPIUserPassword{..} = (\userAPIUserPasswordUsername -> UserAPIUserPassword { userAPIUserPasswordUsername, ..} ) <$> f userAPIUserPasswordUsername +{-# INLINE userAPIUserPasswordUsernameL #-} + + + +-- * UserEmailConfirm + +-- | 'userEmailConfirmToken' Lens +userEmailConfirmTokenL :: Lens_' UserEmailConfirm (Maybe Text) +userEmailConfirmTokenL f UserEmailConfirm{..} = (\userEmailConfirmToken -> UserEmailConfirm { userEmailConfirmToken, ..} ) <$> f userEmailConfirmToken +{-# INLINE userEmailConfirmTokenL #-} + + + +-- * UserEmailUpdate + +-- | 'userEmailUpdateNewEmail' Lens +userEmailUpdateNewEmailL :: Lens_' UserEmailUpdate (Maybe Text) +userEmailUpdateNewEmailL f UserEmailUpdate{..} = (\userEmailUpdateNewEmail -> UserEmailUpdate { userEmailUpdateNewEmail, ..} ) <$> f userEmailUpdateNewEmail +{-# INLINE userEmailUpdateNewEmailL #-} + +-- | 'userEmailUpdatePassword' Lens +userEmailUpdatePasswordL :: Lens_' UserEmailUpdate (Maybe Text) +userEmailUpdatePasswordL f UserEmailUpdate{..} = (\userEmailUpdatePassword -> UserEmailUpdate { userEmailUpdatePassword, ..} ) <$> f userEmailUpdatePassword +{-# INLINE userEmailUpdatePasswordL #-} + + + +-- * UserLogin + +-- | 'userLoginLongToken' Lens +userLoginLongTokenL :: Lens_' UserLogin (Maybe Bool) +userLoginLongTokenL f UserLogin{..} = (\userLoginLongToken -> UserLogin { userLoginLongToken, ..} ) <$> f userLoginLongToken +{-# INLINE userLoginLongTokenL #-} + +-- | 'userLoginPassword' Lens +userLoginPasswordL :: Lens_' UserLogin (Maybe Text) +userLoginPasswordL f UserLogin{..} = (\userLoginPassword -> UserLogin { userLoginPassword, ..} ) <$> f userLoginPassword +{-# INLINE userLoginPasswordL #-} + +-- | 'userLoginTotpPasscode' Lens +userLoginTotpPasscodeL :: Lens_' UserLogin (Maybe Text) +userLoginTotpPasscodeL f UserLogin{..} = (\userLoginTotpPasscode -> UserLogin { userLoginTotpPasscode, ..} ) <$> f userLoginTotpPasscode +{-# INLINE userLoginTotpPasscodeL #-} + +-- | 'userLoginUsername' Lens +userLoginUsernameL :: Lens_' UserLogin (Maybe Text) +userLoginUsernameL f UserLogin{..} = (\userLoginUsername -> UserLogin { userLoginUsername, ..} ) <$> f userLoginUsername +{-# INLINE userLoginUsernameL #-} + + + +-- * UserPasswordReset + +-- | 'userPasswordResetNewPassword' Lens +userPasswordResetNewPasswordL :: Lens_' UserPasswordReset (Maybe Text) +userPasswordResetNewPasswordL f UserPasswordReset{..} = (\userPasswordResetNewPassword -> UserPasswordReset { userPasswordResetNewPassword, ..} ) <$> f userPasswordResetNewPassword +{-# INLINE userPasswordResetNewPasswordL #-} + +-- | 'userPasswordResetToken' Lens +userPasswordResetTokenL :: Lens_' UserPasswordReset (Maybe Text) +userPasswordResetTokenL f UserPasswordReset{..} = (\userPasswordResetToken -> UserPasswordReset { userPasswordResetToken, ..} ) <$> f userPasswordResetToken +{-# INLINE userPasswordResetTokenL #-} + + + +-- * UserPasswordTokenRequest + +-- | 'userPasswordTokenRequestEmail' Lens +userPasswordTokenRequestEmailL :: Lens_' UserPasswordTokenRequest (Maybe Text) +userPasswordTokenRequestEmailL f UserPasswordTokenRequest{..} = (\userPasswordTokenRequestEmail -> UserPasswordTokenRequest { userPasswordTokenRequestEmail, ..} ) <$> f userPasswordTokenRequestEmail +{-# INLINE userPasswordTokenRequestEmailL #-} + + + +-- * UserTOTP + +-- | 'userTOTPEnabled' Lens +userTOTPEnabledL :: Lens_' UserTOTP (Maybe Bool) +userTOTPEnabledL f UserTOTP{..} = (\userTOTPEnabled -> UserTOTP { userTOTPEnabled, ..} ) <$> f userTOTPEnabled +{-# INLINE userTOTPEnabledL #-} + +-- | 'userTOTPSecret' Lens +userTOTPSecretL :: Lens_' UserTOTP (Maybe Text) +userTOTPSecretL f UserTOTP{..} = (\userTOTPSecret -> UserTOTP { userTOTPSecret, ..} ) <$> f userTOTPSecret +{-# INLINE userTOTPSecretL #-} + +-- | 'userTOTPUrl' Lens +userTOTPUrlL :: Lens_' UserTOTP (Maybe Text) +userTOTPUrlL f UserTOTP{..} = (\userTOTPUrl -> UserTOTP { userTOTPUrl, ..} ) <$> f userTOTPUrl +{-# INLINE userTOTPUrlL #-} + + + +-- * UserTOTPPasscode + +-- | 'userTOTPPasscodePasscode' Lens +userTOTPPasscodePasscodeL :: Lens_' UserTOTPPasscode (Maybe Text) +userTOTPPasscodePasscodeL f UserTOTPPasscode{..} = (\userTOTPPasscodePasscode -> UserTOTPPasscode { userTOTPPasscodePasscode, ..} ) <$> f userTOTPPasscodePasscode +{-# INLINE userTOTPPasscodePasscodeL #-} + + + +-- * UserToken + +-- | 'userTokenCreated' Lens +userTokenCreatedL :: Lens_' UserToken (Maybe Text) +userTokenCreatedL f UserToken{..} = (\userTokenCreated -> UserToken { userTokenCreated, ..} ) <$> f userTokenCreated +{-# INLINE userTokenCreatedL #-} + +-- | 'userTokenId' Lens +userTokenIdL :: Lens_' UserToken (Maybe Int) +userTokenIdL f UserToken{..} = (\userTokenId -> UserToken { userTokenId, ..} ) <$> f userTokenId +{-# INLINE userTokenIdL #-} + +-- | 'userTokenToken' Lens +userTokenTokenL :: Lens_' UserToken (Maybe Text) +userTokenTokenL f UserToken{..} = (\userTokenToken -> UserToken { userTokenToken, ..} ) <$> f userTokenToken +{-# INLINE userTokenTokenL #-} + + + +-- * UserUser + +-- | 'userUserCreated' Lens +userUserCreatedL :: Lens_' UserUser (Maybe Text) +userUserCreatedL f UserUser{..} = (\userUserCreated -> UserUser { userUserCreated, ..} ) <$> f userUserCreated +{-# INLINE userUserCreatedL #-} + +-- | 'userUserEmail' Lens +userUserEmailL :: Lens_' UserUser (Maybe Text) +userUserEmailL f UserUser{..} = (\userUserEmail -> UserUser { userUserEmail, ..} ) <$> f userUserEmail +{-# INLINE userUserEmailL #-} + +-- | 'userUserId' Lens +userUserIdL :: Lens_' UserUser (Maybe Int) +userUserIdL f UserUser{..} = (\userUserId -> UserUser { userUserId, ..} ) <$> f userUserId +{-# INLINE userUserIdL #-} + +-- | 'userUserName' Lens +userUserNameL :: Lens_' UserUser (Maybe Text) +userUserNameL f UserUser{..} = (\userUserName -> UserUser { userUserName, ..} ) <$> f userUserName +{-# INLINE userUserNameL #-} + +-- | 'userUserUpdated' Lens +userUserUpdatedL :: Lens_' UserUser (Maybe Text) +userUserUpdatedL f UserUser{..} = (\userUserUpdated -> UserUser { userUserUpdated, ..} ) <$> f userUserUpdated +{-# INLINE userUserUpdatedL #-} + +-- | 'userUserUsername' Lens +userUserUsernameL :: Lens_' UserUser (Maybe Text) +userUserUsernameL f UserUser{..} = (\userUserUsername -> UserUser { userUserUsername, ..} ) <$> f userUserUsername +{-# INLINE userUserUsernameL #-} + + + +-- * V1AuthInfo + +-- | 'v1AuthInfoLocal' Lens +v1AuthInfoLocalL :: Lens_' V1AuthInfo (Maybe V1LocalAuthInfo) +v1AuthInfoLocalL f V1AuthInfo{..} = (\v1AuthInfoLocal -> V1AuthInfo { v1AuthInfoLocal, ..} ) <$> f v1AuthInfoLocal +{-# INLINE v1AuthInfoLocalL #-} + +-- | 'v1AuthInfoOpenidConnect' Lens +v1AuthInfoOpenidConnectL :: Lens_' V1AuthInfo (Maybe V1OpenIDAuthInfo) +v1AuthInfoOpenidConnectL f V1AuthInfo{..} = (\v1AuthInfoOpenidConnect -> V1AuthInfo { v1AuthInfoOpenidConnect, ..} ) <$> f v1AuthInfoOpenidConnect +{-# INLINE v1AuthInfoOpenidConnectL #-} + + + +-- * V1LegalInfo + +-- | 'v1LegalInfoImprintUrl' Lens +v1LegalInfoImprintUrlL :: Lens_' V1LegalInfo (Maybe Text) +v1LegalInfoImprintUrlL f V1LegalInfo{..} = (\v1LegalInfoImprintUrl -> V1LegalInfo { v1LegalInfoImprintUrl, ..} ) <$> f v1LegalInfoImprintUrl +{-# INLINE v1LegalInfoImprintUrlL #-} + +-- | 'v1LegalInfoPrivacyPolicyUrl' Lens +v1LegalInfoPrivacyPolicyUrlL :: Lens_' V1LegalInfo (Maybe Text) +v1LegalInfoPrivacyPolicyUrlL f V1LegalInfo{..} = (\v1LegalInfoPrivacyPolicyUrl -> V1LegalInfo { v1LegalInfoPrivacyPolicyUrl, ..} ) <$> f v1LegalInfoPrivacyPolicyUrl +{-# INLINE v1LegalInfoPrivacyPolicyUrlL #-} + + + +-- * V1LinkShareAuth + +-- | 'v1LinkShareAuthPassword' Lens +v1LinkShareAuthPasswordL :: Lens_' V1LinkShareAuth (Maybe Text) +v1LinkShareAuthPasswordL f V1LinkShareAuth{..} = (\v1LinkShareAuthPassword -> V1LinkShareAuth { v1LinkShareAuthPassword, ..} ) <$> f v1LinkShareAuthPassword +{-# INLINE v1LinkShareAuthPasswordL #-} + + + +-- * V1LocalAuthInfo + +-- | 'v1LocalAuthInfoEnabled' Lens +v1LocalAuthInfoEnabledL :: Lens_' V1LocalAuthInfo (Maybe Bool) +v1LocalAuthInfoEnabledL f V1LocalAuthInfo{..} = (\v1LocalAuthInfoEnabled -> V1LocalAuthInfo { v1LocalAuthInfoEnabled, ..} ) <$> f v1LocalAuthInfoEnabled +{-# INLINE v1LocalAuthInfoEnabledL #-} + + + +-- * V1OpenIDAuthInfo + +-- | 'v1OpenIDAuthInfoEnabled' Lens +v1OpenIDAuthInfoEnabledL :: Lens_' V1OpenIDAuthInfo (Maybe Bool) +v1OpenIDAuthInfoEnabledL f V1OpenIDAuthInfo{..} = (\v1OpenIDAuthInfoEnabled -> V1OpenIDAuthInfo { v1OpenIDAuthInfoEnabled, ..} ) <$> f v1OpenIDAuthInfoEnabled +{-# INLINE v1OpenIDAuthInfoEnabledL #-} + +-- | 'v1OpenIDAuthInfoProviders' Lens +v1OpenIDAuthInfoProvidersL :: Lens_' V1OpenIDAuthInfo (Maybe [OpenidProvider]) +v1OpenIDAuthInfoProvidersL f V1OpenIDAuthInfo{..} = (\v1OpenIDAuthInfoProviders -> V1OpenIDAuthInfo { v1OpenIDAuthInfoProviders, ..} ) <$> f v1OpenIDAuthInfoProviders +{-# INLINE v1OpenIDAuthInfoProvidersL #-} + + + +-- * V1UserAvatarProvider + +-- | 'v1UserAvatarProviderAvatarProvider' Lens +v1UserAvatarProviderAvatarProviderL :: Lens_' V1UserAvatarProvider (Maybe Text) +v1UserAvatarProviderAvatarProviderL f V1UserAvatarProvider{..} = (\v1UserAvatarProviderAvatarProvider -> V1UserAvatarProvider { v1UserAvatarProviderAvatarProvider, ..} ) <$> f v1UserAvatarProviderAvatarProvider +{-# INLINE v1UserAvatarProviderAvatarProviderL #-} + + + +-- * V1UserDeletionRequestConfirm + +-- | 'v1UserDeletionRequestConfirmToken' Lens +v1UserDeletionRequestConfirmTokenL :: Lens_' V1UserDeletionRequestConfirm (Maybe Text) +v1UserDeletionRequestConfirmTokenL f V1UserDeletionRequestConfirm{..} = (\v1UserDeletionRequestConfirmToken -> V1UserDeletionRequestConfirm { v1UserDeletionRequestConfirmToken, ..} ) <$> f v1UserDeletionRequestConfirmToken +{-# INLINE v1UserDeletionRequestConfirmTokenL #-} + + + +-- * V1UserPassword + +-- | 'v1UserPasswordNewPassword' Lens +v1UserPasswordNewPasswordL :: Lens_' V1UserPassword (Maybe Text) +v1UserPasswordNewPasswordL f V1UserPassword{..} = (\v1UserPasswordNewPassword -> V1UserPassword { v1UserPasswordNewPassword, ..} ) <$> f v1UserPasswordNewPassword +{-# INLINE v1UserPasswordNewPasswordL #-} + +-- | 'v1UserPasswordOldPassword' Lens +v1UserPasswordOldPasswordL :: Lens_' V1UserPassword (Maybe Text) +v1UserPasswordOldPasswordL f V1UserPassword{..} = (\v1UserPasswordOldPassword -> V1UserPassword { v1UserPasswordOldPassword, ..} ) <$> f v1UserPasswordOldPassword +{-# INLINE v1UserPasswordOldPasswordL #-} + + + +-- * V1UserPasswordConfirmation + +-- | 'v1UserPasswordConfirmationPassword' Lens +v1UserPasswordConfirmationPasswordL :: Lens_' V1UserPasswordConfirmation (Maybe Text) +v1UserPasswordConfirmationPasswordL f V1UserPasswordConfirmation{..} = (\v1UserPasswordConfirmationPassword -> V1UserPasswordConfirmation { v1UserPasswordConfirmationPassword, ..} ) <$> f v1UserPasswordConfirmationPassword +{-# INLINE v1UserPasswordConfirmationPasswordL #-} + + + +-- * V1UserSettings + +-- | 'v1UserSettingsDefaultProjectId' Lens +v1UserSettingsDefaultProjectIdL :: Lens_' V1UserSettings (Maybe Int) +v1UserSettingsDefaultProjectIdL f V1UserSettings{..} = (\v1UserSettingsDefaultProjectId -> V1UserSettings { v1UserSettingsDefaultProjectId, ..} ) <$> f v1UserSettingsDefaultProjectId +{-# INLINE v1UserSettingsDefaultProjectIdL #-} + +-- | 'v1UserSettingsDiscoverableByEmail' Lens +v1UserSettingsDiscoverableByEmailL :: Lens_' V1UserSettings (Maybe Bool) +v1UserSettingsDiscoverableByEmailL f V1UserSettings{..} = (\v1UserSettingsDiscoverableByEmail -> V1UserSettings { v1UserSettingsDiscoverableByEmail, ..} ) <$> f v1UserSettingsDiscoverableByEmail +{-# INLINE v1UserSettingsDiscoverableByEmailL #-} + +-- | 'v1UserSettingsDiscoverableByName' Lens +v1UserSettingsDiscoverableByNameL :: Lens_' V1UserSettings (Maybe Bool) +v1UserSettingsDiscoverableByNameL f V1UserSettings{..} = (\v1UserSettingsDiscoverableByName -> V1UserSettings { v1UserSettingsDiscoverableByName, ..} ) <$> f v1UserSettingsDiscoverableByName +{-# INLINE v1UserSettingsDiscoverableByNameL #-} + +-- | 'v1UserSettingsEmailRemindersEnabled' Lens +v1UserSettingsEmailRemindersEnabledL :: Lens_' V1UserSettings (Maybe Bool) +v1UserSettingsEmailRemindersEnabledL f V1UserSettings{..} = (\v1UserSettingsEmailRemindersEnabled -> V1UserSettings { v1UserSettingsEmailRemindersEnabled, ..} ) <$> f v1UserSettingsEmailRemindersEnabled +{-# INLINE v1UserSettingsEmailRemindersEnabledL #-} + +-- | 'v1UserSettingsFrontendSettings' Lens +v1UserSettingsFrontendSettingsL :: Lens_' V1UserSettings (Maybe A.Value) +v1UserSettingsFrontendSettingsL f V1UserSettings{..} = (\v1UserSettingsFrontendSettings -> V1UserSettings { v1UserSettingsFrontendSettings, ..} ) <$> f v1UserSettingsFrontendSettings +{-# INLINE v1UserSettingsFrontendSettingsL #-} + +-- | 'v1UserSettingsLanguage' Lens +v1UserSettingsLanguageL :: Lens_' V1UserSettings (Maybe Text) +v1UserSettingsLanguageL f V1UserSettings{..} = (\v1UserSettingsLanguage -> V1UserSettings { v1UserSettingsLanguage, ..} ) <$> f v1UserSettingsLanguage +{-# INLINE v1UserSettingsLanguageL #-} + +-- | 'v1UserSettingsName' Lens +v1UserSettingsNameL :: Lens_' V1UserSettings (Maybe Text) +v1UserSettingsNameL f V1UserSettings{..} = (\v1UserSettingsName -> V1UserSettings { v1UserSettingsName, ..} ) <$> f v1UserSettingsName +{-# INLINE v1UserSettingsNameL #-} + +-- | 'v1UserSettingsOverdueTasksRemindersEnabled' Lens +v1UserSettingsOverdueTasksRemindersEnabledL :: Lens_' V1UserSettings (Maybe Bool) +v1UserSettingsOverdueTasksRemindersEnabledL f V1UserSettings{..} = (\v1UserSettingsOverdueTasksRemindersEnabled -> V1UserSettings { v1UserSettingsOverdueTasksRemindersEnabled, ..} ) <$> f v1UserSettingsOverdueTasksRemindersEnabled +{-# INLINE v1UserSettingsOverdueTasksRemindersEnabledL #-} + +-- | 'v1UserSettingsOverdueTasksRemindersTime' Lens +v1UserSettingsOverdueTasksRemindersTimeL :: Lens_' V1UserSettings (Maybe Text) +v1UserSettingsOverdueTasksRemindersTimeL f V1UserSettings{..} = (\v1UserSettingsOverdueTasksRemindersTime -> V1UserSettings { v1UserSettingsOverdueTasksRemindersTime, ..} ) <$> f v1UserSettingsOverdueTasksRemindersTime +{-# INLINE v1UserSettingsOverdueTasksRemindersTimeL #-} + +-- | 'v1UserSettingsTimezone' Lens +v1UserSettingsTimezoneL :: Lens_' V1UserSettings (Maybe Text) +v1UserSettingsTimezoneL f V1UserSettings{..} = (\v1UserSettingsTimezone -> V1UserSettings { v1UserSettingsTimezone, ..} ) <$> f v1UserSettingsTimezone +{-# INLINE v1UserSettingsTimezoneL #-} + +-- | 'v1UserSettingsWeekStart' Lens +v1UserSettingsWeekStartL :: Lens_' V1UserSettings (Maybe Int) +v1UserSettingsWeekStartL f V1UserSettings{..} = (\v1UserSettingsWeekStart -> V1UserSettings { v1UserSettingsWeekStart, ..} ) <$> f v1UserSettingsWeekStart +{-# INLINE v1UserSettingsWeekStartL #-} + + + +-- * V1UserWithSettings + +-- | 'v1UserWithSettingsCreated' Lens +v1UserWithSettingsCreatedL :: Lens_' V1UserWithSettings (Maybe Text) +v1UserWithSettingsCreatedL f V1UserWithSettings{..} = (\v1UserWithSettingsCreated -> V1UserWithSettings { v1UserWithSettingsCreated, ..} ) <$> f v1UserWithSettingsCreated +{-# INLINE v1UserWithSettingsCreatedL #-} + +-- | 'v1UserWithSettingsDeletionScheduledAt' Lens +v1UserWithSettingsDeletionScheduledAtL :: Lens_' V1UserWithSettings (Maybe Text) +v1UserWithSettingsDeletionScheduledAtL f V1UserWithSettings{..} = (\v1UserWithSettingsDeletionScheduledAt -> V1UserWithSettings { v1UserWithSettingsDeletionScheduledAt, ..} ) <$> f v1UserWithSettingsDeletionScheduledAt +{-# INLINE v1UserWithSettingsDeletionScheduledAtL #-} + +-- | 'v1UserWithSettingsEmail' Lens +v1UserWithSettingsEmailL :: Lens_' V1UserWithSettings (Maybe Text) +v1UserWithSettingsEmailL f V1UserWithSettings{..} = (\v1UserWithSettingsEmail -> V1UserWithSettings { v1UserWithSettingsEmail, ..} ) <$> f v1UserWithSettingsEmail +{-# INLINE v1UserWithSettingsEmailL #-} + +-- | 'v1UserWithSettingsId' Lens +v1UserWithSettingsIdL :: Lens_' V1UserWithSettings (Maybe Int) +v1UserWithSettingsIdL f V1UserWithSettings{..} = (\v1UserWithSettingsId -> V1UserWithSettings { v1UserWithSettingsId, ..} ) <$> f v1UserWithSettingsId +{-# INLINE v1UserWithSettingsIdL #-} + +-- | 'v1UserWithSettingsIsLocalUser' Lens +v1UserWithSettingsIsLocalUserL :: Lens_' V1UserWithSettings (Maybe Bool) +v1UserWithSettingsIsLocalUserL f V1UserWithSettings{..} = (\v1UserWithSettingsIsLocalUser -> V1UserWithSettings { v1UserWithSettingsIsLocalUser, ..} ) <$> f v1UserWithSettingsIsLocalUser +{-# INLINE v1UserWithSettingsIsLocalUserL #-} + +-- | 'v1UserWithSettingsName' Lens +v1UserWithSettingsNameL :: Lens_' V1UserWithSettings (Maybe Text) +v1UserWithSettingsNameL f V1UserWithSettings{..} = (\v1UserWithSettingsName -> V1UserWithSettings { v1UserWithSettingsName, ..} ) <$> f v1UserWithSettingsName +{-# INLINE v1UserWithSettingsNameL #-} + +-- | 'v1UserWithSettingsSettings' Lens +v1UserWithSettingsSettingsL :: Lens_' V1UserWithSettings (Maybe V1UserSettings) +v1UserWithSettingsSettingsL f V1UserWithSettings{..} = (\v1UserWithSettingsSettings -> V1UserWithSettings { v1UserWithSettingsSettings, ..} ) <$> f v1UserWithSettingsSettings +{-# INLINE v1UserWithSettingsSettingsL #-} + +-- | 'v1UserWithSettingsUpdated' Lens +v1UserWithSettingsUpdatedL :: Lens_' V1UserWithSettings (Maybe Text) +v1UserWithSettingsUpdatedL f V1UserWithSettings{..} = (\v1UserWithSettingsUpdated -> V1UserWithSettings { v1UserWithSettingsUpdated, ..} ) <$> f v1UserWithSettingsUpdated +{-# INLINE v1UserWithSettingsUpdatedL #-} + +-- | 'v1UserWithSettingsUsername' Lens +v1UserWithSettingsUsernameL :: Lens_' V1UserWithSettings (Maybe Text) +v1UserWithSettingsUsernameL f V1UserWithSettings{..} = (\v1UserWithSettingsUsername -> V1UserWithSettings { v1UserWithSettingsUsername, ..} ) <$> f v1UserWithSettingsUsername +{-# INLINE v1UserWithSettingsUsernameL #-} + + + +-- * V1VikunjaInfos + +-- | 'v1VikunjaInfosAuth' Lens +v1VikunjaInfosAuthL :: Lens_' V1VikunjaInfos (Maybe V1AuthInfo) +v1VikunjaInfosAuthL f V1VikunjaInfos{..} = (\v1VikunjaInfosAuth -> V1VikunjaInfos { v1VikunjaInfosAuth, ..} ) <$> f v1VikunjaInfosAuth +{-# INLINE v1VikunjaInfosAuthL #-} + +-- | 'v1VikunjaInfosAvailableMigrators' Lens +v1VikunjaInfosAvailableMigratorsL :: Lens_' V1VikunjaInfos (Maybe [Text]) +v1VikunjaInfosAvailableMigratorsL f V1VikunjaInfos{..} = (\v1VikunjaInfosAvailableMigrators -> V1VikunjaInfos { v1VikunjaInfosAvailableMigrators, ..} ) <$> f v1VikunjaInfosAvailableMigrators +{-# INLINE v1VikunjaInfosAvailableMigratorsL #-} + +-- | 'v1VikunjaInfosCaldavEnabled' Lens +v1VikunjaInfosCaldavEnabledL :: Lens_' V1VikunjaInfos (Maybe Bool) +v1VikunjaInfosCaldavEnabledL f V1VikunjaInfos{..} = (\v1VikunjaInfosCaldavEnabled -> V1VikunjaInfos { v1VikunjaInfosCaldavEnabled, ..} ) <$> f v1VikunjaInfosCaldavEnabled +{-# INLINE v1VikunjaInfosCaldavEnabledL #-} + +-- | 'v1VikunjaInfosDemoModeEnabled' Lens +v1VikunjaInfosDemoModeEnabledL :: Lens_' V1VikunjaInfos (Maybe Bool) +v1VikunjaInfosDemoModeEnabledL f V1VikunjaInfos{..} = (\v1VikunjaInfosDemoModeEnabled -> V1VikunjaInfos { v1VikunjaInfosDemoModeEnabled, ..} ) <$> f v1VikunjaInfosDemoModeEnabled +{-# INLINE v1VikunjaInfosDemoModeEnabledL #-} + +-- | 'v1VikunjaInfosEmailRemindersEnabled' Lens +v1VikunjaInfosEmailRemindersEnabledL :: Lens_' V1VikunjaInfos (Maybe Bool) +v1VikunjaInfosEmailRemindersEnabledL f V1VikunjaInfos{..} = (\v1VikunjaInfosEmailRemindersEnabled -> V1VikunjaInfos { v1VikunjaInfosEmailRemindersEnabled, ..} ) <$> f v1VikunjaInfosEmailRemindersEnabled +{-# INLINE v1VikunjaInfosEmailRemindersEnabledL #-} + +-- | 'v1VikunjaInfosEnabledBackgroundProviders' Lens +v1VikunjaInfosEnabledBackgroundProvidersL :: Lens_' V1VikunjaInfos (Maybe [Text]) +v1VikunjaInfosEnabledBackgroundProvidersL f V1VikunjaInfos{..} = (\v1VikunjaInfosEnabledBackgroundProviders -> V1VikunjaInfos { v1VikunjaInfosEnabledBackgroundProviders, ..} ) <$> f v1VikunjaInfosEnabledBackgroundProviders +{-# INLINE v1VikunjaInfosEnabledBackgroundProvidersL #-} + +-- | 'v1VikunjaInfosFrontendUrl' Lens +v1VikunjaInfosFrontendUrlL :: Lens_' V1VikunjaInfos (Maybe Text) +v1VikunjaInfosFrontendUrlL f V1VikunjaInfos{..} = (\v1VikunjaInfosFrontendUrl -> V1VikunjaInfos { v1VikunjaInfosFrontendUrl, ..} ) <$> f v1VikunjaInfosFrontendUrl +{-# INLINE v1VikunjaInfosFrontendUrlL #-} + +-- | 'v1VikunjaInfosLegal' Lens +v1VikunjaInfosLegalL :: Lens_' V1VikunjaInfos (Maybe V1LegalInfo) +v1VikunjaInfosLegalL f V1VikunjaInfos{..} = (\v1VikunjaInfosLegal -> V1VikunjaInfos { v1VikunjaInfosLegal, ..} ) <$> f v1VikunjaInfosLegal +{-# INLINE v1VikunjaInfosLegalL #-} + +-- | 'v1VikunjaInfosLinkSharingEnabled' Lens +v1VikunjaInfosLinkSharingEnabledL :: Lens_' V1VikunjaInfos (Maybe Bool) +v1VikunjaInfosLinkSharingEnabledL f V1VikunjaInfos{..} = (\v1VikunjaInfosLinkSharingEnabled -> V1VikunjaInfos { v1VikunjaInfosLinkSharingEnabled, ..} ) <$> f v1VikunjaInfosLinkSharingEnabled +{-# INLINE v1VikunjaInfosLinkSharingEnabledL #-} + +-- | 'v1VikunjaInfosMaxFileSize' Lens +v1VikunjaInfosMaxFileSizeL :: Lens_' V1VikunjaInfos (Maybe Text) +v1VikunjaInfosMaxFileSizeL f V1VikunjaInfos{..} = (\v1VikunjaInfosMaxFileSize -> V1VikunjaInfos { v1VikunjaInfosMaxFileSize, ..} ) <$> f v1VikunjaInfosMaxFileSize +{-# INLINE v1VikunjaInfosMaxFileSizeL #-} + +-- | 'v1VikunjaInfosMotd' Lens +v1VikunjaInfosMotdL :: Lens_' V1VikunjaInfos (Maybe Text) +v1VikunjaInfosMotdL f V1VikunjaInfos{..} = (\v1VikunjaInfosMotd -> V1VikunjaInfos { v1VikunjaInfosMotd, ..} ) <$> f v1VikunjaInfosMotd +{-# INLINE v1VikunjaInfosMotdL #-} + +-- | 'v1VikunjaInfosPublicTeamsEnabled' Lens +v1VikunjaInfosPublicTeamsEnabledL :: Lens_' V1VikunjaInfos (Maybe Bool) +v1VikunjaInfosPublicTeamsEnabledL f V1VikunjaInfos{..} = (\v1VikunjaInfosPublicTeamsEnabled -> V1VikunjaInfos { v1VikunjaInfosPublicTeamsEnabled, ..} ) <$> f v1VikunjaInfosPublicTeamsEnabled +{-# INLINE v1VikunjaInfosPublicTeamsEnabledL #-} + +-- | 'v1VikunjaInfosRegistrationEnabled' Lens +v1VikunjaInfosRegistrationEnabledL :: Lens_' V1VikunjaInfos (Maybe Bool) +v1VikunjaInfosRegistrationEnabledL f V1VikunjaInfos{..} = (\v1VikunjaInfosRegistrationEnabled -> V1VikunjaInfos { v1VikunjaInfosRegistrationEnabled, ..} ) <$> f v1VikunjaInfosRegistrationEnabled +{-# INLINE v1VikunjaInfosRegistrationEnabledL #-} + +-- | 'v1VikunjaInfosTaskAttachmentsEnabled' Lens +v1VikunjaInfosTaskAttachmentsEnabledL :: Lens_' V1VikunjaInfos (Maybe Bool) +v1VikunjaInfosTaskAttachmentsEnabledL f V1VikunjaInfos{..} = (\v1VikunjaInfosTaskAttachmentsEnabled -> V1VikunjaInfos { v1VikunjaInfosTaskAttachmentsEnabled, ..} ) <$> f v1VikunjaInfosTaskAttachmentsEnabled +{-# INLINE v1VikunjaInfosTaskAttachmentsEnabledL #-} + +-- | 'v1VikunjaInfosTaskCommentsEnabled' Lens +v1VikunjaInfosTaskCommentsEnabledL :: Lens_' V1VikunjaInfos (Maybe Bool) +v1VikunjaInfosTaskCommentsEnabledL f V1VikunjaInfos{..} = (\v1VikunjaInfosTaskCommentsEnabled -> V1VikunjaInfos { v1VikunjaInfosTaskCommentsEnabled, ..} ) <$> f v1VikunjaInfosTaskCommentsEnabled +{-# INLINE v1VikunjaInfosTaskCommentsEnabledL #-} + +-- | 'v1VikunjaInfosTotpEnabled' Lens +v1VikunjaInfosTotpEnabledL :: Lens_' V1VikunjaInfos (Maybe Bool) +v1VikunjaInfosTotpEnabledL f V1VikunjaInfos{..} = (\v1VikunjaInfosTotpEnabled -> V1VikunjaInfos { v1VikunjaInfosTotpEnabled, ..} ) <$> f v1VikunjaInfosTotpEnabled +{-# INLINE v1VikunjaInfosTotpEnabledL #-} + +-- | 'v1VikunjaInfosUserDeletionEnabled' Lens +v1VikunjaInfosUserDeletionEnabledL :: Lens_' V1VikunjaInfos (Maybe Bool) +v1VikunjaInfosUserDeletionEnabledL f V1VikunjaInfos{..} = (\v1VikunjaInfosUserDeletionEnabled -> V1VikunjaInfos { v1VikunjaInfosUserDeletionEnabled, ..} ) <$> f v1VikunjaInfosUserDeletionEnabled +{-# INLINE v1VikunjaInfosUserDeletionEnabledL #-} + +-- | 'v1VikunjaInfosVersion' Lens +v1VikunjaInfosVersionL :: Lens_' V1VikunjaInfos (Maybe Text) +v1VikunjaInfosVersionL f V1VikunjaInfos{..} = (\v1VikunjaInfosVersion -> V1VikunjaInfos { v1VikunjaInfosVersion, ..} ) <$> f v1VikunjaInfosVersion +{-# INLINE v1VikunjaInfosVersionL #-} + +-- | 'v1VikunjaInfosWebhooksEnabled' Lens +v1VikunjaInfosWebhooksEnabledL :: Lens_' V1VikunjaInfos (Maybe Bool) +v1VikunjaInfosWebhooksEnabledL f V1VikunjaInfos{..} = (\v1VikunjaInfosWebhooksEnabled -> V1VikunjaInfos { v1VikunjaInfosWebhooksEnabled, ..} ) <$> f v1VikunjaInfosWebhooksEnabled +{-# INLINE v1VikunjaInfosWebhooksEnabledL #-} + + + +-- * WebHTTPError + +-- | 'webHTTPErrorCode' Lens +webHTTPErrorCodeL :: Lens_' WebHTTPError (Maybe Int) +webHTTPErrorCodeL f WebHTTPError{..} = (\webHTTPErrorCode -> WebHTTPError { webHTTPErrorCode, ..} ) <$> f webHTTPErrorCode +{-# INLINE webHTTPErrorCodeL #-} + +-- | 'webHTTPErrorMessage' Lens +webHTTPErrorMessageL :: Lens_' WebHTTPError (Maybe Text) +webHTTPErrorMessageL f WebHTTPError{..} = (\webHTTPErrorMessage -> WebHTTPError { webHTTPErrorMessage, ..} ) <$> f webHTTPErrorMessage +{-# INLINE webHTTPErrorMessageL #-} + + diff --git a/openapi.yaml b/openapi.yaml new file mode 100644 index 0000000..a3850ea --- /dev/null +++ b/openapi.yaml @@ -0,0 +1,8185 @@ +openapi: 3.0.1 +info: + contact: + email: hello@vikunja.io + name: General Vikunja contact + url: https://vikunja.io/contact/ + description: "# Pagination\nEvery endpoint capable of pagination will return two\ + \ headers:\n* `x-pagination-total-pages`: The total number of available pages\ + \ for this request\n* `x-pagination-result-count`: The number of items returned\ + \ for this request.\n# Rights\nAll endpoints which return a single item (project,\ + \ task, etc.) - no array - will also return a `x-max-right` header with the max\ + \ right the user has on this item as an int where `0` is `Read Only`, `1` is `Read\ + \ & Write` and `2` is `Admin`.\nThis can be used to show or hide ui elements based\ + \ on the rights the user has.\n# Errors\nAll errors have an error code and a human-readable\ + \ error message in addition to the http status code. You should always check for\ + \ the status code in the response, not only the http status code.\nDue to limitations\ + \ in the swagger library we're using for this document, only one error per http\ + \ status code is documented here. Make sure to check the [error docs](https://vikunja.io/docs/errors/)\ + \ in Vikunja's documentation for a full list of available error codes.\n# Authorization\n\ + **JWT-Auth:** Main authorization method, used for most of the requests. Needs\ + \ `Authorization: Bearer `-header to authenticate successfully.\n\n\ + **API Token:** You can create scoped API tokens for your user and use the token\ + \ to make authenticated requests in the context of that user. The token must be\ + \ provided via an `Authorization: Bearer ` header, similar to jwt auth.\ + \ See the documentation for the `api` group to manage token creation and revocation.\n\ + \n**BasicAuth:** Only used when requesting tasks via CalDAV.\n" + license: + name: AGPL-3.0-or-later + url: https://code.vikunja.io/api/src/branch/main/LICENSE + title: Vikunja API + version: 0.24.6 +servers: +- url: /api/v1 +paths: + /auth/openid/{provider}/callback: + post: + description: "After a redirect from the OpenID Connect provider to the frontend\ + \ has been made with the authentication `code`, this endpoint can be used\ + \ to obtain a jwt token for that user and thus log them in." + operationId: get-token-openid + parameters: + - description: The OpenID Connect provider key as returned by the /info endpoint + in: path + name: provider + required: true + schema: + type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/openid.Callback' + description: The openid callback + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/auth.Token' + description: OK + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Authenticate a user with OpenID Connect + tags: + - auth + x-codegen-request-body-name: callback + /backgrounds/unsplash/image/{image}: + get: + description: Get an unsplash image. **Returns json on error.** + parameters: + - description: Unsplash Image ID + in: path + name: image + required: true + schema: + type: integer + responses: + "200": + content: + application/octet-stream: + schema: + format: binary + type: string + description: The image + "404": + content: + application/octet-stream: + schema: + $ref: '#/components/schemas/models.Message' + description: The image does not exist. + "500": + content: + application/octet-stream: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Get an unsplash image + tags: + - project + /backgrounds/unsplash/image/{image}/thumb: + get: + description: Get an unsplash thumbnail image. The thumbnail is cropped to a + max width of 200px. **Returns json on error.** + parameters: + - description: Unsplash Image ID + in: path + name: image + required: true + schema: + type: integer + responses: + "200": + content: + application/octet-stream: + schema: + format: binary + type: string + description: The thumbnail + "404": + content: + application/octet-stream: + schema: + $ref: '#/components/schemas/models.Message' + description: The image does not exist. + "500": + content: + application/octet-stream: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Get an unsplash thumbnail image + tags: + - project + /backgrounds/unsplash/search: + get: + description: Search for a project background from unsplash + parameters: + - description: Search backgrounds from unsplash with this search term. + in: query + name: s + schema: + type: string + - description: "The page number. Used for pagination. If not provided, the first\ + \ page of results is returned." + in: query + name: p + schema: + type: integer + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/background.Image' + type: array + description: An array with photos + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Search for a background from unsplash + tags: + - project + /filters: + put: + description: Creates a new saved filter + responses: + "201": + content: + application/json: + schema: + $ref: '#/components/schemas/models.SavedFilter' + description: The Saved Filter + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: The user does not have access to that saved filter. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Creates a new saved filter + tags: + - filter + /filters/{id}: + delete: + description: Removes a saved filter by its ID. + parameters: + - description: Filter ID + in: path + name: id + required: true + schema: + type: integer + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.SavedFilter' + description: The Saved Filter + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: The user does not have access to that saved filter. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: The saved filter does not exist. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Removes a saved filter + tags: + - filter + get: + description: Returns a saved filter by its ID. + parameters: + - description: Filter ID + in: path + name: id + required: true + schema: + type: integer + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.SavedFilter' + description: The Saved Filter + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: The user does not have access to that saved filter. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Gets one saved filter + tags: + - filter + post: + description: Updates a saved filter by its ID. + parameters: + - description: Filter ID + in: path + name: id + required: true + schema: + type: integer + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.SavedFilter' + description: The Saved Filter + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: The user does not have access to that saved filter. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: The saved filter does not exist. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Updates a saved filter + tags: + - filter + /info: + get: + description: "Returns the version, frontendurl, motd and various settings of\ + \ Vikunja" + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/v1.vikunjaInfos' + description: OK + summary: Info + tags: + - service + /labels: + get: + description: Returns all labels which are either created by the user or associated + with a task the user has at least read-access to. + parameters: + - description: "The page number. Used for pagination. If not provided, the first\ + \ page of results is returned." + in: query + name: page + schema: + type: integer + - description: The maximum number of items per page. Note this parameter is + limited by the configured maximum of items per page. + in: query + name: per_page + schema: + type: integer + - description: Search labels by label text. + in: query + name: s + schema: + type: string + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/models.Label' + type: array + description: The labels + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Get all labels a user has access to + tags: + - labels + put: + description: Creates a new label. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/models.Label' + description: The label object + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Label' + description: The created label object. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Invalid label object provided. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Create a label + tags: + - labels + x-codegen-request-body-name: label + /labels/{id}: + delete: + description: Delete an existing label. The user needs to be the creator of the + label to be able to do this. + parameters: + - description: Label ID + in: path + name: id + required: true + schema: + type: integer + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Label' + description: The label was successfully deleted. + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Not allowed to delete the label. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Label not found. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Delete a label + tags: + - labels + get: + description: Returns one label by its ID. + parameters: + - description: Label ID + in: path + name: id + required: true + schema: + type: integer + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Label' + description: The label + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: The user does not have access to the label + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Label not found + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Gets one label + tags: + - labels + put: + description: Update an existing label. The user needs to be the creator of the + label to be able to do this. + parameters: + - description: Label ID + in: path + name: id + required: true + schema: + type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/models.Label' + description: The label object + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Label' + description: The created label object. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Invalid label object provided. + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Not allowed to update the label. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Label not found. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Update a label + tags: + - labels + x-codegen-request-body-name: label + /login: + post: + description: Logs a user in. Returns a JWT-Token to authenticate further requests. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/user.Login' + description: The login credentials + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/auth.Token' + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Invalid user password model. + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Invalid username or password. + "412": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Invalid totp passcode. + summary: Login + tags: + - auth + x-codegen-request-body-name: credentials + /migration/microsoft-todo/auth: + get: + description: Returns the auth url where the user needs to get its auth code. + This code can then be used to migrate everything from Microsoft Todo to Vikunja. + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/handler.AuthURL' + description: The auth url. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal server error + security: + - JWTKeyAuth: [] + summary: Get the auth url from Microsoft Todo + tags: + - migration + /migration/microsoft-todo/migrate: + post: + description: "Migrates all tasklinsts, tasks, notes and reminders from Microsoft\ + \ Todo to Vikunja." + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/microsofttodo.Migration' + description: The auth token previously obtained from the auth url. See the + docs for /migration/microsoft-todo/auth. + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: A message telling you everything was migrated successfully. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal server error + security: + - JWTKeyAuth: [] + summary: "Migrate all projects, tasks etc. from Microsoft Todo" + tags: + - migration + x-codegen-request-body-name: migrationCode + /migration/microsoft-todo/status: + get: + description: Returns if the current user already did the migation or not. This + is useful to show a confirmation message in the frontend if the user is trying + to do the same migration again. + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/migration.Status' + description: The migration status + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal server error + security: + - JWTKeyAuth: [] + summary: Get migration status + tags: + - migration + /migration/ticktick/migrate: + post: + description: "Imports all projects, tasks, notes, reminders, subtasks and files\ + \ from a TickTick backup export into Vikunja." + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/_migration_ticktick_migrate_post_request' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: A message telling you everything was migrated successfully. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal server error + security: + - JWTKeyAuth: [] + summary: "Import all projects, tasks etc. from a TickTick backup export" + tags: + - migration + /migration/ticktick/status: + get: + description: Returns if the current user already did the migation or not. This + is useful to show a confirmation message in the frontend if the user is trying + to do the same migration again. + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/migration.Status' + description: The migration status + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal server error + security: + - JWTKeyAuth: [] + summary: Get migration status + tags: + - migration + /migration/todoist/auth: + get: + description: Returns the auth url where the user needs to get its auth code. + This code can then be used to migrate everything from todoist to Vikunja. + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/handler.AuthURL' + description: The auth url. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal server error + security: + - JWTKeyAuth: [] + summary: Get the auth url from todoist + tags: + - migration + /migration/todoist/migrate: + post: + description: "Migrates all projects, tasks, notes, reminders, subtasks and files\ + \ from todoist to vikunja." + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/todoist.Migration' + description: The auth code previously obtained from the auth url. See the + docs for /migration/todoist/auth. + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: A message telling you everything was migrated successfully. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal server error + security: + - JWTKeyAuth: [] + summary: "Migrate all lists, tasks etc. from todoist" + tags: + - migration + x-codegen-request-body-name: migrationCode + /migration/todoist/status: + get: + description: Returns if the current user already did the migation or not. This + is useful to show a confirmation message in the frontend if the user is trying + to do the same migration again. + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/migration.Status' + description: The migration status + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal server error + security: + - JWTKeyAuth: [] + summary: Get migration status + tags: + - migration + /migration/trello/auth: + get: + description: Returns the auth url where the user needs to get its auth code. + This code can then be used to migrate everything from trello to Vikunja. + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/handler.AuthURL' + description: The auth url. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal server error + security: + - JWTKeyAuth: [] + summary: Get the auth url from trello + tags: + - migration + /migration/trello/migrate: + post: + description: "Migrates all projects, tasks, notes, reminders, subtasks and files\ + \ from trello to vikunja." + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/trello.Migration' + description: The auth token previously obtained from the auth url. See the + docs for /migration/trello/auth. + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: A message telling you everything was migrated successfully. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal server error + security: + - JWTKeyAuth: [] + summary: "Migrate all projects, tasks etc. from trello" + tags: + - migration + x-codegen-request-body-name: migrationCode + /migration/trello/status: + get: + description: Returns if the current user already did the migation or not. This + is useful to show a confirmation message in the frontend if the user is trying + to do the same migration again. + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/migration.Status' + description: The migration status + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal server error + security: + - JWTKeyAuth: [] + summary: Get migration status + tags: + - migration + /migration/vikunja-file/migrate: + post: + description: "Imports all projects, tasks, notes, reminders, subtasks and files\ + \ from a Vikunjda data export into Vikunja." + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/_migration_vikunja_file_migrate_post_request' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: A message telling you everything was migrated successfully. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal server error + security: + - JWTKeyAuth: [] + summary: "Import all projects, tasks etc. from a Vikunja data export" + tags: + - migration + /migration/vikunja-file/status: + get: + description: Returns if the current user already did the migation or not. This + is useful to show a confirmation message in the frontend if the user is trying + to do the same migration again. + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/migration.Status' + description: The migration status + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal server error + security: + - JWTKeyAuth: [] + summary: Get migration status + tags: + - migration + /notifications: + get: + description: Returns an array with all notifications for the current user. + parameters: + - description: "The page number. Used for pagination. If not provided, the first\ + \ page of results is returned." + in: query + name: page + schema: + type: integer + - description: The maximum number of items per page. Note this parameter is + limited by the configured maximum of items per page. + in: query + name: per_page + schema: + type: integer + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/notifications.DatabaseNotification' + type: array + description: The notifications + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Link shares cannot have notifications. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Get all notifications for the current user + tags: + - subscriptions + post: + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: All notifications marked as read. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + summary: Mark all notifications of a user as read + tags: + - sharing + /notifications/{id}: + post: + description: Marks a notification as either read or unread. A user can only + mark their own notifications as read. + parameters: + - description: Notification ID + in: path + name: id + required: true + schema: + type: integer + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.DatabaseNotifications' + description: The notification to mark as read. + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Link shares cannot have notifications. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: The notification does not exist. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Mark a notification as (un-)read + tags: + - subscriptions + /projects: + get: + description: Returns all projects a user has access to. + parameters: + - description: "The page number. Used for pagination. If not provided, the first\ + \ page of results is returned." + in: query + name: page + schema: + type: integer + - description: The maximum number of items per page. Note this parameter is + limited by the configured maximum of items per page. + in: query + name: per_page + schema: + type: integer + - description: Search projects by title. + in: query + name: s + schema: + type: string + - description: "If true, also returns all archived projects." + in: query + name: is_archived + schema: + type: boolean + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/models.Project' + type: array + description: The projects + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: The user does not have access to the project + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Get all projects a user has access to + tags: + - project + put: + description: Creates a new project. If a parent project is provided the user + needs to have write access to that project. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/models.Project' + description: The project you want to create. + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Project' + description: The created project. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Invalid project object provided. + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: The user does not have access to the project + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Creates a new project + tags: + - project + x-codegen-request-body-name: project + /projects/{id}: + delete: + description: Delets a project + parameters: + - description: Project ID + in: path + name: id + required: true + schema: + type: integer + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: The project was successfully deleted. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Invalid project object provided. + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: The user does not have access to the project + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Deletes a project + tags: + - project + get: + description: Returns a project by its ID. + parameters: + - description: Project ID + in: path + name: id + required: true + schema: + type: integer + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Project' + description: The project + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: The user does not have access to the project + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Gets one project + tags: + - project + post: + description: Updates a project. This does not include adding a task (see below). + parameters: + - description: Project ID + in: path + name: id + required: true + schema: + type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/models.Project' + description: The project with updated values you want to update. + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Project' + description: The updated project. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Invalid project object provided. + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: The user does not have access to the project + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Updates a project + tags: + - project + x-codegen-request-body-name: project + /projects/{id}/background: + delete: + description: "Removes a previously set project background, regardless of the\ + \ project provider used to set the background. It does not throw an error\ + \ if the project does not have a background." + parameters: + - description: Project ID + in: path + name: id + required: true + schema: + type: integer + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Project' + description: The project + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: No access to this project. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: The project does not exist. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Remove a project background + tags: + - project + get: + description: Get the project background of a specific project. **Returns json + on error.** + parameters: + - description: Project ID + in: path + name: id + required: true + schema: + type: integer + responses: + "200": + content: + application/octet-stream: + schema: + format: binary + type: string + description: The project background file. + "403": + content: + application/octet-stream: + schema: + $ref: '#/components/schemas/models.Message' + description: No access to this project. + "404": + content: + application/octet-stream: + schema: + $ref: '#/components/schemas/models.Message' + description: The project does not exist. + "500": + content: + application/octet-stream: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Get the project background + tags: + - project + /projects/{id}/backgrounds/unsplash: + post: + description: Sets a photo from unsplash as project background. + parameters: + - description: Project ID + in: path + name: id + required: true + schema: + type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/background.Image' + description: The image you want to set as background + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Project' + description: The background has been successfully set. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Invalid image object provided. + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: The user does not have access to the project + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Set an unsplash photo as project background + tags: + - project + x-codegen-request-body-name: project + /projects/{id}/backgrounds/upload: + put: + description: Upload a project background. + parameters: + - description: Project ID + in: path + name: id + required: true + schema: + type: integer + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/_projects__id__backgrounds_upload_put_request' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: The background was set successfully. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: File is no image. + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: File too large. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: The project does not exist. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Upload a project background + tags: + - project + /projects/{id}/projectusers: + get: + description: Lists all users (without emailadresses). Also possible to search + for a specific user. + parameters: + - description: Search for a user by its name. + in: query + name: s + schema: + type: string + - description: Project ID + in: path + name: id + required: true + schema: + type: integer + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/user.User' + type: array + description: All (found) users. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Something's invalid. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: The user does not have the right to see the project. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal server error. + security: + - JWTKeyAuth: [] + summary: Get users + tags: + - project + /projects/{id}/tasks: + put: + description: Inserts a task into a project. + parameters: + - description: Project ID + in: path + name: id + required: true + schema: + type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/models.Task' + description: The task object + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Task' + description: The created task object. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Invalid task object provided. + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: The user does not have access to the project + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Create a task + tags: + - task + x-codegen-request-body-name: task + /projects/{id}/teams: + get: + description: Returns a project with all teams which have access on a given project. + parameters: + - description: Project ID + in: path + name: id + required: true + schema: + type: integer + - description: "The page number. Used for pagination. If not provided, the first\ + \ page of results is returned." + in: query + name: page + schema: + type: integer + - description: The maximum number of items per page. Note this parameter is + limited by the configured maximum of items per page. + in: query + name: per_page + schema: + type: integer + - description: Search teams by its name. + in: query + name: s + schema: + type: string + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/models.TeamWithRight' + type: array + description: The teams with their right. + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: No right to see the project. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Get teams on a project + tags: + - sharing + put: + description: Gives a team access to a project. + parameters: + - description: Project ID + in: path + name: id + required: true + schema: + type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/models.TeamProject' + description: The team you want to add to the project. + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '#/components/schemas/models.TeamProject' + description: The created team<->project relation. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Invalid team project object provided. + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: The user does not have access to the project + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: The team does not exist. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Add a team to a project + tags: + - sharing + x-codegen-request-body-name: project + /projects/{id}/users: + get: + description: Returns a project with all users which have access on a given project. + parameters: + - description: Project ID + in: path + name: id + required: true + schema: + type: integer + - description: "The page number. Used for pagination. If not provided, the first\ + \ page of results is returned." + in: query + name: page + schema: + type: integer + - description: The maximum number of items per page. Note this parameter is + limited by the configured maximum of items per page. + in: query + name: per_page + schema: + type: integer + - description: Search users by its name. + in: query + name: s + schema: + type: string + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/models.UserWithRight' + type: array + description: The users with the right they have. + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: No right to see the project. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Get users on a project + tags: + - sharing + put: + description: Gives a user access to a project. + parameters: + - description: Project ID + in: path + name: id + required: true + schema: + type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/models.ProjectUser' + description: The user you want to add to the project. + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '#/components/schemas/models.ProjectUser' + description: The created user<->project relation. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Invalid user project object provided. + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: The user does not have access to the project + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: The user does not exist. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Add a user to a project + tags: + - sharing + x-codegen-request-body-name: project + /projects/{id}/views/{view}/buckets: + get: + description: "Returns all kanban buckets which belong to that project. Buckets\ + \ are always sorted by their `position` in ascending order. To get all buckets\ + \ with their tasks, use the tasks endpoint with a kanban view." + parameters: + - description: Project ID + in: path + name: id + required: true + schema: + type: integer + - description: Project view ID + in: path + name: view + required: true + schema: + type: integer + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/models.Bucket' + type: array + description: The buckets + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal server error + security: + - JWTKeyAuth: [] + summary: Get all kanban buckets of a project + tags: + - project + put: + description: Creates a new kanban bucket on a project. + parameters: + - description: Project Id + in: path + name: id + required: true + schema: + type: integer + - description: Project view ID + in: path + name: view + required: true + schema: + type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/models.Bucket' + description: The bucket object + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Bucket' + description: The created bucket object. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Invalid bucket object provided. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: The project does not exist. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Create a new bucket + tags: + - project + x-codegen-request-body-name: bucket + /projects/{id}/views/{view}/tasks: + get: + description: Returns all tasks for the current project. + parameters: + - description: The project ID. + in: path + name: id + required: true + schema: + type: integer + - description: The project view ID. + in: path + name: view + required: true + schema: + type: integer + - description: "The page number. Used for pagination. If not provided, the first\ + \ page of results is returned." + in: query + name: page + schema: + type: integer + - description: The maximum number of items per page. Note this parameter is + limited by the configured maximum of items per page. + in: query + name: per_page + schema: + type: integer + - description: Search tasks by task text. + in: query + name: s + schema: + type: string + - description: "The sorting parameter. You can pass this multiple times to get\ + \ the tasks ordered by multiple different parametes, along with `order_by`.\ + \ Possible values to sort by are `id`, `title`, `description`, `done`, `done_at`,\ + \ `due_date`, `created_by_id`, `project_id`, `repeat_after`, `priority`,\ + \ `start_date`, `end_date`, `hex_color`, `percent_done`, `uid`, `created`,\ + \ `updated`. Default is `id`." + in: query + name: sort_by + schema: + type: string + - description: The ordering parameter. Possible values to order by are `asc` + or `desc`. Default is `asc`. + in: query + name: order_by + schema: + type: string + - description: The filter query to match tasks by. Check out https://vikunja.io/docs/filters + for a full explanation of the feature. + in: query + name: filter + schema: + type: string + - description: 'The time zone which should be used for date match (statements + like ' + in: query + name: filter_timezone + schema: + type: string + - description: If set to true the result will include filtered fields whose + value is set to `null`. Available values are `true` or `false`. Defaults + to `false`. + in: query + name: filter_include_nulls + schema: + type: string + - description: "If set to `subtasks`, Vikunja will fetch only tasks which do\ + \ not have subtasks and then in a second step, will fetch all of these subtasks.\ + \ This may result in more tasks than the pagination limit being returned,\ + \ but all subtasks will be present in the response. You can only set this\ + \ to `subtasks`." + in: query + name: expand + schema: + type: string + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/models.Task' + type: array + description: The tasks + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Get tasks in a project + tags: + - task + /projects/{id}/webhooks: + get: + description: Get all api webhook targets for the specified project. + parameters: + - description: "The page number. Used for pagination. If not provided, the first\ + \ page of results is returned." + in: query + name: page + schema: + type: integer + - description: The maximum number of items per bucket per page. This parameter + is limited by the configured maximum of items per page. + in: query + name: per_page + schema: + type: integer + - description: Project ID + in: path + name: id + required: true + schema: + type: integer + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/models.Webhook' + type: array + description: The list of all webhook targets + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal server error + security: + - JWTKeyAuth: [] + summary: Get all api webhook targets for the specified project + tags: + - webhooks + put: + description: Create a webhook target which receives POST requests about specified + events from a project. + parameters: + - description: Project ID + in: path + name: id + required: true + schema: + type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/models.Webhook' + description: The webhook target object with required fields + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Webhook' + description: The created webhook target. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Invalid webhook object provided. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Create a webhook target + tags: + - webhooks + x-codegen-request-body-name: webhook + /projects/{id}/webhooks/{webhookID}: + delete: + description: Delete any of the project's webhook targets. + parameters: + - description: Project ID + in: path + name: id + required: true + schema: + type: integer + - description: Webhook ID + in: path + name: webhookID + required: true + schema: + type: integer + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Successfully deleted. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: The webhok target does not exist. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Deletes an existing webhook target + tags: + - webhooks + post: + description: Change a webhook target's events. You cannot change other values + of a webhook. + parameters: + - description: Project ID + in: path + name: id + required: true + schema: + type: integer + - description: Webhook ID + in: path + name: webhookID + required: true + schema: + type: integer + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Webhook' + description: Updated webhook target + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: The webhok target does not exist + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Change a webhook target's events. + tags: + - webhooks + /projects/{projectID}/duplicate: + put: + description: "Copies the project, tasks, files, kanban data, assignees, comments,\ + \ attachments, lables, relations, backgrounds, user/team rights and link shares\ + \ from one project to a new one. The user needs read access in the project\ + \ and write access in the parent of the new project." + parameters: + - description: The project ID to duplicate + in: path + name: projectID + required: true + schema: + type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/models.ProjectDuplicate' + description: The target parent project which should hold the copied project. + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '#/components/schemas/models.ProjectDuplicate' + description: The created project. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Invalid project duplicate object provided. + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: The user does not have access to the project or its parent. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Duplicate an existing project + tags: + - project + x-codegen-request-body-name: project + /projects/{projectID}/teams/{teamID}: + delete: + description: Delets a team from a project. The team won't have access to the + project anymore. + parameters: + - description: Project ID + in: path + name: projectID + required: true + schema: + type: integer + - description: Team ID + in: path + name: teamID + required: true + schema: + type: integer + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: The team was successfully deleted. + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: The user does not have access to the project + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Team or project does not exist. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Delete a team from a project + tags: + - sharing + post: + description: Update a team <-> project relation. Mostly used to update the right + that team has. + parameters: + - description: Project ID + in: path + name: projectID + required: true + schema: + type: integer + - description: Team ID + in: path + name: teamID + required: true + schema: + type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/models.TeamProject' + description: The team you want to update. + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.TeamProject' + description: The updated team <-> project relation. + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: The user does not have admin-access to the project + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Team or project does not exist. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Update a team <-> project relation + tags: + - sharing + x-codegen-request-body-name: project + /projects/{projectID}/users/{userID}: + delete: + description: Delets a user from a project. The user won't have access to the + project anymore. + parameters: + - description: Project ID + in: path + name: projectID + required: true + schema: + type: integer + - description: User ID + in: path + name: userID + required: true + schema: + type: integer + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: The user was successfully removed from the project. + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: The user does not have access to the project + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: user or project does not exist. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Delete a user from a project + tags: + - sharing + post: + description: Update a user <-> project relation. Mostly used to update the right + that user has. + parameters: + - description: Project ID + in: path + name: projectID + required: true + schema: + type: integer + - description: User ID + in: path + name: userID + required: true + schema: + type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/models.ProjectUser' + description: The user you want to update. + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.ProjectUser' + description: The updated user <-> project relation. + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: The user does not have admin-access to the project + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: User or project does not exist. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Update a user <-> project relation + tags: + - sharing + x-codegen-request-body-name: project + /projects/{projectID}/views/{view}/buckets/{bucketID}: + delete: + description: Deletes an existing kanban bucket and dissociates all of its task. + It does not delete any tasks. You cannot delete the last bucket on a project. + parameters: + - description: Project Id + in: path + name: projectID + required: true + schema: + type: integer + - description: Bucket Id + in: path + name: bucketID + required: true + schema: + type: integer + - description: Project view ID + in: path + name: view + required: true + schema: + type: integer + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Successfully deleted. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: The bucket does not exist. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Deletes an existing bucket + tags: + - project + post: + description: Updates an existing kanban bucket. + parameters: + - description: Project Id + in: path + name: projectID + required: true + schema: + type: integer + - description: Bucket Id + in: path + name: bucketID + required: true + schema: + type: integer + - description: Project view ID + in: path + name: view + required: true + schema: + type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/models.Bucket' + description: The bucket object + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Bucket' + description: The created bucket object. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Invalid bucket object provided. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: The bucket does not exist. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Update an existing bucket + tags: + - project + x-codegen-request-body-name: bucket + /projects/{project}/shares: + get: + description: Returns all link shares which exist for a given project + parameters: + - description: Project ID + in: path + name: project + required: true + schema: + type: integer + - description: "The page number. Used for pagination. If not provided, the first\ + \ page of results is returned." + in: query + name: page + schema: + type: integer + - description: The maximum number of items per page. Note this parameter is + limited by the configured maximum of items per page. + in: query + name: per_page + schema: + type: integer + - description: Search shares by hash. + in: query + name: s + schema: + type: string + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/models.LinkSharing' + type: array + description: The share links + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Get all link shares for a project + tags: + - sharing + put: + description: Share a project via link. The user needs to have write-access to + the project to be able do this. + parameters: + - description: Project ID + in: path + name: project + required: true + schema: + type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/models.LinkSharing' + description: The new link share object + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '#/components/schemas/models.LinkSharing' + description: The created link share object. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Invalid link share object provided. + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Not allowed to add the project share. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: The project does not exist. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Share a project via link + tags: + - sharing + x-codegen-request-body-name: label + /projects/{project}/shares/{share}: + delete: + description: Remove a link share. The user needs to have write-access to the + project to be able do this. + parameters: + - description: Project ID + in: path + name: project + required: true + schema: + type: integer + - description: Share Link ID + in: path + name: share + required: true + schema: + type: integer + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: The link was successfully removed. + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Not allowed to remove the link. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Share Link not found. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Remove a link share + tags: + - sharing + get: + description: Returns one link share by its ID. + parameters: + - description: Project ID + in: path + name: project + required: true + schema: + type: integer + - description: Share ID + in: path + name: share + required: true + schema: + type: integer + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.LinkSharing' + description: The share links + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: No access to the project + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Share Link not found. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Get one link shares for a project + tags: + - sharing + /projects/{project}/views: + get: + description: Returns all project views for a sepcific project + parameters: + - description: Project ID + in: path + name: project + required: true + schema: + type: integer + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/models.ProjectView' + type: array + description: The project views + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Get all project views for a project + tags: + - project + put: + description: Create a project view in a specific project. + parameters: + - description: Project ID + in: path + name: project + required: true + schema: + type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/models.ProjectView' + description: The project view you want to create. + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.ProjectView' + description: The created project view + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: The user does not have access to create a project view + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Create a project view + tags: + - project + x-codegen-request-body-name: view + /projects/{project}/views/{id}: + delete: + description: Deletes a project view. + parameters: + - description: Project ID + in: path + name: project + required: true + schema: + type: integer + - description: Project View ID + in: path + name: id + required: true + schema: + type: integer + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: The project view was successfully deleted. + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: The user does not have access to the project view + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Delete a project view + tags: + - project + get: + description: Returns a project view by its ID. + parameters: + - description: Project ID + in: path + name: project + required: true + schema: + type: integer + - description: Project View ID + in: path + name: id + required: true + schema: + type: integer + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.ProjectView' + description: The project view + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: The user does not have access to this project view + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Get one project view + tags: + - project + post: + description: Updates a project view. + parameters: + - description: Project ID + in: path + name: project + required: true + schema: + type: integer + - description: Project View ID + in: path + name: id + required: true + schema: + type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/models.ProjectView' + description: The project view with updated values you want to change. + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.ProjectView' + description: The updated project view. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Invalid project view object provided. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Updates a project view + tags: + - project + x-codegen-request-body-name: view + /projects/{project}/views/{view}/buckets/{bucket}/tasks: + post: + description: Updates a task in a bucket + parameters: + - description: Project ID + in: path + name: project + required: true + schema: + type: integer + - description: Project View ID + in: path + name: view + required: true + schema: + type: integer + - description: Bucket ID + in: path + name: bucket + required: true + schema: + type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/models.TaskBucket' + description: The id of the task you want to move into the bucket. + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.TaskBucket' + description: The updated task bucket. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Invalid task bucket object provided. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Update a task bucket + tags: + - task + x-codegen-request-body-name: taskBucket + /register: + post: + description: Creates a new user account. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/user.APIUserPassword' + description: The user credentials + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/user.User' + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: No or invalid user register object provided / User already + exists. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + summary: Register + tags: + - auth + x-codegen-request-body-name: credentials + /routes: + get: + description: "Returns a list of all API routes which are available to use with\ + \ an api token, not a user login." + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/models.APITokenRoute' + type: array + description: The list of all routes. + security: + - JWTKeyAuth: [] + summary: Get a list of all token api routes + tags: + - api + /shares/{share}/auth: + post: + description: Get a jwt auth token for a shared project from a share hash. + parameters: + - description: The share hash + in: path + name: share + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/v1.LinkShareAuth' + description: The password for link shares which require one. + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/auth.Token' + description: The valid jwt auth token. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Invalid link share object provided. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + summary: Get an auth token for a share + tags: + - sharing + x-codegen-request-body-name: password + /subscriptions/{entity}/{entityID}: + delete: + description: Unsubscribes the current user to an entity. + parameters: + - description: The entity the user subscribed to. Can be either `project` or + `task`. + in: path + name: entity + required: true + schema: + type: string + - description: The numeric id of the subscribed entity to. + in: path + name: entityID + required: true + schema: + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Subscription' + description: The subscription + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: The user does not have access to subscribe to this entity. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: The subscription does not exist. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Unsubscribe the current user from an entity. + tags: + - subscriptions + put: + description: Subscribes the current user to an entity. + parameters: + - description: The entity the user subscribes to. Can be either `project` or + `task`. + in: path + name: entity + required: true + schema: + type: string + - description: The numeric id of the entity to subscribe to. + in: path + name: entityID + required: true + schema: + type: string + responses: + "201": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Subscription' + description: The subscription + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: The user does not have access to subscribe to this entity. + "412": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: The subscription entity is invalid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Subscribes the current user to an entity. + tags: + - subscriptions + /tasks/all: + get: + description: Returns all tasks on any project the user has access to. + parameters: + - description: "The page number. Used for pagination. If not provided, the first\ + \ page of results is returned." + in: query + name: page + schema: + type: integer + - description: The maximum number of items per page. Note this parameter is + limited by the configured maximum of items per page. + in: query + name: per_page + schema: + type: integer + - description: Search tasks by task text. + in: query + name: s + schema: + type: string + - description: "The sorting parameter. You can pass this multiple times to get\ + \ the tasks ordered by multiple different parametes, along with `order_by`.\ + \ Possible values to sort by are `id`, `title`, `description`, `done`, `done_at`,\ + \ `due_date`, `created_by_id`, `project_id`, `repeat_after`, `priority`,\ + \ `start_date`, `end_date`, `hex_color`, `percent_done`, `uid`, `created`,\ + \ `updated`. Default is `id`." + in: query + name: sort_by + schema: + type: string + - description: The ordering parameter. Possible values to order by are `asc` + or `desc`. Default is `asc`. + in: query + name: order_by + schema: + type: string + - description: The filter query to match tasks by. Check out https://vikunja.io/docs/filters + for a full explanation of the feature. + in: query + name: filter + schema: + type: string + - description: 'The time zone which should be used for date match (statements + like ' + in: query + name: filter_timezone + schema: + type: string + - description: If set to true the result will include filtered fields whose + value is set to `null`. Available values are `true` or `false`. Defaults + to `false`. + in: query + name: filter_include_nulls + schema: + type: string + - description: "If set to `subtasks`, Vikunja will fetch only tasks which do\ + \ not have subtasks and then in a second step, will fetch all of these subtasks.\ + \ This may result in more tasks than the pagination limit being returned,\ + \ but all subtasks will be present in the response. You can only set this\ + \ to `subtasks`." + in: query + name: expand + schema: + type: string + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/models.Task' + type: array + description: The tasks + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Get tasks + tags: + - task + /tasks/bulk: + post: + 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." + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/models.BulkTask' + description: "The task object. Looks like a normal task, the only difference\ + \ is it uses an array of project_ids to update." + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Task' + description: The updated task object. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Invalid task object provided. + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: The user does not have access to the task (aka its project) + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Update a bunch of tasks at once + tags: + - task + x-codegen-request-body-name: task + /tasks/{id}: + delete: + description: Deletes a task from a project. This does not mean "mark it done". + parameters: + - description: Task ID + in: path + name: id + required: true + schema: + type: integer + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: The created task object. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Invalid task ID provided. + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: The user does not have access to the project + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Delete a task + tags: + - task + get: + description: Returns one task by its ID + parameters: + - description: The task ID + in: path + name: id + required: true + schema: + type: integer + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Task' + description: The task + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Task not found + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Get one task + tags: + - task + post: + 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." + parameters: + - description: The Task ID + in: path + name: id + required: true + schema: + type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/models.Task' + description: The task object + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Task' + description: The updated task object. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Invalid task object provided. + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: The user does not have access to the task (aka its project) + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Update a task + tags: + - task + x-codegen-request-body-name: task + /tasks/{id}/attachments: + get: + description: Get all task attachments for one task. + parameters: + - description: Task ID + in: path + name: id + required: true + schema: + type: integer + - description: "The page number. Used for pagination. If not provided, the first\ + \ page of results is returned." + in: query + name: page + schema: + type: integer + - description: The maximum number of items per page. Note this parameter is + limited by the configured maximum of items per page. + in: query + name: per_page + schema: + type: integer + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/models.TaskAttachment' + type: array + description: All attachments for this task + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: No access to this task. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: The task does not exist. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Get all attachments for one task. + tags: + - task + put: + description: Upload a task attachment. You can pass multiple files with the + files form param. + parameters: + - description: Task ID + in: path + name: id + required: true + schema: + type: integer + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/_tasks__id__attachments_get_request' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Attachments were uploaded successfully. + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: No access to the task. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: The task does not exist. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Upload a task attachment + tags: + - task + /tasks/{id}/attachments/{attachmentID}: + delete: + description: Delete an attachment. + parameters: + - description: Task ID + in: path + name: id + required: true + schema: + type: integer + - description: Attachment ID + in: path + name: attachmentID + required: true + schema: + type: integer + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: The attachment was deleted successfully. + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: No access to this task. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: The task does not exist. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Delete an attachment + tags: + - task + get: + description: Get one attachment for download. **Returns json on error.** + parameters: + - description: Task ID + in: path + name: id + required: true + schema: + type: integer + - description: Attachment ID + in: path + name: attachmentID + required: true + schema: + type: integer + - description: "The size of the preview image. Can be sm = 100px, md = 200px,\ + \ lg = 400px or xl = 800px. If provided, a preview image will be returned\ + \ if the attachment is an image." + in: query + name: preview_size + schema: + type: string + responses: + "200": + content: + application/octet-stream: + schema: + format: binary + type: string + description: The attachment file. + "403": + content: + application/octet-stream: + schema: + $ref: '#/components/schemas/models.Message' + description: No access to this task. + "404": + content: + application/octet-stream: + schema: + $ref: '#/components/schemas/models.Message' + description: The task does not exist. + "500": + content: + application/octet-stream: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Get one attachment. + tags: + - task + /tasks/{id}/position: + post: + description: Updates a task position. + parameters: + - description: Task ID + in: path + name: id + required: true + schema: + type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/models.TaskPosition' + description: The task position with updated values you want to change. + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.TaskPosition' + description: The updated task position. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Invalid task position object provided. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Updates a task position + tags: + - task + x-codegen-request-body-name: view + /tasks/{taskID}/assignees: + get: + description: Returns an array with all assignees for this task. + parameters: + - description: "The page number. Used for pagination. If not provided, the first\ + \ page of results is returned." + in: query + name: page + schema: + type: integer + - description: The maximum number of items per page. Note this parameter is + limited by the configured maximum of items per page. + in: query + name: per_page + schema: + type: integer + - description: Search assignees by their username. + in: query + name: s + schema: + type: string + - description: Task ID + in: path + name: taskID + required: true + schema: + type: integer + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/user.User' + type: array + description: The assignees + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Get all assignees for a task + tags: + - assignees + put: + description: "Adds a new assignee to a task. The assignee needs to have access\ + \ to the project, the doer must be able to edit this task." + parameters: + - description: Task ID + in: path + name: taskID + required: true + schema: + type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/models.TaskAssginee' + description: The assingee object + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '#/components/schemas/models.TaskAssginee' + description: The created assingee object. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Invalid assignee object provided. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Add a new assignee to a task + tags: + - assignees + x-codegen-request-body-name: assignee + /tasks/{taskID}/assignees/bulk: + post: + description: "Adds multiple new assignees to a task. The assignee needs to have\ + \ access to the project, the doer must be able to edit this task. Every user\ + \ not in the project will be unassigned from the task, pass an empty array\ + \ to unassign everyone." + parameters: + - description: Task ID + in: path + name: taskID + required: true + schema: + type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/models.BulkAssignees' + description: The array of assignees + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '#/components/schemas/models.TaskAssginee' + description: The created assingees object. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Invalid assignee object provided. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Add multiple new assignees to a task + tags: + - assignees + x-codegen-request-body-name: assignee + /tasks/{taskID}/assignees/{userID}: + delete: + description: Un-assign a user from a task. + parameters: + - description: Task ID + in: path + name: taskID + required: true + schema: + type: integer + - description: Assignee user ID + in: path + name: userID + required: true + schema: + type: integer + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: The assignee was successfully deleted. + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Not allowed to delete the assignee. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Delete an assignee + tags: + - assignees + /tasks/{taskID}/comments: + get: + description: Get all task comments. The user doing this need to have at least + read access to the task. + parameters: + - description: Task ID + in: path + name: taskID + required: true + schema: + type: integer + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/models.TaskComment' + type: array + description: The array with all task comments + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Get all task comments + tags: + - task + put: + description: Create a new task comment. The user doing this need to have at + least write access to the task this comment should belong to. + parameters: + - description: Task ID + in: path + name: taskID + required: true + schema: + type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/models.TaskComment' + description: The task comment object + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '#/components/schemas/models.TaskComment' + description: The created task comment object. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Invalid task comment object provided. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Create a new task comment + tags: + - task + x-codegen-request-body-name: relation + /tasks/{taskID}/comments/{commentID}: + delete: + description: Remove a task comment. The user doing this need to have at least + write access to the task this comment belongs to. + parameters: + - description: Task ID + in: path + name: taskID + required: true + schema: + type: integer + - description: Comment ID + in: path + name: commentID + required: true + schema: + type: integer + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: The task comment was successfully deleted. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Invalid task comment object provided. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: The task comment was not found. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Remove a task comment + tags: + - task + get: + description: Remove a task comment. The user doing this need to have at least + read access to the task this comment belongs to. + parameters: + - description: Task ID + in: path + name: taskID + required: true + schema: + type: integer + - description: Comment ID + in: path + name: commentID + required: true + schema: + type: integer + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.TaskComment' + description: The task comment object. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Invalid task comment object provided. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: The task comment was not found. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Remove a task comment + tags: + - task + post: + description: Update an existing task comment. The user doing this need to have + at least write access to the task this comment belongs to. + parameters: + - description: Task ID + in: path + name: taskID + required: true + schema: + type: integer + - description: Comment ID + in: path + name: commentID + required: true + schema: + type: integer + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.TaskComment' + description: The updated task comment object. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Invalid task comment object provided. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: The task comment was not found. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Update an existing task comment + tags: + - task + /tasks/{taskID}/labels/bulk: + post: + 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. + parameters: + - description: Task ID + in: path + name: taskID + required: true + schema: + type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/models.LabelTaskBulk' + description: The array of labels + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '#/components/schemas/models.LabelTaskBulk' + description: The updated labels object. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Invalid label object provided. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Update all labels on a task. + tags: + - labels + x-codegen-request-body-name: label + /tasks/{taskID}/relations: + put: + 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 project. Take a look at the docs + for available task relation kinds. + parameters: + - description: Task ID + in: path + name: taskID + required: true + schema: + type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/models.TaskRelation' + description: The relation object + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '#/components/schemas/models.TaskRelation' + description: The created task relation object. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Invalid task relation object provided. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Create a new relation between two tasks + tags: + - task + x-codegen-request-body-name: relation + /tasks/{taskID}/relations/{relationKind}/{otherTaskID}: + delete: + parameters: + - description: Task ID + in: path + name: taskID + required: true + schema: + type: integer + - description: The kind of the relation. See the TaskRelation type for more + info. + in: path + name: relationKind + required: true + schema: + type: string + - description: The id of the other task. + in: path + name: otherTaskID + required: true + schema: + type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/models.TaskRelation' + description: The relation object + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: The task relation was successfully deleted. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Invalid task relation object provided. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: The task relation was not found. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Remove a task relation + tags: + - task + x-codegen-request-body-name: relation + /tasks/{task}/labels: + get: + description: Returns all labels which are assicociated with a given task. + parameters: + - description: Task ID + in: path + name: task + required: true + schema: + type: integer + - description: "The page number. Used for pagination. If not provided, the first\ + \ page of results is returned." + in: query + name: page + schema: + type: integer + - description: The maximum number of items per page. Note this parameter is + limited by the configured maximum of items per page. + in: query + name: per_page + schema: + type: integer + - description: Search labels by label text. + in: query + name: s + schema: + type: string + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/models.Label' + type: array + description: The labels + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Get all labels on a task + tags: + - labels + put: + description: Add a label to a task. The user needs to have write-access to the + project to be able do this. + parameters: + - description: Task ID + in: path + name: task + required: true + schema: + type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/models.LabelTask' + description: The label object + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '#/components/schemas/models.LabelTask' + description: The created label relation object. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Invalid label object provided. + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Not allowed to add the label. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: The label does not exist. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Add a label to a task + tags: + - labels + x-codegen-request-body-name: label + /tasks/{task}/labels/{label}: + delete: + description: Remove a label from a task. The user needs to have write-access + to the project to be able do this. + parameters: + - description: Task ID + in: path + name: task + required: true + schema: + type: integer + - description: Label ID + in: path + name: label + required: true + schema: + type: integer + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: The label was successfully removed. + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Not allowed to remove the label. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Label not found. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Remove a label from a task + tags: + - labels + /teams: + get: + description: Returns all teams the current user is part of. + parameters: + - description: "The page number. Used for pagination. If not provided, the first\ + \ page of results is returned." + in: query + name: page + schema: + type: integer + - description: The maximum number of items per page. Note this parameter is + limited by the configured maximum of items per page. + in: query + name: per_page + schema: + type: integer + - description: Search teams by its name. + in: query + name: s + schema: + type: string + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/models.Team' + type: array + description: The teams. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Get teams + tags: + - team + put: + description: Creates a new team. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/models.Team' + description: The team you want to create. + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Team' + description: The created team. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Invalid team object provided. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Creates a new team + tags: + - team + x-codegen-request-body-name: team + /teams/{id}: + delete: + description: Delets a team. This will also remove the access for all users in + that team. + parameters: + - description: Team ID + in: path + name: id + required: true + schema: + type: integer + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: The team was successfully deleted. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Invalid team object provided. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Deletes a team + tags: + - team + get: + description: Returns a team by its ID. + parameters: + - description: Team ID + in: path + name: id + required: true + schema: + type: integer + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Team' + description: The team + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: The user does not have access to the team + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Gets one team + tags: + - team + post: + description: Updates a team. + parameters: + - description: Team ID + in: path + name: id + required: true + schema: + type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/models.Team' + description: The team with updated values you want to update. + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Team' + description: The updated team. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Invalid team object provided. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Updates a team + tags: + - team + x-codegen-request-body-name: team + /teams/{id}/members: + put: + description: Add a user to a team. + parameters: + - description: Team ID + in: path + name: id + required: true + schema: + type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/models.TeamMember' + description: The user to be added to a team. + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '#/components/schemas/models.TeamMember' + description: The newly created member object + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Invalid member object provided. + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: The user does not have access to the team + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Add a user to a team + tags: + - team + x-codegen-request-body-name: team + /teams/{id}/members/{userID}: + delete: + description: Remove a user from a team. This will also revoke any access this + user might have via that team. A user can remove themselves from the team + if they are not the last user in the team. + parameters: + - description: Team ID + in: path + name: id + required: true + schema: + type: integer + - description: User ID + in: path + name: userID + required: true + schema: + type: integer + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: The user was successfully removed from the team. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Remove a user from a team + tags: + - team + /teams/{id}/members/{userID}/admin: + post: + description: "If a user is team admin, this will make them member and vise-versa." + parameters: + - description: Team ID + in: path + name: id + required: true + schema: + type: integer + - description: User ID + in: path + name: userID + required: true + schema: + type: integer + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: The member right was successfully changed. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Toggle a team member's admin status + tags: + - team + /test/{table}: + patch: + description: "Fills the specified table with the content provided in the payload.\ + \ You need to enable the testing endpoint before doing this and provide the\ + \ `Authorization: ` secret when making requests to this endpoint. See\ + \ docs for more details." + parameters: + - description: The table to reset + in: path + name: table + required: true + schema: + type: string + responses: + "201": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/user.User' + type: array + description: Everything has been imported successfully. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal server error. + summary: Reset the db to a defined state + tags: + - testing + /tokens: + get: + description: Returns all api tokens the current user has created. + parameters: + - description: "The page number, used for pagination. If not provided, the first\ + \ page of results is returned." + in: query + name: page + schema: + type: integer + - description: The maximum number of tokens per page. This parameter is limited + by the configured maximum of items per page. + in: query + name: per_page + schema: + type: integer + - description: Search tokens by their title. + in: query + name: s + schema: + type: string + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/models.APIToken' + type: array + description: The list of all tokens + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal server error + security: + - JWTKeyAuth: [] + summary: Get all api tokens of the current user + tags: + - api + put: + description: Create a new api token to use on behalf of the user creating it. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/models.APIToken' + description: The token object with required fields + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.APIToken' + description: The created token. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Invalid token object provided. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Create a new api token + tags: + - api + x-codegen-request-body-name: token + /tokens/{tokenID}: + delete: + description: Delete any of the user's api tokens. + parameters: + - description: Token ID + in: path + name: tokenID + required: true + schema: + type: integer + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Successfully deleted. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: The token does not exist. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Deletes an existing api token + tags: + - api + /user: + get: + description: Returns the current user object with their settings. + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/v1.UserWithSettings' + description: OK + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: User does not exist. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal server error. + security: + - JWTKeyAuth: [] + summary: Get user information + tags: + - user + /user/confirm: + post: + description: Confirms the email of a newly registered user. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/user.EmailConfirm' + description: The token. + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: OK + "412": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Bad token provided. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + summary: Confirm the email of a new user + tags: + - user + x-codegen-request-body-name: credentials + /user/deletion/cancel: + post: + description: Aborts an in-progress user deletion. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/v1.UserPasswordConfirmation' + description: The user password to confirm. + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: OK + "412": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Bad password provided. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + summary: Abort a user deletion request + tags: + - user + x-codegen-request-body-name: credentials + /user/deletion/confirm: + post: + description: Confirms the deletion request of a user sent via email. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/v1.UserDeletionRequestConfirm' + description: The token. + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: OK + "412": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Bad token provided. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + summary: Confirm a user deletion request + tags: + - user + x-codegen-request-body-name: credentials + /user/deletion/request: + post: + description: Requests the deletion of the current user. It will trigger an email + which has to be confirmed to start the deletion. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/v1.UserPasswordConfirmation' + description: The user password. + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: OK + "412": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Bad password provided. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + summary: Request the deletion of the user + tags: + - user + x-codegen-request-body-name: credentials + /user/export/download: + post: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/v1.UserPasswordConfirmation' + description: User password to confirm the download. + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Something's invalid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal server error. + security: + - JWTKeyAuth: [] + summary: Download a user data export. + tags: + - user + x-codegen-request-body-name: password + /user/export/request: + post: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/v1.UserPasswordConfirmation' + description: User password to confirm the data export request. + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Something's invalid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal server error. + security: + - JWTKeyAuth: [] + summary: Request a user data export. + tags: + - user + x-codegen-request-body-name: password + /user/password: + post: + description: Lets the current user change its password. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/v1.UserPassword' + description: The current and new password. + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Something's invalid. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: User does not exist. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal server error. + security: + - JWTKeyAuth: [] + summary: Change password + tags: + - user + x-codegen-request-body-name: userPassword + /user/password/reset: + post: + description: Resets a user email with a previously reset token. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/user.PasswordReset' + description: The token with the new password. + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Bad token provided. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + summary: Resets a password + tags: + - user + x-codegen-request-body-name: credentials + /user/password/token: + post: + description: Requests a token to reset a users password. The token is sent via + email. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/user.PasswordTokenRequest' + description: The username of the user to request a token for. + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: OK + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: The user does not exist. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + summary: Request password reset token + tags: + - user + x-codegen-request-body-name: credentials + /user/settings/avatar: + get: + description: Returns the current user's avatar setting. + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/v1.UserAvatarProvider' + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Something's invalid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal server error. + security: + - JWTKeyAuth: [] + summary: Return user avatar setting + tags: + - user + post: + description: "Changes the user avatar. Valid types are gravatar (uses the user\ + \ email), upload, initials, default." + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/v1.UserAvatarProvider' + description: The user's avatar setting + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Something's invalid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal server error. + security: + - JWTKeyAuth: [] + summary: Set the user's avatar + tags: + - user + x-codegen-request-body-name: avatar + /user/settings/avatar/upload: + put: + description: Upload a user avatar. This will also set the user's avatar provider + to "upload" + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/_user_settings_avatar_upload_put_request' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: The avatar was set successfully. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: File is no image. + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: File too large. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Upload a user avatar + tags: + - user + /user/settings/email: + post: + description: Lets the current user change their email address. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/user.EmailUpdate' + description: The new email address and current password. + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Something's invalid. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: User does not exist. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal server error. + security: + - JWTKeyAuth: [] + summary: Update email address + tags: + - user + x-codegen-request-body-name: userEmailUpdate + /user/settings/general: + post: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/v1.UserSettings' + description: The updated user settings + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Something's invalid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal server error. + security: + - JWTKeyAuth: [] + summary: Change general user settings of the current user. + tags: + - user + x-codegen-request-body-name: avatar + /user/settings/token/caldav: + get: + description: Return the IDs and created dates of all caldav tokens for the current + user. + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/user.Token' + type: array + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Something's invalid. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: User does not exist. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal server error. + security: + - JWTKeyAuth: [] + summary: Returns the caldav tokens for the current user + tags: + - user + put: + description: Generates a caldav token which can be used for the caldav api. + It is not possible to see the token again after it was generated. + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/user.Token' + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Something's invalid. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: User does not exist. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal server error. + security: + - JWTKeyAuth: [] + summary: Generate a caldav token + tags: + - user + /user/settings/token/caldav/{id}: + get: + parameters: + - description: Token ID + in: path + name: id + required: true + schema: + type: integer + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Something's invalid. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: User does not exist. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal server error. + security: + - JWTKeyAuth: [] + summary: Delete a caldav token by id + tags: + - user + /user/settings/totp: + get: + description: Returns the current user totp setting or an error if it is not + enabled. + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/user.TOTP' + description: The totp settings. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal server error. + security: + - JWTKeyAuth: [] + summary: Totp setting for the current user + tags: + - user + /user/settings/totp/disable: + post: + description: Disables any totp settings for the current user. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/user.Login' + description: The current user's password (only password is enough). + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Successfully disabled + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Something's invalid. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: User does not exist. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal server error. + security: + - JWTKeyAuth: [] + summary: Disable totp settings + tags: + - user + x-codegen-request-body-name: totp + /user/settings/totp/enable: + post: + description: Enables a previously enrolled totp setting by providing a totp + passcode. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/user.TOTPPasscode' + description: The totp passcode. + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Successfully enabled + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Something's invalid. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: User does not exist. + "412": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: TOTP is not enrolled. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal server error. + security: + - JWTKeyAuth: [] + summary: Enable a previously enrolled totp setting. + tags: + - user + x-codegen-request-body-name: totp + /user/settings/totp/enroll: + post: + description: "Creates an initial setup for the user in the db. After this step,\ + \ the user needs to verify they have a working totp setup with the \"enable\ + \ totp\" endpoint." + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/user.TOTP' + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Something's invalid. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: User does not exist. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal server error. + security: + - JWTKeyAuth: [] + summary: Enroll a user into totp + tags: + - user + /user/settings/totp/qrcode: + get: + description: Returns a qr code for easier setup at end user's devices. + responses: + "200": + content: + application/json: + schema: + format: binary + type: string + description: The qr code as jpeg image + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal server error. + security: + - JWTKeyAuth: [] + summary: Totp QR Code + tags: + - user + /user/timezones: + get: + description: "Because available time zones depend on the system Vikunja is running\ + \ on, this endpoint returns a project of all valid time zones this particular\ + \ Vikunja instance can handle. The project of time zones is not sorted, you\ + \ should sort it on the client." + responses: + "200": + content: + application/json: + schema: + items: + type: string + type: array + description: All available time zones. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal server error. + security: + - JWTKeyAuth: [] + summary: Get all available time zones on this vikunja instance + tags: + - user + /user/token: + post: + description: Returns a new valid jwt user token with an extended length. + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/auth.Token' + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Only user token are available for renew. + summary: Renew user token + tags: + - user + /users: + get: + description: "Search for a user by its username, name or full email. Name (not\ + \ username) or email require that the user has enabled this in their settings." + parameters: + - description: The search criteria. + in: query + name: s + schema: + type: string + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/user.User' + type: array + description: All (found) users. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: Something's invalid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal server error. + security: + - JWTKeyAuth: [] + summary: Get users + tags: + - user + /webhooks/events: + get: + description: Get all possible webhook events to use when creating or updating + a webhook target. + responses: + "200": + content: + application/json: + schema: + items: + type: string + type: array + description: The list of all possible webhook events + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal server error + security: + - JWTKeyAuth: [] + summary: Get all possible webhook events + tags: + - webhooks + /{kind}/{id}/reactions: + get: + description: Returns all reactions for an entity + parameters: + - description: Entity ID + in: path + name: id + required: true + schema: + type: integer + - description: The kind of the entity. Can be either `tasks` or `comments` for + task comments + in: path + name: kind + required: true + schema: + type: integer + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/models.ReactionMap' + type: array + description: The reactions + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: The user does not have access to the entity + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Get all reactions for an entity + tags: + - task + put: + description: Add a reaction to an entity. Will do nothing if the reaction already + exists. + parameters: + - description: Entity ID + in: path + name: id + required: true + schema: + type: integer + - description: The kind of the entity. Can be either `tasks` or `comments` for + task comments + in: path + name: kind + required: true + schema: + type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/models.Reaction' + description: The reaction you want to add to the entity. + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Reaction' + description: The created reaction + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: The user does not have access to the entity + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Add a reaction to an entity + tags: + - task + x-codegen-request-body-name: project + /{kind}/{id}/reactions/delete: + post: + description: Removes the reaction of that user on that entity. + parameters: + - description: Entity ID + in: path + name: id + required: true + schema: + type: integer + - description: The kind of the entity. Can be either `tasks` or `comments` for + task comments + in: path + name: kind + required: true + schema: + type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/models.Reaction' + description: The reaction you want to add to the entity. + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: The reaction was successfully removed. + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/web.HTTPError' + description: The user does not have access to the entity + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + security: + - JWTKeyAuth: [] + summary: Removes the user's reaction + tags: + - task + x-codegen-request-body-name: project + /{username}/avatar: + get: + description: Returns the user avatar as image. + parameters: + - description: The username of the user who's avatar you want to get + in: path + name: username + required: true + schema: + type: string + - description: The size of the avatar you want to get. If bigger than the max + configured size this will be adjusted to the maximum size. + in: query + name: size + schema: + type: integer + responses: + "200": + content: + application/octet-stream: + schema: + format: binary + type: string + description: The avatar + "404": + content: + application/octet-stream: + schema: + $ref: '#/components/schemas/models.Message' + description: The user does not exist. + "500": + content: + application/octet-stream: + schema: + $ref: '#/components/schemas/models.Message' + description: Internal error + summary: User Avatar + tags: + - user +components: + schemas: + auth.Token: + example: + token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c + properties: + token: + example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c + type: string + type: object + background.Image: + example: + thumb: thumb + blur_hash: blur_hash + id: id + url: url + info: "{}" + properties: + blur_hash: + type: string + id: + type: string + info: + description: This can be used to supply extra information from an image + provider to clients + type: object + thumb: + type: string + url: + type: string + type: object + files.File: + example: + size: 6 + created: created + mime: mime + name: name + id: 0 + properties: + created: + type: string + id: + type: integer + mime: + type: string + name: + type: string + size: + type: integer + type: object + handler.AuthURL: + example: + url: url + properties: + url: + type: string + type: object + microsofttodo.Migration: + properties: + code: + type: string + type: object + migration.Status: + example: + migrator_name: migrator_name + finished_at: finished_at + started_at: started_at + id: 0 + properties: + finished_at: + type: string + id: + type: integer + migrator_name: + type: string + started_at: + type: string + type: object + models.APIPermissions: + additionalProperties: + items: + type: string + type: array + type: object + models.APIToken: + example: + expires_at: expires_at + created: created + permissions: "{}" + id: 0 + title: title + token: token + properties: + created: + description: A timestamp when this api key was created. You cannot change + this value. + type: string + expires_at: + description: The date when this key expires. + type: string + id: + description: "The unique, numeric id of this api key." + type: integer + permissions: + allOf: + - $ref: '#/components/schemas/models.APIPermissions' + description: "The permissions this token has. Possible values are available\ + \ via the /routes endpoint and consist of the keys of the list from that\ + \ endpoint. For example, if the token should be able to read all tasks\ + \ as well as update existing tasks, you should add `{\"tasks\":[\"read_all\"\ + ,\"update\"]}`." + type: object + title: + description: A human-readable name for this token + type: string + token: + description: The actual api key. Only visible after creation. + type: string + type: object + models.APITokenRoute: + additionalProperties: + $ref: '#/components/schemas/models.RouteDetail' + type: object + models.Bucket: + example: + created: created + count: 0 + limit: 0 + project_view_id: 5 + id: 6 + position: 5.962133916683182 + title: title + created_by: null + updated: updated + tasks: + - end_date: end_date + reminders: + - relative_to: "{}" + reminder: reminder + relative_period: 1 + - relative_to: "{}" + reminder: reminder + relative_period: 1 + percent_done: 3.616076749251911 + attachments: + - file: + size: 6 + created: created + mime: mime + name: name + id: 0 + created: created + task_id: 5 + id: 1 + created_by: + created: created + name: name + id: 0 + updated: updated + email: email + username: username + - file: + size: 6 + created: created + mime: mime + name: name + id: 0 + created: created + task_id: 5 + id: 1 + created_by: + created: created + name: name + id: 0 + updated: updated + email: email + username: username + is_favorite: true + done_at: done_at + repeat_after: 1 + assignees: + - created: created + name: name + id: 0 + updated: updated + email: email + username: username + - created: created + name: name + id: 0 + updated: updated + email: email + username: username + description: description + related_tasks: "{}" + cover_image_attachment_id: 2 + subscription: null + title: title + bucket_id: 5 + project_id: 7 + id: 7 + start_date: start_date + identifier: identifier + created: created + due_date: due_date + index: 9 + hex_color: hex_color + priority: 4 + created_by: null + done: true + labels: + - created: created + description: description + id: 0 + hex_color: hex_color + title: title + created_by: null + updated: updated + - created: created + description: description + id: 0 + hex_color: hex_color + title: title + created_by: null + updated: updated + repeat_mode: "{}" + reactions: "{}" + position: 2.027123023002322 + updated: updated + - end_date: end_date + reminders: + - relative_to: "{}" + reminder: reminder + relative_period: 1 + - relative_to: "{}" + reminder: reminder + relative_period: 1 + percent_done: 3.616076749251911 + attachments: + - file: + size: 6 + created: created + mime: mime + name: name + id: 0 + created: created + task_id: 5 + id: 1 + created_by: + created: created + name: name + id: 0 + updated: updated + email: email + username: username + - file: + size: 6 + created: created + mime: mime + name: name + id: 0 + created: created + task_id: 5 + id: 1 + created_by: + created: created + name: name + id: 0 + updated: updated + email: email + username: username + is_favorite: true + done_at: done_at + repeat_after: 1 + assignees: + - created: created + name: name + id: 0 + updated: updated + email: email + username: username + - created: created + name: name + id: 0 + updated: updated + email: email + username: username + description: description + related_tasks: "{}" + cover_image_attachment_id: 2 + subscription: null + title: title + bucket_id: 5 + project_id: 7 + id: 7 + start_date: start_date + identifier: identifier + created: created + due_date: due_date + index: 9 + hex_color: hex_color + priority: 4 + created_by: null + done: true + labels: + - created: created + description: description + id: 0 + hex_color: hex_color + title: title + created_by: null + updated: updated + - created: created + description: description + id: 0 + hex_color: hex_color + title: title + created_by: null + updated: updated + repeat_mode: "{}" + reactions: "{}" + position: 2.027123023002322 + updated: updated + properties: + count: + description: The number of tasks currently in this bucket + type: integer + created: + description: A timestamp when this bucket was created. You cannot change + this value. + type: string + created_by: + $ref: '#/components/schemas/models_Bucket_created_by' + id: + description: "The unique, numeric id of this bucket." + type: integer + limit: + description: How many tasks can be at the same time on this board max + minimum: 0 + type: integer + position: + description: The position this bucket has when querying all buckets. See + the tasks.position property on how to use this. + type: number + project_view_id: + description: The project view this bucket belongs to. + type: integer + tasks: + description: All tasks which belong to this bucket. + items: + $ref: '#/components/schemas/models.Task' + type: array + title: + description: The title of this bucket. + minLength: 1 + type: string + updated: + description: A timestamp when this bucket was last updated. You cannot change + this value. + type: string + type: object + models.BucketConfigurationModeKind: + enum: + - 0 + - 1 + - 2 + type: integer + x-enum-varnames: + - BucketConfigurationModeNone + - BucketConfigurationModeManual + - BucketConfigurationModeFilter + models.BulkAssignees: + properties: + assignees: + description: A project with all assignees + items: + $ref: '#/components/schemas/user.User' + type: array + type: object + models.BulkTask: + properties: + assignees: + description: An array of users who are assigned to this task + items: + $ref: '#/components/schemas/user.User' + type: array + attachments: + description: "All attachments this task has. This property is read-onlym,\ + \ you must use the separate endpoint to add attachments to a task." + items: + $ref: '#/components/schemas/models.TaskAttachment' + type: array + bucket_id: + description: "The bucket id. Will only be populated when the task is accessed\ + \ via a view with buckets.\nCan be used to move a task between buckets.\ + \ In that case, the new bucket must be in the same view as the old one." + type: integer + cover_image_attachment_id: + description: "If this task has a cover image, the field will return the\ + \ id of the attachment that is the cover image." + type: integer + created: + description: A timestamp when this task was created. You cannot change this + value. + type: string + created_by: + $ref: '#/components/schemas/models_BulkTask_created_by' + description: + description: The task description. + type: string + done: + description: Whether a task is done or not. + type: boolean + done_at: + description: The time when a task was marked as done. + type: string + due_date: + description: The time when the task is due. + type: string + end_date: + description: When this task ends. + type: string + hex_color: + description: The task color in hex + maxLength: 7 + type: string + id: + description: "The unique, numeric id of this task." + type: integer + identifier: + description: "The task identifier, based on the project identifier and the\ + \ task's index" + type: string + index: + description: "The task index, calculated per project" + type: integer + is_favorite: + description: True if a task is a favorite task. Favorite tasks show up in + a separate "Important" project. This value depends on the user making + the call to the api. + type: boolean + labels: + description: "An array of labels which are associated with this task. This\ + \ property is read-only, you must use the separate endpoint to add labels\ + \ to a task." + items: + $ref: '#/components/schemas/models.Label' + type: array + percent_done: + description: Determines how far a task is left from being done + type: number + position: + description: "The position of the task - any task project can be sorted\ + \ as usual by this parameter.\nWhen accessing tasks via views with buckets,\ + \ this is primarily used to sort them based on a range.\nPositions are\ + \ always saved per view. They will automatically be set if you request\ + \ the tasks through a view\nendpoint, otherwise they will always be 0.\ + \ To update them, take a look at the Task Position endpoint." + type: number + priority: + description: "The task priority. Can be anything you want, it is possible\ + \ to sort by this later." + type: integer + project_id: + description: The project this task belongs to. + type: integer + reactions: + allOf: + - $ref: '#/components/schemas/models.ReactionMap' + description: Reactions on that task. + type: object + related_tasks: + allOf: + - $ref: '#/components/schemas/models.RelatedTaskMap' + description: "All related tasks, grouped by their relation kind" + type: object + reminders: + description: An array of reminders that are associated with this task. + items: + $ref: '#/components/schemas/models.TaskReminder' + type: array + repeat_after: + 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." + type: integer + repeat_mode: + allOf: + - $ref: '#/components/schemas/models.TaskRepeatMode' + description: "Can have three possible values which will trigger when the\ + \ task is marked as done: 0 = repeats after the amount specified in repeat_after,\ + \ 1 = repeats all dates each months (ignoring repeat_after), 3 = repeats\ + \ from the current date rather than the last set date." + type: object + start_date: + description: When this task starts. + type: string + subscription: + $ref: '#/components/schemas/models_BulkTask_subscription' + task_ids: + description: A project of task ids to update + items: + type: integer + type: array + title: + description: The task text. This is what you'll see in the project. + minLength: 1 + type: string + updated: + description: A timestamp when this task was last updated. You cannot change + this value. + type: string + type: object + models.DatabaseNotifications: + example: + notification: "{}" + read: true + created: created + name: name + read_at: read_at + id: 0 + properties: + created: + description: A timestamp when this notification was created. You cannot + change this value. + type: string + id: + description: "The unique, numeric id of this notification." + type: integer + name: + description: The name of the notification + type: string + notification: + description: The actual content of the notification. + type: object + read: + description: "Whether or not to mark this notification as read or unread.\n\ + True is read, false is unread." + type: boolean + read_at: + description: "When this notification is marked as read, this will be updated\ + \ with the current timestamp." + type: string + type: object + models.Label: + example: + created: created + description: description + id: 0 + hex_color: hex_color + title: title + created_by: null + updated: updated + properties: + created: + description: A timestamp when this label was created. You cannot change + this value. + type: string + created_by: + $ref: '#/components/schemas/models_Label_created_by' + description: + description: The label description. + type: string + hex_color: + description: The color this label has in hex format. + maxLength: 7 + type: string + id: + description: "The unique, numeric id of this label." + type: integer + title: + description: The title of the lable. You'll see this one on tasks associated + with it. + maxLength: 250 + minLength: 1 + type: string + updated: + description: A timestamp when this label was last updated. You cannot change + this value. + type: string + type: object + models.LabelTask: + example: + created: created + label_id: 0 + properties: + created: + description: A timestamp when this task was created. You cannot change this + value. + type: string + label_id: + description: The label id you want to associate with a task. + type: integer + type: object + models.LabelTaskBulk: + example: + labels: + - created: created + description: description + id: 0 + hex_color: hex_color + title: title + created_by: null + updated: updated + - created: created + description: description + id: 0 + hex_color: hex_color + title: title + created_by: null + updated: updated + properties: + labels: + description: All labels you want to update at once. + items: + $ref: '#/components/schemas/models.Label' + type: array + type: object + models.LinkSharing: + example: + password: password + created: created + name: name + shared_by: null + id: 0 + right: "{}" + sharing_type: "{}" + updated: updated + hash: hash + properties: + created: + description: A timestamp when this project was shared. You cannot change + this value. + type: string + hash: + description: The public id to get this shared project + type: string + id: + description: The ID of the shared thing + type: integer + name: + description: The name of this link share. All actions someone takes while + being authenticated with that link will appear with that name. + type: string + password: + description: "The password of this link share. You can only set it, not\ + \ retrieve it after the link share has been created." + type: string + right: + allOf: + - $ref: '#/components/schemas/models.Right' + description: "The right this project is shared with. 0 = Read only, 1 =\ + \ Read & Write, 2 = Admin. See the docs for more details." + type: object + shared_by: + $ref: '#/components/schemas/models_LinkSharing_shared_by' + sharing_type: + allOf: + - $ref: '#/components/schemas/models.SharingType' + description: "The kind of this link. 0 = undefined, 1 = without password,\ + \ 2 = with password." + type: object + updated: + description: A timestamp when this share was last updated. You cannot change + this value. + type: string + type: object + models.Message: + example: + message: message + properties: + message: + description: A standard message. + type: string + type: object + models.Project: + example: + owner: null + identifier: identifier + is_favorite: true + created: created + description: description + subscription: null + hex_color: hex_color + title: title + is_archived: true + background_information: "{}" + id: 0 + position: 1.4658129805029452 + background_blur_hash: background_blur_hash + parent_project_id: 6 + updated: updated + views: + - filter: filter + default_bucket_id: 5 + project_id: 9 + created: created + bucket_configuration: + - filter: filter + title: title + - filter: filter + title: title + done_bucket_id: 5 + view_kind: "{}" + bucket_configuration_mode: "{}" + id: 2 + position: 7.061401241503109 + title: title + updated: updated + - filter: filter + default_bucket_id: 5 + project_id: 9 + created: created + bucket_configuration: + - filter: filter + title: title + - filter: filter + title: title + done_bucket_id: 5 + view_kind: "{}" + bucket_configuration_mode: "{}" + id: 2 + position: 7.061401241503109 + title: title + updated: updated + properties: + background_blur_hash: + description: Contains a very small version of the project background to + use as a blurry preview until the actual background is loaded. Check out + https://blurha.sh/ to learn how it works. + type: string + background_information: + description: "Holds extra information about the background set since some\ + \ background providers require attribution or similar. If not null, the\ + \ background can be accessed at /projects/{projectID}/background" + type: object + created: + description: A timestamp when this project was created. You cannot change + this value. + type: string + description: + description: The description of the project. + type: string + hex_color: + description: The hex color of this project + maxLength: 7 + type: string + id: + description: "The unique, numeric id of this project." + type: integer + identifier: + description: The unique project short identifier. Used to build task identifiers. + maxLength: 10 + minLength: 0 + type: string + is_archived: + description: Whether a project is archived. + type: boolean + is_favorite: + description: True if a project is a favorite. Favorite projects show up + in a separate parent project. This value depends on the user making the + call to the api. + type: boolean + owner: + $ref: '#/components/schemas/models_Project_owner' + parent_project_id: + type: integer + position: + description: The position this project has when querying all projects. See + the tasks.position property on how to use this. + type: number + subscription: + $ref: '#/components/schemas/models_Project_subscription' + title: + description: The title of the project. You'll see this in the overview. + maxLength: 250 + minLength: 1 + type: string + updated: + description: A timestamp when this project was last updated. You cannot + change this value. + type: string + views: + items: + $ref: '#/components/schemas/models.ProjectView' + type: array + type: object + models.ProjectDuplicate: + example: + duplicated_project: null + parent_project_id: 0 + properties: + duplicated_project: + $ref: '#/components/schemas/models_ProjectDuplicate_duplicated_project' + parent_project_id: + description: The target parent project + type: integer + type: object + models.ProjectUser: + example: + user_id: user_id + created: created + id: 0 + right: "{}" + updated: updated + properties: + created: + description: A timestamp when this relation was created. You cannot change + this value. + type: string + id: + description: "The unique, numeric id of this project <-> user relation." + type: integer + right: + allOf: + - $ref: '#/components/schemas/models.Right' + description: "The right this user has. 0 = Read only, 1 = Read & Write,\ + \ 2 = Admin. See the docs for more details." + type: object + updated: + description: A timestamp when this relation was last updated. You cannot + change this value. + type: string + user_id: + description: The username. + type: string + type: object + models.ProjectView: + example: + filter: filter + default_bucket_id: 5 + project_id: 9 + created: created + bucket_configuration: + - filter: filter + title: title + - filter: filter + title: title + done_bucket_id: 5 + view_kind: "{}" + bucket_configuration_mode: "{}" + id: 2 + position: 7.061401241503109 + title: title + updated: updated + properties: + bucket_configuration: + description: "When the bucket configuration mode is not `manual`, this field\ + \ holds the options of that configuration." + items: + $ref: '#/components/schemas/models.ProjectViewBucketConfiguration' + type: array + bucket_configuration_mode: + allOf: + - $ref: '#/components/schemas/models.BucketConfigurationModeKind' + description: "The bucket configuration mode. Can be `none`, `manual` or\ + \ `filter`. `manual` allows to move tasks between buckets as you normally\ + \ would. `filter` creates buckets based on a filter for each bucket." + type: object + created: + description: A timestamp when this reaction was created. You cannot change + this value. + type: string + default_bucket_id: + description: "The ID of the bucket where new tasks without a bucket are\ + \ added to. By default, this is the leftmost bucket in a view." + type: integer + done_bucket_id: + description: "If tasks are moved to the done bucket, they are marked as\ + \ done. If they are marked as done individually, they are moved into the\ + \ done bucket." + type: integer + filter: + description: The filter query to match tasks by. Check out https://vikunja.io/docs/filters + for a full explanation. + type: string + id: + description: The unique numeric id of this view + type: integer + position: + description: The position of this view in the list. The list of all views + will be sorted by this parameter. + type: number + project_id: + description: The project this view belongs to + type: integer + title: + description: The title of this view + type: string + updated: + description: A timestamp when this view was updated. You cannot change this + value. + type: string + view_kind: + allOf: + - $ref: '#/components/schemas/models.ProjectViewKind' + description: "The kind of this view. Can be `list`, `gantt`, `table` or\ + \ `kanban`." + type: object + type: object + models.ProjectViewBucketConfiguration: + example: + filter: filter + title: title + properties: + filter: + type: string + title: + type: string + type: object + models.ProjectViewKind: + enum: + - 0 + - 1 + - 2 + - 3 + type: integer + x-enum-varnames: + - ProjectViewKindList + - ProjectViewKindGantt + - ProjectViewKindTable + - ProjectViewKindKanban + models.Reaction: + example: + created: created + user: null + value: value + properties: + created: + description: A timestamp when this reaction was created. You cannot change + this value. + type: string + user: + $ref: '#/components/schemas/models_Reaction_user' + value: + description: "The actual reaction. This can be any valid utf character or\ + \ text, up to a length of 20." + type: string + type: object + models.ReactionMap: + additionalProperties: + items: + $ref: '#/components/schemas/user.User' + type: array + type: object + models.RelatedTaskMap: + additionalProperties: + items: + $ref: '#/components/schemas/models.Task' + type: array + type: object + models.RelationKind: + enum: + - unknown + - subtask + - parenttask + - related + - duplicateof + - duplicates + - blocking + - blocked + - precedes + - follows + - copiedfrom + - copiedto + type: string + x-enum-varnames: + - RelationKindUnknown + - RelationKindSubtask + - RelationKindParenttask + - RelationKindRelated + - RelationKindDuplicateOf + - RelationKindDuplicates + - RelationKindBlocking + - RelationKindBlocked + - RelationKindPreceeds + - RelationKindFollows + - RelationKindCopiedFrom + - RelationKindCopiedTo + models.ReminderRelation: + enum: + - due_date + - start_date + - end_date + type: string + x-enum-varnames: + - ReminderRelationDueDate + - ReminderRelationStartDate + - ReminderRelationEndDate + models.Right: + enum: + - 0 + - 1 + - 2 + type: integer + x-enum-varnames: + - RightRead + - RightWrite + - RightAdmin + models.RouteDetail: + properties: + method: + type: string + path: + type: string + type: object + models.SavedFilter: + example: + owner: null + is_favorite: true + created: created + description: description + filters: null + id: 0 + title: title + updated: updated + properties: + created: + description: A timestamp when this filter was created. You cannot change + this value. + type: string + description: + description: The description of the filter + type: string + filters: + $ref: '#/components/schemas/models_SavedFilter_filters' + id: + description: The unique numeric id of this saved filter + type: integer + is_favorite: + description: True if the filter is a favorite. Favorite filters show up + in a separate parent project together with favorite projects. + type: boolean + owner: + $ref: '#/components/schemas/models_SavedFilter_owner' + title: + description: The title of the filter. + maxLength: 250 + minLength: 1 + type: string + updated: + description: A timestamp when this filter was last updated. You cannot change + this value. + type: string + type: object + models.SharingType: + enum: + - 0 + - 1 + - 2 + type: integer + x-enum-varnames: + - SharingTypeUnknown + - SharingTypeWithoutPassword + - SharingTypeWithPassword + models.Subscription: + example: + created: created + id: 1 + entity_id: 6 + entity: 0 + properties: + created: + description: A timestamp when this subscription was created. You cannot + change this value. + type: string + entity: + type: integer + entity_id: + description: The id of the entity to subscribe to. + type: integer + id: + description: The numeric ID of the subscription + type: integer + type: object + models.Task: + example: + end_date: end_date + reminders: + - relative_to: "{}" + reminder: reminder + relative_period: 1 + - relative_to: "{}" + reminder: reminder + relative_period: 1 + percent_done: 3.616076749251911 + attachments: + - file: + size: 6 + created: created + mime: mime + name: name + id: 0 + created: created + task_id: 5 + id: 1 + created_by: + created: created + name: name + id: 0 + updated: updated + email: email + username: username + - file: + size: 6 + created: created + mime: mime + name: name + id: 0 + created: created + task_id: 5 + id: 1 + created_by: + created: created + name: name + id: 0 + updated: updated + email: email + username: username + is_favorite: true + done_at: done_at + repeat_after: 1 + assignees: + - created: created + name: name + id: 0 + updated: updated + email: email + username: username + - created: created + name: name + id: 0 + updated: updated + email: email + username: username + description: description + related_tasks: "{}" + cover_image_attachment_id: 2 + subscription: null + title: title + bucket_id: 5 + project_id: 7 + id: 7 + start_date: start_date + identifier: identifier + created: created + due_date: due_date + index: 9 + hex_color: hex_color + priority: 4 + created_by: null + done: true + labels: + - created: created + description: description + id: 0 + hex_color: hex_color + title: title + created_by: null + updated: updated + - created: created + description: description + id: 0 + hex_color: hex_color + title: title + created_by: null + updated: updated + repeat_mode: "{}" + reactions: "{}" + position: 2.027123023002322 + updated: updated + properties: + assignees: + description: An array of users who are assigned to this task + items: + $ref: '#/components/schemas/user.User' + type: array + attachments: + description: "All attachments this task has. This property is read-onlym,\ + \ you must use the separate endpoint to add attachments to a task." + items: + $ref: '#/components/schemas/models.TaskAttachment' + type: array + bucket_id: + description: "The bucket id. Will only be populated when the task is accessed\ + \ via a view with buckets.\nCan be used to move a task between buckets.\ + \ In that case, the new bucket must be in the same view as the old one." + type: integer + cover_image_attachment_id: + description: "If this task has a cover image, the field will return the\ + \ id of the attachment that is the cover image." + type: integer + created: + description: A timestamp when this task was created. You cannot change this + value. + type: string + created_by: + $ref: '#/components/schemas/models_BulkTask_created_by' + description: + description: The task description. + type: string + done: + description: Whether a task is done or not. + type: boolean + done_at: + description: The time when a task was marked as done. + type: string + due_date: + description: The time when the task is due. + type: string + end_date: + description: When this task ends. + type: string + hex_color: + description: The task color in hex + maxLength: 7 + type: string + id: + description: "The unique, numeric id of this task." + type: integer + identifier: + description: "The task identifier, based on the project identifier and the\ + \ task's index" + type: string + index: + description: "The task index, calculated per project" + type: integer + is_favorite: + description: True if a task is a favorite task. Favorite tasks show up in + a separate "Important" project. This value depends on the user making + the call to the api. + type: boolean + labels: + description: "An array of labels which are associated with this task. This\ + \ property is read-only, you must use the separate endpoint to add labels\ + \ to a task." + items: + $ref: '#/components/schemas/models.Label' + type: array + percent_done: + description: Determines how far a task is left from being done + type: number + position: + description: "The position of the task - any task project can be sorted\ + \ as usual by this parameter.\nWhen accessing tasks via views with buckets,\ + \ this is primarily used to sort them based on a range.\nPositions are\ + \ always saved per view. They will automatically be set if you request\ + \ the tasks through a view\nendpoint, otherwise they will always be 0.\ + \ To update them, take a look at the Task Position endpoint." + type: number + priority: + description: "The task priority. Can be anything you want, it is possible\ + \ to sort by this later." + type: integer + project_id: + description: The project this task belongs to. + type: integer + reactions: + allOf: + - $ref: '#/components/schemas/models.ReactionMap' + description: Reactions on that task. + type: object + related_tasks: + allOf: + - $ref: '#/components/schemas/models.RelatedTaskMap' + description: "All related tasks, grouped by their relation kind" + type: object + reminders: + description: An array of reminders that are associated with this task. + items: + $ref: '#/components/schemas/models.TaskReminder' + type: array + repeat_after: + 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." + type: integer + repeat_mode: + allOf: + - $ref: '#/components/schemas/models.TaskRepeatMode' + description: "Can have three possible values which will trigger when the\ + \ task is marked as done: 0 = repeats after the amount specified in repeat_after,\ + \ 1 = repeats all dates each months (ignoring repeat_after), 3 = repeats\ + \ from the current date rather than the last set date." + type: object + start_date: + description: When this task starts. + type: string + subscription: + $ref: '#/components/schemas/models_BulkTask_subscription' + title: + description: The task text. This is what you'll see in the project. + minLength: 1 + type: string + updated: + description: A timestamp when this task was last updated. You cannot change + this value. + type: string + type: object + models.TaskAssginee: + example: + user_id: 0 + created: created + properties: + created: + type: string + user_id: + type: integer + type: object + models.TaskAttachment: + example: + file: + size: 6 + created: created + mime: mime + name: name + id: 0 + created: created + task_id: 5 + id: 1 + created_by: + created: created + name: name + id: 0 + updated: updated + email: email + username: username + properties: + created: + type: string + created_by: + $ref: '#/components/schemas/user.User' + file: + $ref: '#/components/schemas/files.File' + id: + type: integer + task_id: + type: integer + type: object + models.TaskBucket: + example: + bucket_id: 0 + project_view_id: 6 + task_id: 1 + task_done: true + properties: + bucket_id: + type: integer + project_view_id: + type: integer + task_done: + type: boolean + task_id: + type: integer + type: object + models.TaskCollection: + properties: + filter: + description: The filter query to match tasks by. Check out https://vikunja.io/docs/filters + for a full explanation. + type: string + filter_include_nulls: + description: "If set to true, the result will also include null values" + type: boolean + order_by: + description: "The query parameter to order the items by. This can be either\ + \ asc or desc, with asc being the default." + items: + type: string + type: array + sort_by: + description: "The query parameter to sort by. This is for ex. done, priority,\ + \ etc." + items: + type: string + type: array + type: object + models.TaskComment: + example: + author: + created: created + name: name + id: 0 + updated: updated + email: email + username: username + created: created + comment: comment + reactions: + key: + - created: created + name: name + id: 0 + updated: updated + email: email + username: username + - created: created + name: name + id: 0 + updated: updated + email: email + username: username + id: 0 + updated: updated + properties: + author: + $ref: '#/components/schemas/user.User' + comment: + type: string + created: + type: string + id: + type: integer + reactions: + additionalProperties: + items: + $ref: '#/components/schemas/user.User' + type: array + type: object + updated: + type: string + type: object + models.TaskPosition: + example: + project_view_id: 6 + task_id: 1 + position: 0.8008281904610115 + properties: + position: + description: "The position of the task - any task project can be sorted\ + \ as usual by this parameter.\nWhen accessing tasks via kanban buckets,\ + \ this is primarily used to sort them based on a range\nWe're using a\ + \ float64 here to make it possible to put any task within any two other\ + \ tasks (by changing the number).\nYou would calculate the new position\ + \ between two tasks with something like task3.position = (task2.position\ + \ - task1.position) / 2.\nA 64-Bit float leaves plenty of room to initially\ + \ give tasks a position with 2^16 difference to the previous task\nwhich\ + \ also leaves a lot of room for rearranging and sorting later.\nPositions\ + \ are always saved per view. They will automatically be set if you request\ + \ the tasks through a view\nendpoint, otherwise they will always be 0.\ + \ To update them, take a look at the Task Position endpoint." + type: number + project_view_id: + description: The project view this task is related to + type: integer + task_id: + description: The ID of the task this position is for + type: integer + type: object + models.TaskRelation: + example: + created: created + relation_kind: "{}" + task_id: 6 + created_by: null + other_task_id: 0 + properties: + created: + description: A timestamp when this label was created. You cannot change + this value. + type: string + created_by: + $ref: '#/components/schemas/models_TaskRelation_created_by' + other_task_id: + description: "The ID of the other task, the task which is being related." + type: integer + relation_kind: + allOf: + - $ref: '#/components/schemas/models.RelationKind' + description: The kind of the relation. + type: object + task_id: + description: "The ID of the \"base\" task, the task which has a relation\ + \ to another." + type: integer + type: object + models.TaskReminder: + example: + relative_to: "{}" + reminder: reminder + relative_period: 1 + properties: + relative_period: + description: "A period in seconds relative to another date argument. Negative\ + \ values mean the reminder triggers before the date. Default: 0, tiggers\ + \ when RelativeTo is due." + type: integer + relative_to: + allOf: + - $ref: '#/components/schemas/models.ReminderRelation' + description: The name of the date field to which the relative period refers + to. + type: object + reminder: + description: The absolute time when the user wants to be reminded of the + task. + type: string + type: object + models.TaskRepeatMode: + enum: + - 0 + - 1 + - 2 + type: integer + x-enum-varnames: + - TaskRepeatModeDefault + - TaskRepeatModeMonth + - TaskRepeatModeFromCurrentDate + models.Team: + example: + oidc_id: oidc_id + include_public: true + created: created + members: + - created: created + name: name + admin: true + id: 6 + updated: updated + email: email + username: username + - created: created + name: name + admin: true + id: 6 + updated: updated + email: email + username: username + is_public: true + name: name + description: description + id: 0 + created_by: null + updated: updated + properties: + created: + description: A timestamp when this relation was created. You cannot change + this value. + type: string + created_by: + $ref: '#/components/schemas/models_Team_created_by' + description: + description: The team's description. + type: string + id: + description: "The unique, numeric id of this team." + type: integer + include_public: + description: Query parameter controlling whether to include public projects + or not + type: boolean + is_public: + description: Defines wether the team should be publicly discoverable when + sharing a project + type: boolean + members: + description: An array of all members in this team. + items: + $ref: '#/components/schemas/models.TeamUser' + type: array + name: + description: The name of this team. + maxLength: 250 + minLength: 1 + type: string + oidc_id: + description: The team's oidc id delivered by the oidc provider + maxLength: 250 + type: string + updated: + description: A timestamp when this relation was last updated. You cannot + change this value. + type: string + type: object + models.TeamMember: + example: + created: created + admin: true + id: 0 + username: username + properties: + admin: + description: Whether or not the member is an admin of the team. See the + docs for more about what a team admin can do + type: boolean + created: + description: A timestamp when this relation was created. You cannot change + this value. + type: string + id: + description: "The unique, numeric id of this team member relation." + type: integer + username: + description: The username of the member. We use this to prevent automated + user id entering. + type: string + type: object + models.TeamProject: + example: + created: created + id: 0 + right: "{}" + team_id: 6 + updated: updated + properties: + created: + description: A timestamp when this relation was created. You cannot change + this value. + type: string + id: + description: "The unique, numeric id of this project <-> team relation." + type: integer + right: + allOf: + - $ref: '#/components/schemas/models.Right' + description: "The right this team has. 0 = Read only, 1 = Read & Write,\ + \ 2 = Admin. See the docs for more details." + type: object + team_id: + description: The team id. + type: integer + updated: + description: A timestamp when this relation was last updated. You cannot + change this value. + type: string + type: object + models.TeamUser: + example: + created: created + name: name + admin: true + id: 6 + updated: updated + email: email + username: username + properties: + admin: + description: Whether the member is an admin of the team. See the docs for + more about what a team admin can do + type: boolean + created: + description: A timestamp when this task was created. You cannot change this + value. + type: string + email: + description: The user's email address. + maxLength: 250 + type: string + id: + description: "The unique, numeric id of this user." + type: integer + name: + description: The full name of the user. + type: string + updated: + description: A timestamp when this task was last updated. You cannot change + this value. + type: string + username: + description: The username of the user. Is always unique. + maxLength: 250 + minLength: 1 + type: string + type: object + models.TeamWithRight: + example: + oidc_id: oidc_id + include_public: true + created: created + members: + - created: created + name: name + admin: true + id: 6 + updated: updated + email: email + username: username + - created: created + name: name + admin: true + id: 6 + updated: updated + email: email + username: username + is_public: true + name: name + description: description + id: 0 + right: null + created_by: null + updated: updated + properties: + created: + description: A timestamp when this relation was created. You cannot change + this value. + type: string + created_by: + $ref: '#/components/schemas/models_Team_created_by' + description: + description: The team's description. + type: string + id: + description: "The unique, numeric id of this team." + type: integer + include_public: + description: Query parameter controlling whether to include public projects + or not + type: boolean + is_public: + description: Defines wether the team should be publicly discoverable when + sharing a project + type: boolean + members: + description: An array of all members in this team. + items: + $ref: '#/components/schemas/models.TeamUser' + type: array + name: + description: The name of this team. + maxLength: 250 + minLength: 1 + type: string + oidc_id: + description: The team's oidc id delivered by the oidc provider + maxLength: 250 + type: string + right: + $ref: '#/components/schemas/models.Right' + updated: + description: A timestamp when this relation was last updated. You cannot + change this value. + type: string + type: object + models.UserWithRight: + example: + created: created + name: name + id: 0 + right: null + updated: updated + email: email + username: username + properties: + created: + description: A timestamp when this task was created. You cannot change this + value. + type: string + email: + description: The user's email address. + maxLength: 250 + type: string + id: + description: "The unique, numeric id of this user." + type: integer + name: + description: The full name of the user. + type: string + right: + $ref: '#/components/schemas/models.Right' + updated: + description: A timestamp when this task was last updated. You cannot change + this value. + type: string + username: + description: The username of the user. Is always unique. + maxLength: 250 + minLength: 1 + type: string + type: object + models.Webhook: + example: + project_id: 6 + created: created + target_url: target_url + id: 0 + secret: secret + created_by: null + updated: updated + events: + - events + - events + properties: + created: + description: A timestamp when this webhook target was created. You cannot + change this value. + type: string + created_by: + $ref: '#/components/schemas/models_Webhook_created_by' + events: + description: The webhook events which should fire this webhook target + items: + type: string + type: array + id: + description: The generated ID of this webhook target + type: integer + project_id: + description: The project ID of the project this webhook target belongs to + type: integer + secret: + description: "If provided, webhook requests will be signed using HMAC. Check\ + \ out the docs about how to use this: https://vikunja.io/docs/webhooks/#signing" + type: string + target_url: + description: The target URL where the POST request with the webhook payload + will be made + type: string + updated: + description: A timestamp when this webhook target was last updated. You + cannot change this value. + type: string + type: object + notifications.DatabaseNotification: + example: + notification: "{}" + created: created + name: name + read_at: read_at + id: 0 + properties: + created: + description: A timestamp when this notification was created. You cannot + change this value. + type: string + id: + description: "The unique, numeric id of this notification." + type: integer + name: + description: The name of the notification + type: string + notification: + description: The actual content of the notification. + type: object + read_at: + description: "When this notification is marked as read, this will be updated\ + \ with the current timestamp." + type: string + type: object + openid.Callback: + properties: + code: + type: string + redirect_url: + type: string + scope: + type: string + type: object + openid.Provider: + example: + logout_url: logout_url + scope: scope + name: name + auth_url: auth_url + client_id: client_id + key: key + properties: + auth_url: + type: string + client_id: + type: string + key: + type: string + logout_url: + type: string + name: + type: string + scope: + type: string + type: object + todoist.Migration: + properties: + code: + type: string + type: object + trello.Migration: + properties: + code: + type: string + type: object + user.APIUserPassword: + properties: + email: + description: The user's email address + maxLength: 250 + type: string + id: + description: "The unique, numeric id of this user." + type: integer + password: + description: "The user's password in clear text. Only used when registering\ + \ the user. The maximum limi is 72 bytes, which may be less than 72 characters.\ + \ This is due to the limit in the bcrypt hashing algorithm used to store\ + \ passwords in Vikunja." + maxLength: 72 + minLength: 8 + type: string + username: + description: The user's username. Cannot contain anything that looks like + an url or whitespaces. + maxLength: 250 + minLength: 3 + type: string + type: object + user.EmailConfirm: + properties: + token: + description: The email confirm token sent via email. + type: string + type: object + user.EmailUpdate: + properties: + new_email: + description: The new email address. Needs to be a valid email address. + type: string + password: + description: The password of the user for confirmation. + type: string + type: object + user.Login: + properties: + long_token: + description: "If true, the token returned will be valid a lot longer than\ + \ default. Useful for \"remember me\" style logins." + type: boolean + password: + description: The password for the user. + type: string + totp_passcode: + description: The totp passcode of a user. Only needs to be provided when + enabled. + type: string + username: + description: The username used to log in. + type: string + type: object + user.PasswordReset: + properties: + new_password: + description: The new password for this user. + type: string + token: + description: The previously issued reset token. + type: string + type: object + user.PasswordTokenRequest: + properties: + email: + maxLength: 250 + type: string + type: object + user.TOTP: + example: + secret: secret + enabled: true + url: url + properties: + enabled: + description: The totp entry will only be enabled after the user verified + they have a working totp setup. + type: boolean + secret: + type: string + url: + description: The totp url used to be able to enroll the user later + type: string + type: object + user.TOTPPasscode: + properties: + passcode: + type: string + type: object + user.Token: + example: + created: created + id: 0 + token: token + properties: + created: + type: string + id: + type: integer + token: + type: string + type: object + user.User: + example: + created: created + name: name + id: 0 + updated: updated + email: email + username: username + properties: + created: + description: A timestamp when this task was created. You cannot change this + value. + type: string + email: + description: The user's email address. + maxLength: 250 + type: string + id: + description: "The unique, numeric id of this user." + type: integer + name: + description: The full name of the user. + type: string + updated: + description: A timestamp when this task was last updated. You cannot change + this value. + type: string + username: + description: The username of the user. Is always unique. + maxLength: 250 + minLength: 1 + type: string + type: object + v1.LinkShareAuth: + properties: + password: + type: string + type: object + v1.UserAvatarProvider: + example: + avatar_provider: avatar_provider + properties: + avatar_provider: + description: "The avatar provider. Valid types are `gravatar` (uses the\ + \ user email), `upload`, `initials`, `marble` (generates a random avatar\ + \ for each user), `default`." + type: string + type: object + v1.UserDeletionRequestConfirm: + properties: + token: + type: string + type: object + v1.UserPassword: + properties: + new_password: + type: string + old_password: + type: string + type: object + v1.UserPasswordConfirmation: + properties: + password: + type: string + type: object + v1.UserSettings: + example: + discoverable_by_email: true + frontend_settings: "{}" + discoverable_by_name: true + timezone: timezone + default_project_id: 6 + name: name + language: language + week_start: 1 + overdue_tasks_reminders_enabled: true + overdue_tasks_reminders_time: overdue_tasks_reminders_time + email_reminders_enabled: true + properties: + default_project_id: + description: |- + If a task is created without a specified project this value should be used. Applies + to tasks made directly in API and from clients. + type: integer + discoverable_by_email: + description: "If true, the user can be found when searching for their exact\ + \ email." + type: boolean + discoverable_by_name: + description: "If true, this user can be found by their name or parts of\ + \ it when searching for it." + type: boolean + email_reminders_enabled: + description: "If enabled, sends email reminders of tasks to the user." + type: boolean + frontend_settings: + description: Additional settings only used by the frontend + type: object + language: + description: The user's language + type: string + name: + description: The new name of the current user. + type: string + overdue_tasks_reminders_enabled: + description: "If enabled, the user will get an email for their overdue tasks\ + \ each morning." + type: boolean + overdue_tasks_reminders_time: + description: The time when the daily summary of overdue tasks will be sent + via email. + type: string + timezone: + description: The user's time zone. Used to send task reminders in the time + zone of the user. + type: string + week_start: + description: "The day when the week starts for this user. 0 = sunday, 1\ + \ = monday, etc." + type: integer + type: object + v1.UserWithSettings: + example: + settings: + discoverable_by_email: true + frontend_settings: "{}" + discoverable_by_name: true + timezone: timezone + default_project_id: 6 + name: name + language: language + week_start: 1 + overdue_tasks_reminders_enabled: true + overdue_tasks_reminders_time: overdue_tasks_reminders_time + email_reminders_enabled: true + created: created + deletion_scheduled_at: deletion_scheduled_at + name: name + is_local_user: true + id: 0 + updated: updated + email: email + username: username + properties: + created: + description: A timestamp when this task was created. You cannot change this + value. + type: string + deletion_scheduled_at: + type: string + email: + description: The user's email address. + maxLength: 250 + type: string + id: + description: "The unique, numeric id of this user." + type: integer + is_local_user: + type: boolean + name: + description: The full name of the user. + type: string + settings: + $ref: '#/components/schemas/v1.UserSettings' + updated: + description: A timestamp when this task was last updated. You cannot change + this value. + type: string + username: + description: The username of the user. Is always unique. + maxLength: 250 + minLength: 1 + type: string + type: object + v1.authInfo: + example: + openid_connect: + enabled: true + providers: + - logout_url: logout_url + scope: scope + name: name + auth_url: auth_url + client_id: client_id + key: key + - logout_url: logout_url + scope: scope + name: name + auth_url: auth_url + client_id: client_id + key: key + local: + enabled: true + properties: + local: + $ref: '#/components/schemas/v1.localAuthInfo' + openid_connect: + $ref: '#/components/schemas/v1.openIDAuthInfo' + type: object + v1.legalInfo: + example: + privacy_policy_url: privacy_policy_url + imprint_url: imprint_url + properties: + imprint_url: + type: string + privacy_policy_url: + type: string + type: object + v1.localAuthInfo: + example: + enabled: true + properties: + enabled: + type: boolean + type: object + v1.openIDAuthInfo: + example: + enabled: true + providers: + - logout_url: logout_url + scope: scope + name: name + auth_url: auth_url + client_id: client_id + key: key + - logout_url: logout_url + scope: scope + name: name + auth_url: auth_url + client_id: client_id + key: key + properties: + enabled: + type: boolean + providers: + items: + $ref: '#/components/schemas/openid.Provider' + type: array + type: object + v1.vikunjaInfos: + example: + motd: motd + frontend_url: frontend_url + task_comments_enabled: true + available_migrators: + - available_migrators + - available_migrators + auth: + openid_connect: + enabled: true + providers: + - logout_url: logout_url + scope: scope + name: name + auth_url: auth_url + client_id: client_id + key: key + - logout_url: logout_url + scope: scope + name: name + auth_url: auth_url + client_id: client_id + key: key + local: + enabled: true + totp_enabled: true + user_deletion_enabled: true + enabled_background_providers: + - enabled_background_providers + - enabled_background_providers + public_teams_enabled: true + task_attachments_enabled: true + version: version + email_reminders_enabled: true + link_sharing_enabled: true + max_file_size: max_file_size + registration_enabled: true + demo_mode_enabled: true + legal: + privacy_policy_url: privacy_policy_url + imprint_url: imprint_url + caldav_enabled: true + webhooks_enabled: true + properties: + auth: + $ref: '#/components/schemas/v1.authInfo' + available_migrators: + items: + type: string + type: array + caldav_enabled: + type: boolean + demo_mode_enabled: + type: boolean + email_reminders_enabled: + type: boolean + enabled_background_providers: + items: + type: string + type: array + frontend_url: + type: string + legal: + $ref: '#/components/schemas/v1.legalInfo' + link_sharing_enabled: + type: boolean + max_file_size: + type: string + motd: + type: string + public_teams_enabled: + type: boolean + registration_enabled: + type: boolean + task_attachments_enabled: + type: boolean + task_comments_enabled: + type: boolean + totp_enabled: + type: boolean + user_deletion_enabled: + type: boolean + version: + type: string + webhooks_enabled: + type: boolean + type: object + web.HTTPError: + properties: + code: + type: integer + message: + type: string + type: object + _migration_ticktick_migrate_post_request: + properties: + import: + description: The TickTick backup csv file. + type: string + required: + - import + _migration_vikunja_file_migrate_post_request: + properties: + import: + description: The Vikunja export zip file. + type: string + required: + - import + _projects__id__backgrounds_upload_put_request: + properties: + background: + description: The file as single file. + type: string + required: + - background + _tasks__id__attachments_get_request: + properties: + files: + description: "The file, as multipart form file. You can pass multiple." + type: string + required: + - files + _user_settings_avatar_upload_put_request: + properties: + avatar: + description: The avatar as single file. + type: string + required: + - avatar + models_Bucket_created_by: + allOf: + - $ref: '#/components/schemas/user.User' + description: The user who initially created the bucket. + type: object + models_BulkTask_created_by: + allOf: + - $ref: '#/components/schemas/user.User' + description: The user who initially created the task. + type: object + models_BulkTask_subscription: + allOf: + - $ref: '#/components/schemas/models.Subscription' + description: "The subscription status for the user reading this task. You can\ + \ only read this property, use the subscription endpoints to modify it.\n\ + Will only returned when retrieving one task." + type: object + models_Label_created_by: + allOf: + - $ref: '#/components/schemas/user.User' + description: The user who created this label + type: object + models_LinkSharing_shared_by: + allOf: + - $ref: '#/components/schemas/user.User' + description: The user who shared this project + type: object + models_Project_owner: + allOf: + - $ref: '#/components/schemas/user.User' + description: The user who created this project. + type: object + models_Project_subscription: + allOf: + - $ref: '#/components/schemas/models.Subscription' + description: "The subscription status for the user reading this project. You\ + \ can only read this property, use the subscription endpoints to modify it.\n\ + Will only returned when retreiving one project." + type: object + models_ProjectDuplicate_duplicated_project: + allOf: + - $ref: '#/components/schemas/models.Project' + description: The copied project + type: object + models_Reaction_user: + allOf: + - $ref: '#/components/schemas/user.User' + description: The user who reacted + type: object + models_SavedFilter_filters: + allOf: + - $ref: '#/components/schemas/models.TaskCollection' + description: The actual filters this filter contains + type: object + models_SavedFilter_owner: + allOf: + - $ref: '#/components/schemas/user.User' + description: The user who owns this filter + type: object + models_TaskRelation_created_by: + allOf: + - $ref: '#/components/schemas/user.User' + description: The user who created this relation + type: object + models_Team_created_by: + allOf: + - $ref: '#/components/schemas/user.User' + description: The user who created this team. + type: object + models_Webhook_created_by: + allOf: + - $ref: '#/components/schemas/user.User' + description: The user who initially created the webhook target. + type: object + securitySchemes: + BasicAuth: + scheme: basic + type: http + JWTKeyAuth: + in: header + name: Authorization + type: apiKey +x-original-swagger-version: "2.0" diff --git a/stack.yaml b/stack.yaml new file mode 100644 index 0000000..f8c340a --- /dev/null +++ b/stack.yaml @@ -0,0 +1,7 @@ +resolver: lts-19.6 +build: + haddock-arguments: + haddock-args: + - "--odir=./docs" +packages: +- '.' diff --git a/tests/ApproxEq.hs b/tests/ApproxEq.hs new file mode 100644 index 0000000..88ca211 --- /dev/null +++ b/tests/ApproxEq.hs @@ -0,0 +1,81 @@ +{-# LANGUAGE DefaultSignatures #-} +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE TypeOperators #-} +{-# OPTIONS_GHC -fno-warn-orphans #-} + +module ApproxEq where + +import Data.Text (Text) +import Data.Time.Clock +import Test.QuickCheck +import GHC.Generics as G + +(==~) + :: (ApproxEq a, Show a) + => a -> a -> Property +a ==~ b = counterexample (show a ++ " !=~ " ++ show b) (a =~ b) + +class GApproxEq f where + gApproxEq :: f a -> f a -> Bool + +instance GApproxEq U1 where + gApproxEq U1 U1 = True + +instance (GApproxEq a, GApproxEq b) => + GApproxEq (a :+: b) where + gApproxEq (L1 a) (L1 b) = gApproxEq a b + gApproxEq (R1 a) (R1 b) = gApproxEq a b + gApproxEq _ _ = False + +instance (GApproxEq a, GApproxEq b) => + GApproxEq (a :*: b) where + gApproxEq (a1 :*: b1) (a2 :*: b2) = gApproxEq a1 a2 && gApproxEq b1 b2 + +instance (ApproxEq a) => + GApproxEq (K1 i a) where + gApproxEq (K1 a) (K1 b) = a =~ b + +instance (GApproxEq f) => + GApproxEq (M1 i t f) where + gApproxEq (M1 a) (M1 b) = gApproxEq a b + +class ApproxEq a where + (=~) :: a -> a -> Bool + default (=~) :: (Generic a, GApproxEq (Rep a)) => a -> a -> Bool + a =~ b = gApproxEq (G.from a) (G.from b) + +instance ApproxEq Text where + (=~) = (==) + +instance ApproxEq Char where + (=~) = (==) + +instance ApproxEq Bool where + (=~) = (==) + +instance ApproxEq Int where + (=~) = (==) + +instance ApproxEq Double where + (=~) = (==) + +instance ApproxEq a => + ApproxEq (Maybe a) + +instance ApproxEq UTCTime where + (=~) = (==) + +instance ApproxEq a => + ApproxEq [a] where + as =~ bs = and (zipWith (=~) as bs) + +instance (ApproxEq l, ApproxEq r) => + ApproxEq (Either l r) where + Left a =~ Left b = a =~ b + Right a =~ Right b = a =~ b + _ =~ _ = False + +instance (ApproxEq l, ApproxEq r) => + ApproxEq (l, r) where + (=~) (l1, r1) (l2, r2) = l1 =~ l2 && r1 =~ r2 diff --git a/tests/Instances.hs b/tests/Instances.hs new file mode 100644 index 0000000..dd56c81 --- /dev/null +++ b/tests/Instances.hs @@ -0,0 +1,1164 @@ +{-# LANGUAGE CPP #-} +{-# OPTIONS_GHC -fno-warn-unused-imports -fno-warn-unused-matches #-} + +module Instances where + +import Vikunja.Model +import Vikunja.Core + +import qualified Data.Aeson as A +import qualified Data.ByteString.Lazy as BL +import qualified Data.HashMap.Strict as HM +import qualified Data.Set as Set +import qualified Data.Text as T +import qualified Data.Time as TI +import qualified Data.Vector as V +import Data.String (fromString) + +import Control.Monad +import Data.Char (isSpace) +import Data.List (sort) +import Test.QuickCheck + +import ApproxEq + +instance Arbitrary T.Text where + arbitrary = T.pack <$> arbitrary + +instance Arbitrary TI.Day where + arbitrary = TI.ModifiedJulianDay . (2000 +) <$> arbitrary + shrink = (TI.ModifiedJulianDay <$>) . shrink . TI.toModifiedJulianDay + +instance Arbitrary TI.UTCTime where + arbitrary = + TI.UTCTime <$> arbitrary <*> (TI.secondsToDiffTime <$> choose (0, 86401)) + +instance Arbitrary BL.ByteString where + arbitrary = BL.pack <$> arbitrary + shrink xs = BL.pack <$> shrink (BL.unpack xs) + +instance Arbitrary ByteArray where + arbitrary = ByteArray <$> arbitrary + shrink (ByteArray xs) = ByteArray <$> shrink xs + +instance Arbitrary Binary where + arbitrary = Binary <$> arbitrary + shrink (Binary xs) = Binary <$> shrink xs + +instance Arbitrary DateTime where + arbitrary = DateTime <$> arbitrary + shrink (DateTime xs) = DateTime <$> shrink xs + +instance Arbitrary Date where + arbitrary = Date <$> arbitrary + shrink (Date xs) = Date <$> shrink xs + +#if MIN_VERSION_aeson(2,0,0) +#else +-- | A naive Arbitrary instance for A.Value: +instance Arbitrary A.Value where + arbitrary = arbitraryValue +#endif + +arbitraryValue :: Gen A.Value +arbitraryValue = + frequency [(3, simpleTypes), (1, arrayTypes), (1, objectTypes)] + where + simpleTypes :: Gen A.Value + simpleTypes = + frequency + [ (1, return A.Null) + , (2, liftM A.Bool (arbitrary :: Gen Bool)) + , (2, liftM (A.Number . fromIntegral) (arbitrary :: Gen Int)) + , (2, liftM (A.String . T.pack) (arbitrary :: Gen String)) + ] + mapF (k, v) = (fromString k, v) + simpleAndArrays = frequency [(1, sized sizedArray), (4, simpleTypes)] + arrayTypes = sized sizedArray + objectTypes = sized sizedObject + sizedArray n = liftM (A.Array . V.fromList) $ replicateM n simpleTypes + sizedObject n = + liftM (A.object . map mapF) $ + replicateM n $ (,) <$> (arbitrary :: Gen String) <*> simpleAndArrays + +-- | Checks if a given list has no duplicates in _O(n log n)_. +hasNoDups + :: (Ord a) + => [a] -> Bool +hasNoDups = go Set.empty + where + go _ [] = True + go s (x:xs) + | s' <- Set.insert x s + , Set.size s' > Set.size s = go s' xs + | otherwise = False + +instance ApproxEq TI.Day where + (=~) = (==) + +arbitraryReduced :: Arbitrary a => Int -> Gen a +arbitraryReduced n = resize (n `div` 2) arbitrary + +arbitraryReducedMaybe :: Arbitrary a => Int -> Gen (Maybe a) +arbitraryReducedMaybe 0 = elements [Nothing] +arbitraryReducedMaybe n = arbitraryReduced n + +arbitraryReducedMaybeValue :: Int -> Gen (Maybe A.Value) +arbitraryReducedMaybeValue 0 = elements [Nothing] +arbitraryReducedMaybeValue n = do + generated <- arbitraryReduced n + if generated == Just A.Null + then return Nothing + else return generated + +-- * Models + +instance Arbitrary AuthToken where + arbitrary = sized genAuthToken + +genAuthToken :: Int -> Gen AuthToken +genAuthToken n = + AuthToken + <$> arbitraryReducedMaybe n -- authTokenToken :: Maybe Text + +instance Arbitrary BackgroundImage where + arbitrary = sized genBackgroundImage + +genBackgroundImage :: Int -> Gen BackgroundImage +genBackgroundImage n = + BackgroundImage + <$> arbitraryReducedMaybe n -- backgroundImageBlurHash :: Maybe Text + <*> arbitraryReducedMaybe n -- backgroundImageId :: Maybe Text + <*> arbitraryReducedMaybeValue n -- backgroundImageInfo :: Maybe A.Value + <*> arbitraryReducedMaybe n -- backgroundImageThumb :: Maybe Text + <*> arbitraryReducedMaybe n -- backgroundImageUrl :: Maybe Text + +instance Arbitrary FilesFile where + arbitrary = sized genFilesFile + +genFilesFile :: Int -> Gen FilesFile +genFilesFile n = + FilesFile + <$> arbitraryReducedMaybe n -- filesFileCreated :: Maybe Text + <*> arbitraryReducedMaybe n -- filesFileId :: Maybe Int + <*> arbitraryReducedMaybe n -- filesFileMime :: Maybe Text + <*> arbitraryReducedMaybe n -- filesFileName :: Maybe Text + <*> arbitraryReducedMaybe n -- filesFileSize :: Maybe Int + +instance Arbitrary HandlerAuthURL where + arbitrary = sized genHandlerAuthURL + +genHandlerAuthURL :: Int -> Gen HandlerAuthURL +genHandlerAuthURL n = + HandlerAuthURL + <$> arbitraryReducedMaybe n -- handlerAuthURLUrl :: Maybe Text + +instance Arbitrary MicrosofttodoMigration where + arbitrary = sized genMicrosofttodoMigration + +genMicrosofttodoMigration :: Int -> Gen MicrosofttodoMigration +genMicrosofttodoMigration n = + MicrosofttodoMigration + <$> arbitraryReducedMaybe n -- microsofttodoMigrationCode :: Maybe Text + +instance Arbitrary MigrationStatus where + arbitrary = sized genMigrationStatus + +genMigrationStatus :: Int -> Gen MigrationStatus +genMigrationStatus n = + MigrationStatus + <$> arbitraryReducedMaybe n -- migrationStatusFinishedAt :: Maybe Text + <*> arbitraryReducedMaybe n -- migrationStatusId :: Maybe Int + <*> arbitraryReducedMaybe n -- migrationStatusMigratorName :: Maybe Text + <*> arbitraryReducedMaybe n -- migrationStatusStartedAt :: Maybe Text + +instance Arbitrary ModelsAPIToken where + arbitrary = sized genModelsAPIToken + +genModelsAPIToken :: Int -> Gen ModelsAPIToken +genModelsAPIToken n = + ModelsAPIToken + <$> arbitraryReducedMaybe n -- modelsAPITokenCreated :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsAPITokenExpiresAt :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsAPITokenId :: Maybe Int + <*> arbitraryReducedMaybe n -- modelsAPITokenPermissions :: Maybe Map + <*> arbitraryReducedMaybe n -- modelsAPITokenTitle :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsAPITokenToken :: Maybe Text + +instance Arbitrary ModelsBucket where + arbitrary = sized genModelsBucket + +genModelsBucket :: Int -> Gen ModelsBucket +genModelsBucket n = + ModelsBucket + <$> arbitraryReducedMaybe n -- modelsBucketCount :: Maybe Int + <*> arbitraryReducedMaybe n -- modelsBucketCreated :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsBucketCreatedBy :: Maybe ModelsBucketCreatedBy + <*> arbitraryReducedMaybe n -- modelsBucketId :: Maybe Int + <*> arbitraryReducedMaybe n -- modelsBucketLimit :: Maybe Int + <*> arbitraryReducedMaybe n -- modelsBucketPosition :: Maybe Double + <*> arbitraryReducedMaybe n -- modelsBucketProjectViewId :: Maybe Int + <*> arbitraryReducedMaybe n -- modelsBucketTasks :: Maybe [ModelsTask] + <*> arbitraryReducedMaybe n -- modelsBucketTitle :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsBucketUpdated :: Maybe Text + +instance Arbitrary ModelsBucketCreatedBy where + arbitrary = sized genModelsBucketCreatedBy + +genModelsBucketCreatedBy :: Int -> Gen ModelsBucketCreatedBy +genModelsBucketCreatedBy n = + ModelsBucketCreatedBy + <$> arbitraryReducedMaybe n -- modelsBucketCreatedByCreated :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsBucketCreatedByEmail :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsBucketCreatedById :: Maybe Int + <*> arbitraryReducedMaybe n -- modelsBucketCreatedByName :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsBucketCreatedByUpdated :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsBucketCreatedByUsername :: Maybe Text + +instance Arbitrary ModelsBulkAssignees where + arbitrary = sized genModelsBulkAssignees + +genModelsBulkAssignees :: Int -> Gen ModelsBulkAssignees +genModelsBulkAssignees n = + ModelsBulkAssignees + <$> arbitraryReducedMaybe n -- modelsBulkAssigneesAssignees :: Maybe [UserUser] + +instance Arbitrary ModelsBulkTask where + arbitrary = sized genModelsBulkTask + +genModelsBulkTask :: Int -> Gen ModelsBulkTask +genModelsBulkTask n = + ModelsBulkTask + <$> arbitraryReducedMaybe n -- modelsBulkTaskAssignees :: Maybe [UserUser] + <*> arbitraryReducedMaybe n -- modelsBulkTaskAttachments :: Maybe [ModelsTaskAttachment] + <*> arbitraryReducedMaybe n -- modelsBulkTaskBucketId :: Maybe Int + <*> arbitraryReducedMaybe n -- modelsBulkTaskCoverImageAttachmentId :: Maybe Int + <*> arbitraryReducedMaybe n -- modelsBulkTaskCreated :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsBulkTaskCreatedBy :: Maybe ModelsBulkTaskCreatedBy + <*> arbitraryReducedMaybe n -- modelsBulkTaskDescription :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsBulkTaskDone :: Maybe Bool + <*> arbitraryReducedMaybe n -- modelsBulkTaskDoneAt :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsBulkTaskDueDate :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsBulkTaskEndDate :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsBulkTaskHexColor :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsBulkTaskId :: Maybe Int + <*> arbitraryReducedMaybe n -- modelsBulkTaskIdentifier :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsBulkTaskIndex :: Maybe Int + <*> arbitraryReducedMaybe n -- modelsBulkTaskIsFavorite :: Maybe Bool + <*> arbitraryReducedMaybe n -- modelsBulkTaskLabels :: Maybe [ModelsLabel] + <*> arbitraryReducedMaybe n -- modelsBulkTaskPercentDone :: Maybe Double + <*> arbitraryReducedMaybe n -- modelsBulkTaskPosition :: Maybe Double + <*> arbitraryReducedMaybe n -- modelsBulkTaskPriority :: Maybe Int + <*> arbitraryReducedMaybe n -- modelsBulkTaskProjectId :: Maybe Int + <*> arbitraryReducedMaybe n -- modelsBulkTaskReactions :: Maybe Map + <*> arbitraryReducedMaybe n -- modelsBulkTaskRelatedTasks :: Maybe Map + <*> arbitraryReducedMaybe n -- modelsBulkTaskReminders :: Maybe [ModelsTaskReminder] + <*> arbitraryReducedMaybe n -- modelsBulkTaskRepeatAfter :: Maybe Int + <*> arbitraryReducedMaybe n -- modelsBulkTaskRepeatMode :: Maybe ModelsTaskRepeatMode + <*> arbitraryReducedMaybe n -- modelsBulkTaskStartDate :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsBulkTaskSubscription :: Maybe ModelsBulkTaskSubscription + <*> arbitraryReducedMaybe n -- modelsBulkTaskTaskIds :: Maybe [Int] + <*> arbitraryReducedMaybe n -- modelsBulkTaskTitle :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsBulkTaskUpdated :: Maybe Text + +instance Arbitrary ModelsBulkTaskCreatedBy where + arbitrary = sized genModelsBulkTaskCreatedBy + +genModelsBulkTaskCreatedBy :: Int -> Gen ModelsBulkTaskCreatedBy +genModelsBulkTaskCreatedBy n = + ModelsBulkTaskCreatedBy + <$> arbitraryReducedMaybe n -- modelsBulkTaskCreatedByCreated :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsBulkTaskCreatedByEmail :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsBulkTaskCreatedById :: Maybe Int + <*> arbitraryReducedMaybe n -- modelsBulkTaskCreatedByName :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsBulkTaskCreatedByUpdated :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsBulkTaskCreatedByUsername :: Maybe Text + +instance Arbitrary ModelsBulkTaskSubscription where + arbitrary = sized genModelsBulkTaskSubscription + +genModelsBulkTaskSubscription :: Int -> Gen ModelsBulkTaskSubscription +genModelsBulkTaskSubscription n = + ModelsBulkTaskSubscription + <$> arbitraryReducedMaybe n -- modelsBulkTaskSubscriptionCreated :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsBulkTaskSubscriptionEntity :: Maybe Int + <*> arbitraryReducedMaybe n -- modelsBulkTaskSubscriptionEntityId :: Maybe Int + <*> arbitraryReducedMaybe n -- modelsBulkTaskSubscriptionId :: Maybe Int + +instance Arbitrary ModelsDatabaseNotifications where + arbitrary = sized genModelsDatabaseNotifications + +genModelsDatabaseNotifications :: Int -> Gen ModelsDatabaseNotifications +genModelsDatabaseNotifications n = + ModelsDatabaseNotifications + <$> arbitraryReducedMaybe n -- modelsDatabaseNotificationsCreated :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsDatabaseNotificationsId :: Maybe Int + <*> arbitraryReducedMaybe n -- modelsDatabaseNotificationsName :: Maybe Text + <*> arbitraryReducedMaybeValue n -- modelsDatabaseNotificationsNotification :: Maybe A.Value + <*> arbitraryReducedMaybe n -- modelsDatabaseNotificationsRead :: Maybe Bool + <*> arbitraryReducedMaybe n -- modelsDatabaseNotificationsReadAt :: Maybe Text + +instance Arbitrary ModelsLabel where + arbitrary = sized genModelsLabel + +genModelsLabel :: Int -> Gen ModelsLabel +genModelsLabel n = + ModelsLabel + <$> arbitraryReducedMaybe n -- modelsLabelCreated :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsLabelCreatedBy :: Maybe ModelsLabelCreatedBy + <*> arbitraryReducedMaybe n -- modelsLabelDescription :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsLabelHexColor :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsLabelId :: Maybe Int + <*> arbitraryReducedMaybe n -- modelsLabelTitle :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsLabelUpdated :: Maybe Text + +instance Arbitrary ModelsLabelCreatedBy where + arbitrary = sized genModelsLabelCreatedBy + +genModelsLabelCreatedBy :: Int -> Gen ModelsLabelCreatedBy +genModelsLabelCreatedBy n = + ModelsLabelCreatedBy + <$> arbitraryReducedMaybe n -- modelsLabelCreatedByCreated :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsLabelCreatedByEmail :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsLabelCreatedById :: Maybe Int + <*> arbitraryReducedMaybe n -- modelsLabelCreatedByName :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsLabelCreatedByUpdated :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsLabelCreatedByUsername :: Maybe Text + +instance Arbitrary ModelsLabelTask where + arbitrary = sized genModelsLabelTask + +genModelsLabelTask :: Int -> Gen ModelsLabelTask +genModelsLabelTask n = + ModelsLabelTask + <$> arbitraryReducedMaybe n -- modelsLabelTaskCreated :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsLabelTaskLabelId :: Maybe Int + +instance Arbitrary ModelsLabelTaskBulk where + arbitrary = sized genModelsLabelTaskBulk + +genModelsLabelTaskBulk :: Int -> Gen ModelsLabelTaskBulk +genModelsLabelTaskBulk n = + ModelsLabelTaskBulk + <$> arbitraryReducedMaybe n -- modelsLabelTaskBulkLabels :: Maybe [ModelsLabel] + +instance Arbitrary ModelsLinkSharing where + arbitrary = sized genModelsLinkSharing + +genModelsLinkSharing :: Int -> Gen ModelsLinkSharing +genModelsLinkSharing n = + ModelsLinkSharing + <$> arbitraryReducedMaybe n -- modelsLinkSharingCreated :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsLinkSharingHash :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsLinkSharingId :: Maybe Int + <*> arbitraryReducedMaybe n -- modelsLinkSharingName :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsLinkSharingPassword :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsLinkSharingRight :: Maybe ModelsRight + <*> arbitraryReducedMaybe n -- modelsLinkSharingSharedBy :: Maybe ModelsLinkSharingSharedBy + <*> arbitraryReducedMaybe n -- modelsLinkSharingSharingType :: Maybe ModelsSharingType + <*> arbitraryReducedMaybe n -- modelsLinkSharingUpdated :: Maybe Text + +instance Arbitrary ModelsLinkSharingSharedBy where + arbitrary = sized genModelsLinkSharingSharedBy + +genModelsLinkSharingSharedBy :: Int -> Gen ModelsLinkSharingSharedBy +genModelsLinkSharingSharedBy n = + ModelsLinkSharingSharedBy + <$> arbitraryReducedMaybe n -- modelsLinkSharingSharedByCreated :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsLinkSharingSharedByEmail :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsLinkSharingSharedById :: Maybe Int + <*> arbitraryReducedMaybe n -- modelsLinkSharingSharedByName :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsLinkSharingSharedByUpdated :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsLinkSharingSharedByUsername :: Maybe Text + +instance Arbitrary ModelsMessage where + arbitrary = sized genModelsMessage + +genModelsMessage :: Int -> Gen ModelsMessage +genModelsMessage n = + ModelsMessage + <$> arbitraryReducedMaybe n -- modelsMessageMessage :: Maybe Text + +instance Arbitrary ModelsProject where + arbitrary = sized genModelsProject + +genModelsProject :: Int -> Gen ModelsProject +genModelsProject n = + ModelsProject + <$> arbitraryReducedMaybe n -- modelsProjectBackgroundBlurHash :: Maybe Text + <*> arbitraryReducedMaybeValue n -- modelsProjectBackgroundInformation :: Maybe A.Value + <*> arbitraryReducedMaybe n -- modelsProjectCreated :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsProjectDescription :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsProjectHexColor :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsProjectId :: Maybe Int + <*> arbitraryReducedMaybe n -- modelsProjectIdentifier :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsProjectIsArchived :: Maybe Bool + <*> arbitraryReducedMaybe n -- modelsProjectIsFavorite :: Maybe Bool + <*> arbitraryReducedMaybe n -- modelsProjectOwner :: Maybe ModelsProjectOwner + <*> arbitraryReducedMaybe n -- modelsProjectParentProjectId :: Maybe Int + <*> arbitraryReducedMaybe n -- modelsProjectPosition :: Maybe Double + <*> arbitraryReducedMaybe n -- modelsProjectSubscription :: Maybe ModelsProjectSubscription + <*> arbitraryReducedMaybe n -- modelsProjectTitle :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsProjectUpdated :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsProjectViews :: Maybe [ModelsProjectView] + +instance Arbitrary ModelsProjectDuplicate where + arbitrary = sized genModelsProjectDuplicate + +genModelsProjectDuplicate :: Int -> Gen ModelsProjectDuplicate +genModelsProjectDuplicate n = + ModelsProjectDuplicate + <$> arbitraryReducedMaybe n -- modelsProjectDuplicateDuplicatedProject :: Maybe ModelsProjectDuplicateDuplicatedProject + <*> arbitraryReducedMaybe n -- modelsProjectDuplicateParentProjectId :: Maybe Int + +instance Arbitrary ModelsProjectDuplicateDuplicatedProject where + arbitrary = sized genModelsProjectDuplicateDuplicatedProject + +genModelsProjectDuplicateDuplicatedProject :: Int -> Gen ModelsProjectDuplicateDuplicatedProject +genModelsProjectDuplicateDuplicatedProject n = + ModelsProjectDuplicateDuplicatedProject + <$> arbitraryReducedMaybe n -- modelsProjectDuplicateDuplicatedProjectBackgroundBlurHash :: Maybe Text + <*> arbitraryReducedMaybeValue n -- modelsProjectDuplicateDuplicatedProjectBackgroundInformation :: Maybe A.Value + <*> arbitraryReducedMaybe n -- modelsProjectDuplicateDuplicatedProjectCreated :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsProjectDuplicateDuplicatedProjectDescription :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsProjectDuplicateDuplicatedProjectHexColor :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsProjectDuplicateDuplicatedProjectId :: Maybe Int + <*> arbitraryReducedMaybe n -- modelsProjectDuplicateDuplicatedProjectIdentifier :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsProjectDuplicateDuplicatedProjectIsArchived :: Maybe Bool + <*> arbitraryReducedMaybe n -- modelsProjectDuplicateDuplicatedProjectIsFavorite :: Maybe Bool + <*> arbitraryReducedMaybe n -- modelsProjectDuplicateDuplicatedProjectOwner :: Maybe ModelsProjectOwner + <*> arbitraryReducedMaybe n -- modelsProjectDuplicateDuplicatedProjectParentProjectId :: Maybe Int + <*> arbitraryReducedMaybe n -- modelsProjectDuplicateDuplicatedProjectPosition :: Maybe Double + <*> arbitraryReducedMaybe n -- modelsProjectDuplicateDuplicatedProjectSubscription :: Maybe ModelsProjectSubscription + <*> arbitraryReducedMaybe n -- modelsProjectDuplicateDuplicatedProjectTitle :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsProjectDuplicateDuplicatedProjectUpdated :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsProjectDuplicateDuplicatedProjectViews :: Maybe [ModelsProjectView] + +instance Arbitrary ModelsProjectOwner where + arbitrary = sized genModelsProjectOwner + +genModelsProjectOwner :: Int -> Gen ModelsProjectOwner +genModelsProjectOwner n = + ModelsProjectOwner + <$> arbitraryReducedMaybe n -- modelsProjectOwnerCreated :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsProjectOwnerEmail :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsProjectOwnerId :: Maybe Int + <*> arbitraryReducedMaybe n -- modelsProjectOwnerName :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsProjectOwnerUpdated :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsProjectOwnerUsername :: Maybe Text + +instance Arbitrary ModelsProjectSubscription where + arbitrary = sized genModelsProjectSubscription + +genModelsProjectSubscription :: Int -> Gen ModelsProjectSubscription +genModelsProjectSubscription n = + ModelsProjectSubscription + <$> arbitraryReducedMaybe n -- modelsProjectSubscriptionCreated :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsProjectSubscriptionEntity :: Maybe Int + <*> arbitraryReducedMaybe n -- modelsProjectSubscriptionEntityId :: Maybe Int + <*> arbitraryReducedMaybe n -- modelsProjectSubscriptionId :: Maybe Int + +instance Arbitrary ModelsProjectUser where + arbitrary = sized genModelsProjectUser + +genModelsProjectUser :: Int -> Gen ModelsProjectUser +genModelsProjectUser n = + ModelsProjectUser + <$> arbitraryReducedMaybe n -- modelsProjectUserCreated :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsProjectUserId :: Maybe Int + <*> arbitraryReducedMaybe n -- modelsProjectUserRight :: Maybe ModelsRight + <*> arbitraryReducedMaybe n -- modelsProjectUserUpdated :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsProjectUserUserId :: Maybe Text + +instance Arbitrary ModelsProjectView where + arbitrary = sized genModelsProjectView + +genModelsProjectView :: Int -> Gen ModelsProjectView +genModelsProjectView n = + ModelsProjectView + <$> arbitraryReducedMaybe n -- modelsProjectViewBucketConfiguration :: Maybe [ModelsProjectViewBucketConfiguration] + <*> arbitraryReducedMaybe n -- modelsProjectViewBucketConfigurationMode :: Maybe ModelsBucketConfigurationModeKind + <*> arbitraryReducedMaybe n -- modelsProjectViewCreated :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsProjectViewDefaultBucketId :: Maybe Int + <*> arbitraryReducedMaybe n -- modelsProjectViewDoneBucketId :: Maybe Int + <*> arbitraryReducedMaybe n -- modelsProjectViewFilter :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsProjectViewId :: Maybe Int + <*> arbitraryReducedMaybe n -- modelsProjectViewPosition :: Maybe Double + <*> arbitraryReducedMaybe n -- modelsProjectViewProjectId :: Maybe Int + <*> arbitraryReducedMaybe n -- modelsProjectViewTitle :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsProjectViewUpdated :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsProjectViewViewKind :: Maybe ModelsProjectViewKind + +instance Arbitrary ModelsProjectViewBucketConfiguration where + arbitrary = sized genModelsProjectViewBucketConfiguration + +genModelsProjectViewBucketConfiguration :: Int -> Gen ModelsProjectViewBucketConfiguration +genModelsProjectViewBucketConfiguration n = + ModelsProjectViewBucketConfiguration + <$> arbitraryReducedMaybe n -- modelsProjectViewBucketConfigurationFilter :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsProjectViewBucketConfigurationTitle :: Maybe Text + +instance Arbitrary ModelsReaction where + arbitrary = sized genModelsReaction + +genModelsReaction :: Int -> Gen ModelsReaction +genModelsReaction n = + ModelsReaction + <$> arbitraryReducedMaybe n -- modelsReactionCreated :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsReactionUser :: Maybe ModelsReactionUser + <*> arbitraryReducedMaybe n -- modelsReactionValue :: Maybe Text + +instance Arbitrary ModelsReactionUser where + arbitrary = sized genModelsReactionUser + +genModelsReactionUser :: Int -> Gen ModelsReactionUser +genModelsReactionUser n = + ModelsReactionUser + <$> arbitraryReducedMaybe n -- modelsReactionUserCreated :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsReactionUserEmail :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsReactionUserId :: Maybe Int + <*> arbitraryReducedMaybe n -- modelsReactionUserName :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsReactionUserUpdated :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsReactionUserUsername :: Maybe Text + +instance Arbitrary ModelsRouteDetail where + arbitrary = sized genModelsRouteDetail + +genModelsRouteDetail :: Int -> Gen ModelsRouteDetail +genModelsRouteDetail n = + ModelsRouteDetail + <$> arbitraryReducedMaybe n -- modelsRouteDetailMethod :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsRouteDetailPath :: Maybe Text + +instance Arbitrary ModelsSavedFilter where + arbitrary = sized genModelsSavedFilter + +genModelsSavedFilter :: Int -> Gen ModelsSavedFilter +genModelsSavedFilter n = + ModelsSavedFilter + <$> arbitraryReducedMaybe n -- modelsSavedFilterCreated :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsSavedFilterDescription :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsSavedFilterFilters :: Maybe ModelsSavedFilterFilters + <*> arbitraryReducedMaybe n -- modelsSavedFilterId :: Maybe Int + <*> arbitraryReducedMaybe n -- modelsSavedFilterIsFavorite :: Maybe Bool + <*> arbitraryReducedMaybe n -- modelsSavedFilterOwner :: Maybe ModelsSavedFilterOwner + <*> arbitraryReducedMaybe n -- modelsSavedFilterTitle :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsSavedFilterUpdated :: Maybe Text + +instance Arbitrary ModelsSavedFilterFilters where + arbitrary = sized genModelsSavedFilterFilters + +genModelsSavedFilterFilters :: Int -> Gen ModelsSavedFilterFilters +genModelsSavedFilterFilters n = + ModelsSavedFilterFilters + <$> arbitraryReducedMaybe n -- modelsSavedFilterFiltersFilter :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsSavedFilterFiltersFilterIncludeNulls :: Maybe Bool + <*> arbitraryReducedMaybe n -- modelsSavedFilterFiltersOrderBy :: Maybe [Text] + <*> arbitraryReducedMaybe n -- modelsSavedFilterFiltersSortBy :: Maybe [Text] + +instance Arbitrary ModelsSavedFilterOwner where + arbitrary = sized genModelsSavedFilterOwner + +genModelsSavedFilterOwner :: Int -> Gen ModelsSavedFilterOwner +genModelsSavedFilterOwner n = + ModelsSavedFilterOwner + <$> arbitraryReducedMaybe n -- modelsSavedFilterOwnerCreated :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsSavedFilterOwnerEmail :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsSavedFilterOwnerId :: Maybe Int + <*> arbitraryReducedMaybe n -- modelsSavedFilterOwnerName :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsSavedFilterOwnerUpdated :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsSavedFilterOwnerUsername :: Maybe Text + +instance Arbitrary ModelsSubscription where + arbitrary = sized genModelsSubscription + +genModelsSubscription :: Int -> Gen ModelsSubscription +genModelsSubscription n = + ModelsSubscription + <$> arbitraryReducedMaybe n -- modelsSubscriptionCreated :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsSubscriptionEntity :: Maybe Int + <*> arbitraryReducedMaybe n -- modelsSubscriptionEntityId :: Maybe Int + <*> arbitraryReducedMaybe n -- modelsSubscriptionId :: Maybe Int + +instance Arbitrary ModelsTask where + arbitrary = sized genModelsTask + +genModelsTask :: Int -> Gen ModelsTask +genModelsTask n = + ModelsTask + <$> arbitraryReducedMaybe n -- modelsTaskAssignees :: Maybe [UserUser] + <*> arbitraryReducedMaybe n -- modelsTaskAttachments :: Maybe [ModelsTaskAttachment] + <*> arbitraryReducedMaybe n -- modelsTaskBucketId :: Maybe Int + <*> arbitraryReducedMaybe n -- modelsTaskCoverImageAttachmentId :: Maybe Int + <*> arbitraryReducedMaybe n -- modelsTaskCreated :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsTaskCreatedBy :: Maybe ModelsBulkTaskCreatedBy + <*> arbitraryReducedMaybe n -- modelsTaskDescription :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsTaskDone :: Maybe Bool + <*> arbitraryReducedMaybe n -- modelsTaskDoneAt :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsTaskDueDate :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsTaskEndDate :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsTaskHexColor :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsTaskId :: Maybe Int + <*> arbitraryReducedMaybe n -- modelsTaskIdentifier :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsTaskIndex :: Maybe Int + <*> arbitraryReducedMaybe n -- modelsTaskIsFavorite :: Maybe Bool + <*> arbitraryReducedMaybe n -- modelsTaskLabels :: Maybe [ModelsLabel] + <*> arbitraryReducedMaybe n -- modelsTaskPercentDone :: Maybe Double + <*> arbitraryReducedMaybe n -- modelsTaskPosition :: Maybe Double + <*> arbitraryReducedMaybe n -- modelsTaskPriority :: Maybe Int + <*> arbitraryReducedMaybe n -- modelsTaskProjectId :: Maybe Int + <*> arbitraryReducedMaybe n -- modelsTaskReactions :: Maybe Map + <*> arbitraryReducedMaybe n -- modelsTaskRelatedTasks :: Maybe Map + <*> arbitraryReducedMaybe n -- modelsTaskReminders :: Maybe [ModelsTaskReminder] + <*> arbitraryReducedMaybe n -- modelsTaskRepeatAfter :: Maybe Int + <*> arbitraryReducedMaybe n -- modelsTaskRepeatMode :: Maybe ModelsTaskRepeatMode + <*> arbitraryReducedMaybe n -- modelsTaskStartDate :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsTaskSubscription :: Maybe ModelsBulkTaskSubscription + <*> arbitraryReducedMaybe n -- modelsTaskTitle :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsTaskUpdated :: Maybe Text + +instance Arbitrary ModelsTaskAssginee where + arbitrary = sized genModelsTaskAssginee + +genModelsTaskAssginee :: Int -> Gen ModelsTaskAssginee +genModelsTaskAssginee n = + ModelsTaskAssginee + <$> arbitraryReducedMaybe n -- modelsTaskAssgineeCreated :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsTaskAssgineeUserId :: Maybe Int + +instance Arbitrary ModelsTaskAttachment where + arbitrary = sized genModelsTaskAttachment + +genModelsTaskAttachment :: Int -> Gen ModelsTaskAttachment +genModelsTaskAttachment n = + ModelsTaskAttachment + <$> arbitraryReducedMaybe n -- modelsTaskAttachmentCreated :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsTaskAttachmentCreatedBy :: Maybe UserUser + <*> arbitraryReducedMaybe n -- modelsTaskAttachmentFile :: Maybe FilesFile + <*> arbitraryReducedMaybe n -- modelsTaskAttachmentId :: Maybe Int + <*> arbitraryReducedMaybe n -- modelsTaskAttachmentTaskId :: Maybe Int + +instance Arbitrary ModelsTaskBucket where + arbitrary = sized genModelsTaskBucket + +genModelsTaskBucket :: Int -> Gen ModelsTaskBucket +genModelsTaskBucket n = + ModelsTaskBucket + <$> arbitraryReducedMaybe n -- modelsTaskBucketBucketId :: Maybe Int + <*> arbitraryReducedMaybe n -- modelsTaskBucketProjectViewId :: Maybe Int + <*> arbitraryReducedMaybe n -- modelsTaskBucketTaskDone :: Maybe Bool + <*> arbitraryReducedMaybe n -- modelsTaskBucketTaskId :: Maybe Int + +instance Arbitrary ModelsTaskCollection where + arbitrary = sized genModelsTaskCollection + +genModelsTaskCollection :: Int -> Gen ModelsTaskCollection +genModelsTaskCollection n = + ModelsTaskCollection + <$> arbitraryReducedMaybe n -- modelsTaskCollectionFilter :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsTaskCollectionFilterIncludeNulls :: Maybe Bool + <*> arbitraryReducedMaybe n -- modelsTaskCollectionOrderBy :: Maybe [Text] + <*> arbitraryReducedMaybe n -- modelsTaskCollectionSortBy :: Maybe [Text] + +instance Arbitrary ModelsTaskComment where + arbitrary = sized genModelsTaskComment + +genModelsTaskComment :: Int -> Gen ModelsTaskComment +genModelsTaskComment n = + ModelsTaskComment + <$> arbitraryReducedMaybe n -- modelsTaskCommentAuthor :: Maybe UserUser + <*> arbitraryReducedMaybe n -- modelsTaskCommentComment :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsTaskCommentCreated :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsTaskCommentId :: Maybe Int + <*> arbitraryReducedMaybe n -- modelsTaskCommentReactions :: Maybe (Map.Map String [UserUser]) + <*> arbitraryReducedMaybe n -- modelsTaskCommentUpdated :: Maybe Text + +instance Arbitrary ModelsTaskPosition where + arbitrary = sized genModelsTaskPosition + +genModelsTaskPosition :: Int -> Gen ModelsTaskPosition +genModelsTaskPosition n = + ModelsTaskPosition + <$> arbitraryReducedMaybe n -- modelsTaskPositionPosition :: Maybe Double + <*> arbitraryReducedMaybe n -- modelsTaskPositionProjectViewId :: Maybe Int + <*> arbitraryReducedMaybe n -- modelsTaskPositionTaskId :: Maybe Int + +instance Arbitrary ModelsTaskRelation where + arbitrary = sized genModelsTaskRelation + +genModelsTaskRelation :: Int -> Gen ModelsTaskRelation +genModelsTaskRelation n = + ModelsTaskRelation + <$> arbitraryReducedMaybe n -- modelsTaskRelationCreated :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsTaskRelationCreatedBy :: Maybe ModelsTaskRelationCreatedBy + <*> arbitraryReducedMaybe n -- modelsTaskRelationOtherTaskId :: Maybe Int + <*> arbitraryReducedMaybe n -- modelsTaskRelationRelationKind :: Maybe ModelsRelationKind + <*> arbitraryReducedMaybe n -- modelsTaskRelationTaskId :: Maybe Int + +instance Arbitrary ModelsTaskRelationCreatedBy where + arbitrary = sized genModelsTaskRelationCreatedBy + +genModelsTaskRelationCreatedBy :: Int -> Gen ModelsTaskRelationCreatedBy +genModelsTaskRelationCreatedBy n = + ModelsTaskRelationCreatedBy + <$> arbitraryReducedMaybe n -- modelsTaskRelationCreatedByCreated :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsTaskRelationCreatedByEmail :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsTaskRelationCreatedById :: Maybe Int + <*> arbitraryReducedMaybe n -- modelsTaskRelationCreatedByName :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsTaskRelationCreatedByUpdated :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsTaskRelationCreatedByUsername :: Maybe Text + +instance Arbitrary ModelsTaskReminder where + arbitrary = sized genModelsTaskReminder + +genModelsTaskReminder :: Int -> Gen ModelsTaskReminder +genModelsTaskReminder n = + ModelsTaskReminder + <$> arbitraryReducedMaybe n -- modelsTaskReminderRelativePeriod :: Maybe Int + <*> arbitraryReducedMaybe n -- modelsTaskReminderRelativeTo :: Maybe ModelsReminderRelation + <*> arbitraryReducedMaybe n -- modelsTaskReminderReminder :: Maybe Text + +instance Arbitrary ModelsTeam where + arbitrary = sized genModelsTeam + +genModelsTeam :: Int -> Gen ModelsTeam +genModelsTeam n = + ModelsTeam + <$> arbitraryReducedMaybe n -- modelsTeamCreated :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsTeamCreatedBy :: Maybe ModelsTeamCreatedBy + <*> arbitraryReducedMaybe n -- modelsTeamDescription :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsTeamId :: Maybe Int + <*> arbitraryReducedMaybe n -- modelsTeamIncludePublic :: Maybe Bool + <*> arbitraryReducedMaybe n -- modelsTeamIsPublic :: Maybe Bool + <*> arbitraryReducedMaybe n -- modelsTeamMembers :: Maybe [ModelsTeamUser] + <*> arbitraryReducedMaybe n -- modelsTeamName :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsTeamOidcId :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsTeamUpdated :: Maybe Text + +instance Arbitrary ModelsTeamCreatedBy where + arbitrary = sized genModelsTeamCreatedBy + +genModelsTeamCreatedBy :: Int -> Gen ModelsTeamCreatedBy +genModelsTeamCreatedBy n = + ModelsTeamCreatedBy + <$> arbitraryReducedMaybe n -- modelsTeamCreatedByCreated :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsTeamCreatedByEmail :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsTeamCreatedById :: Maybe Int + <*> arbitraryReducedMaybe n -- modelsTeamCreatedByName :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsTeamCreatedByUpdated :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsTeamCreatedByUsername :: Maybe Text + +instance Arbitrary ModelsTeamMember where + arbitrary = sized genModelsTeamMember + +genModelsTeamMember :: Int -> Gen ModelsTeamMember +genModelsTeamMember n = + ModelsTeamMember + <$> arbitraryReducedMaybe n -- modelsTeamMemberAdmin :: Maybe Bool + <*> arbitraryReducedMaybe n -- modelsTeamMemberCreated :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsTeamMemberId :: Maybe Int + <*> arbitraryReducedMaybe n -- modelsTeamMemberUsername :: Maybe Text + +instance Arbitrary ModelsTeamProject where + arbitrary = sized genModelsTeamProject + +genModelsTeamProject :: Int -> Gen ModelsTeamProject +genModelsTeamProject n = + ModelsTeamProject + <$> arbitraryReducedMaybe n -- modelsTeamProjectCreated :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsTeamProjectId :: Maybe Int + <*> arbitraryReducedMaybe n -- modelsTeamProjectRight :: Maybe ModelsRight + <*> arbitraryReducedMaybe n -- modelsTeamProjectTeamId :: Maybe Int + <*> arbitraryReducedMaybe n -- modelsTeamProjectUpdated :: Maybe Text + +instance Arbitrary ModelsTeamUser where + arbitrary = sized genModelsTeamUser + +genModelsTeamUser :: Int -> Gen ModelsTeamUser +genModelsTeamUser n = + ModelsTeamUser + <$> arbitraryReducedMaybe n -- modelsTeamUserAdmin :: Maybe Bool + <*> arbitraryReducedMaybe n -- modelsTeamUserCreated :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsTeamUserEmail :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsTeamUserId :: Maybe Int + <*> arbitraryReducedMaybe n -- modelsTeamUserName :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsTeamUserUpdated :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsTeamUserUsername :: Maybe Text + +instance Arbitrary ModelsTeamWithRight where + arbitrary = sized genModelsTeamWithRight + +genModelsTeamWithRight :: Int -> Gen ModelsTeamWithRight +genModelsTeamWithRight n = + ModelsTeamWithRight + <$> arbitraryReducedMaybe n -- modelsTeamWithRightCreated :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsTeamWithRightCreatedBy :: Maybe ModelsTeamCreatedBy + <*> arbitraryReducedMaybe n -- modelsTeamWithRightDescription :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsTeamWithRightId :: Maybe Int + <*> arbitraryReducedMaybe n -- modelsTeamWithRightIncludePublic :: Maybe Bool + <*> arbitraryReducedMaybe n -- modelsTeamWithRightIsPublic :: Maybe Bool + <*> arbitraryReducedMaybe n -- modelsTeamWithRightMembers :: Maybe [ModelsTeamUser] + <*> arbitraryReducedMaybe n -- modelsTeamWithRightName :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsTeamWithRightOidcId :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsTeamWithRightRight :: Maybe ModelsRight + <*> arbitraryReducedMaybe n -- modelsTeamWithRightUpdated :: Maybe Text + +instance Arbitrary ModelsUserWithRight where + arbitrary = sized genModelsUserWithRight + +genModelsUserWithRight :: Int -> Gen ModelsUserWithRight +genModelsUserWithRight n = + ModelsUserWithRight + <$> arbitraryReducedMaybe n -- modelsUserWithRightCreated :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsUserWithRightEmail :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsUserWithRightId :: Maybe Int + <*> arbitraryReducedMaybe n -- modelsUserWithRightName :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsUserWithRightRight :: Maybe ModelsRight + <*> arbitraryReducedMaybe n -- modelsUserWithRightUpdated :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsUserWithRightUsername :: Maybe Text + +instance Arbitrary ModelsWebhook where + arbitrary = sized genModelsWebhook + +genModelsWebhook :: Int -> Gen ModelsWebhook +genModelsWebhook n = + ModelsWebhook + <$> arbitraryReducedMaybe n -- modelsWebhookCreated :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsWebhookCreatedBy :: Maybe ModelsWebhookCreatedBy + <*> arbitraryReducedMaybe n -- modelsWebhookEvents :: Maybe [Text] + <*> arbitraryReducedMaybe n -- modelsWebhookId :: Maybe Int + <*> arbitraryReducedMaybe n -- modelsWebhookProjectId :: Maybe Int + <*> arbitraryReducedMaybe n -- modelsWebhookSecret :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsWebhookTargetUrl :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsWebhookUpdated :: Maybe Text + +instance Arbitrary ModelsWebhookCreatedBy where + arbitrary = sized genModelsWebhookCreatedBy + +genModelsWebhookCreatedBy :: Int -> Gen ModelsWebhookCreatedBy +genModelsWebhookCreatedBy n = + ModelsWebhookCreatedBy + <$> arbitraryReducedMaybe n -- modelsWebhookCreatedByCreated :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsWebhookCreatedByEmail :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsWebhookCreatedById :: Maybe Int + <*> arbitraryReducedMaybe n -- modelsWebhookCreatedByName :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsWebhookCreatedByUpdated :: Maybe Text + <*> arbitraryReducedMaybe n -- modelsWebhookCreatedByUsername :: Maybe Text + +instance Arbitrary NotificationsDatabaseNotification where + arbitrary = sized genNotificationsDatabaseNotification + +genNotificationsDatabaseNotification :: Int -> Gen NotificationsDatabaseNotification +genNotificationsDatabaseNotification n = + NotificationsDatabaseNotification + <$> arbitraryReducedMaybe n -- notificationsDatabaseNotificationCreated :: Maybe Text + <*> arbitraryReducedMaybe n -- notificationsDatabaseNotificationId :: Maybe Int + <*> arbitraryReducedMaybe n -- notificationsDatabaseNotificationName :: Maybe Text + <*> arbitraryReducedMaybeValue n -- notificationsDatabaseNotificationNotification :: Maybe A.Value + <*> arbitraryReducedMaybe n -- notificationsDatabaseNotificationReadAt :: Maybe Text + +instance Arbitrary OpenidCallback where + arbitrary = sized genOpenidCallback + +genOpenidCallback :: Int -> Gen OpenidCallback +genOpenidCallback n = + OpenidCallback + <$> arbitraryReducedMaybe n -- openidCallbackCode :: Maybe Text + <*> arbitraryReducedMaybe n -- openidCallbackRedirectUrl :: Maybe Text + <*> arbitraryReducedMaybe n -- openidCallbackScope :: Maybe Text + +instance Arbitrary OpenidProvider where + arbitrary = sized genOpenidProvider + +genOpenidProvider :: Int -> Gen OpenidProvider +genOpenidProvider n = + OpenidProvider + <$> arbitraryReducedMaybe n -- openidProviderAuthUrl :: Maybe Text + <*> arbitraryReducedMaybe n -- openidProviderClientId :: Maybe Text + <*> arbitraryReducedMaybe n -- openidProviderKey :: Maybe Text + <*> arbitraryReducedMaybe n -- openidProviderLogoutUrl :: Maybe Text + <*> arbitraryReducedMaybe n -- openidProviderName :: Maybe Text + <*> arbitraryReducedMaybe n -- openidProviderScope :: Maybe Text + +instance Arbitrary TodoistMigration where + arbitrary = sized genTodoistMigration + +genTodoistMigration :: Int -> Gen TodoistMigration +genTodoistMigration n = + TodoistMigration + <$> arbitraryReducedMaybe n -- todoistMigrationCode :: Maybe Text + +instance Arbitrary TrelloMigration where + arbitrary = sized genTrelloMigration + +genTrelloMigration :: Int -> Gen TrelloMigration +genTrelloMigration n = + TrelloMigration + <$> arbitraryReducedMaybe n -- trelloMigrationCode :: Maybe Text + +instance Arbitrary UserAPIUserPassword where + arbitrary = sized genUserAPIUserPassword + +genUserAPIUserPassword :: Int -> Gen UserAPIUserPassword +genUserAPIUserPassword n = + UserAPIUserPassword + <$> arbitraryReducedMaybe n -- userAPIUserPasswordEmail :: Maybe Text + <*> arbitraryReducedMaybe n -- userAPIUserPasswordId :: Maybe Int + <*> arbitraryReducedMaybe n -- userAPIUserPasswordPassword :: Maybe Text + <*> arbitraryReducedMaybe n -- userAPIUserPasswordUsername :: Maybe Text + +instance Arbitrary UserEmailConfirm where + arbitrary = sized genUserEmailConfirm + +genUserEmailConfirm :: Int -> Gen UserEmailConfirm +genUserEmailConfirm n = + UserEmailConfirm + <$> arbitraryReducedMaybe n -- userEmailConfirmToken :: Maybe Text + +instance Arbitrary UserEmailUpdate where + arbitrary = sized genUserEmailUpdate + +genUserEmailUpdate :: Int -> Gen UserEmailUpdate +genUserEmailUpdate n = + UserEmailUpdate + <$> arbitraryReducedMaybe n -- userEmailUpdateNewEmail :: Maybe Text + <*> arbitraryReducedMaybe n -- userEmailUpdatePassword :: Maybe Text + +instance Arbitrary UserLogin where + arbitrary = sized genUserLogin + +genUserLogin :: Int -> Gen UserLogin +genUserLogin n = + UserLogin + <$> arbitraryReducedMaybe n -- userLoginLongToken :: Maybe Bool + <*> arbitraryReducedMaybe n -- userLoginPassword :: Maybe Text + <*> arbitraryReducedMaybe n -- userLoginTotpPasscode :: Maybe Text + <*> arbitraryReducedMaybe n -- userLoginUsername :: Maybe Text + +instance Arbitrary UserPasswordReset where + arbitrary = sized genUserPasswordReset + +genUserPasswordReset :: Int -> Gen UserPasswordReset +genUserPasswordReset n = + UserPasswordReset + <$> arbitraryReducedMaybe n -- userPasswordResetNewPassword :: Maybe Text + <*> arbitraryReducedMaybe n -- userPasswordResetToken :: Maybe Text + +instance Arbitrary UserPasswordTokenRequest where + arbitrary = sized genUserPasswordTokenRequest + +genUserPasswordTokenRequest :: Int -> Gen UserPasswordTokenRequest +genUserPasswordTokenRequest n = + UserPasswordTokenRequest + <$> arbitraryReducedMaybe n -- userPasswordTokenRequestEmail :: Maybe Text + +instance Arbitrary UserTOTP where + arbitrary = sized genUserTOTP + +genUserTOTP :: Int -> Gen UserTOTP +genUserTOTP n = + UserTOTP + <$> arbitraryReducedMaybe n -- userTOTPEnabled :: Maybe Bool + <*> arbitraryReducedMaybe n -- userTOTPSecret :: Maybe Text + <*> arbitraryReducedMaybe n -- userTOTPUrl :: Maybe Text + +instance Arbitrary UserTOTPPasscode where + arbitrary = sized genUserTOTPPasscode + +genUserTOTPPasscode :: Int -> Gen UserTOTPPasscode +genUserTOTPPasscode n = + UserTOTPPasscode + <$> arbitraryReducedMaybe n -- userTOTPPasscodePasscode :: Maybe Text + +instance Arbitrary UserToken where + arbitrary = sized genUserToken + +genUserToken :: Int -> Gen UserToken +genUserToken n = + UserToken + <$> arbitraryReducedMaybe n -- userTokenCreated :: Maybe Text + <*> arbitraryReducedMaybe n -- userTokenId :: Maybe Int + <*> arbitraryReducedMaybe n -- userTokenToken :: Maybe Text + +instance Arbitrary UserUser where + arbitrary = sized genUserUser + +genUserUser :: Int -> Gen UserUser +genUserUser n = + UserUser + <$> arbitraryReducedMaybe n -- userUserCreated :: Maybe Text + <*> arbitraryReducedMaybe n -- userUserEmail :: Maybe Text + <*> arbitraryReducedMaybe n -- userUserId :: Maybe Int + <*> arbitraryReducedMaybe n -- userUserName :: Maybe Text + <*> arbitraryReducedMaybe n -- userUserUpdated :: Maybe Text + <*> arbitraryReducedMaybe n -- userUserUsername :: Maybe Text + +instance Arbitrary V1AuthInfo where + arbitrary = sized genV1AuthInfo + +genV1AuthInfo :: Int -> Gen V1AuthInfo +genV1AuthInfo n = + V1AuthInfo + <$> arbitraryReducedMaybe n -- v1AuthInfoLocal :: Maybe V1LocalAuthInfo + <*> arbitraryReducedMaybe n -- v1AuthInfoOpenidConnect :: Maybe V1OpenIDAuthInfo + +instance Arbitrary V1LegalInfo where + arbitrary = sized genV1LegalInfo + +genV1LegalInfo :: Int -> Gen V1LegalInfo +genV1LegalInfo n = + V1LegalInfo + <$> arbitraryReducedMaybe n -- v1LegalInfoImprintUrl :: Maybe Text + <*> arbitraryReducedMaybe n -- v1LegalInfoPrivacyPolicyUrl :: Maybe Text + +instance Arbitrary V1LinkShareAuth where + arbitrary = sized genV1LinkShareAuth + +genV1LinkShareAuth :: Int -> Gen V1LinkShareAuth +genV1LinkShareAuth n = + V1LinkShareAuth + <$> arbitraryReducedMaybe n -- v1LinkShareAuthPassword :: Maybe Text + +instance Arbitrary V1LocalAuthInfo where + arbitrary = sized genV1LocalAuthInfo + +genV1LocalAuthInfo :: Int -> Gen V1LocalAuthInfo +genV1LocalAuthInfo n = + V1LocalAuthInfo + <$> arbitraryReducedMaybe n -- v1LocalAuthInfoEnabled :: Maybe Bool + +instance Arbitrary V1OpenIDAuthInfo where + arbitrary = sized genV1OpenIDAuthInfo + +genV1OpenIDAuthInfo :: Int -> Gen V1OpenIDAuthInfo +genV1OpenIDAuthInfo n = + V1OpenIDAuthInfo + <$> arbitraryReducedMaybe n -- v1OpenIDAuthInfoEnabled :: Maybe Bool + <*> arbitraryReducedMaybe n -- v1OpenIDAuthInfoProviders :: Maybe [OpenidProvider] + +instance Arbitrary V1UserAvatarProvider where + arbitrary = sized genV1UserAvatarProvider + +genV1UserAvatarProvider :: Int -> Gen V1UserAvatarProvider +genV1UserAvatarProvider n = + V1UserAvatarProvider + <$> arbitraryReducedMaybe n -- v1UserAvatarProviderAvatarProvider :: Maybe Text + +instance Arbitrary V1UserDeletionRequestConfirm where + arbitrary = sized genV1UserDeletionRequestConfirm + +genV1UserDeletionRequestConfirm :: Int -> Gen V1UserDeletionRequestConfirm +genV1UserDeletionRequestConfirm n = + V1UserDeletionRequestConfirm + <$> arbitraryReducedMaybe n -- v1UserDeletionRequestConfirmToken :: Maybe Text + +instance Arbitrary V1UserPassword where + arbitrary = sized genV1UserPassword + +genV1UserPassword :: Int -> Gen V1UserPassword +genV1UserPassword n = + V1UserPassword + <$> arbitraryReducedMaybe n -- v1UserPasswordNewPassword :: Maybe Text + <*> arbitraryReducedMaybe n -- v1UserPasswordOldPassword :: Maybe Text + +instance Arbitrary V1UserPasswordConfirmation where + arbitrary = sized genV1UserPasswordConfirmation + +genV1UserPasswordConfirmation :: Int -> Gen V1UserPasswordConfirmation +genV1UserPasswordConfirmation n = + V1UserPasswordConfirmation + <$> arbitraryReducedMaybe n -- v1UserPasswordConfirmationPassword :: Maybe Text + +instance Arbitrary V1UserSettings where + arbitrary = sized genV1UserSettings + +genV1UserSettings :: Int -> Gen V1UserSettings +genV1UserSettings n = + V1UserSettings + <$> arbitraryReducedMaybe n -- v1UserSettingsDefaultProjectId :: Maybe Int + <*> arbitraryReducedMaybe n -- v1UserSettingsDiscoverableByEmail :: Maybe Bool + <*> arbitraryReducedMaybe n -- v1UserSettingsDiscoverableByName :: Maybe Bool + <*> arbitraryReducedMaybe n -- v1UserSettingsEmailRemindersEnabled :: Maybe Bool + <*> arbitraryReducedMaybeValue n -- v1UserSettingsFrontendSettings :: Maybe A.Value + <*> arbitraryReducedMaybe n -- v1UserSettingsLanguage :: Maybe Text + <*> arbitraryReducedMaybe n -- v1UserSettingsName :: Maybe Text + <*> arbitraryReducedMaybe n -- v1UserSettingsOverdueTasksRemindersEnabled :: Maybe Bool + <*> arbitraryReducedMaybe n -- v1UserSettingsOverdueTasksRemindersTime :: Maybe Text + <*> arbitraryReducedMaybe n -- v1UserSettingsTimezone :: Maybe Text + <*> arbitraryReducedMaybe n -- v1UserSettingsWeekStart :: Maybe Int + +instance Arbitrary V1UserWithSettings where + arbitrary = sized genV1UserWithSettings + +genV1UserWithSettings :: Int -> Gen V1UserWithSettings +genV1UserWithSettings n = + V1UserWithSettings + <$> arbitraryReducedMaybe n -- v1UserWithSettingsCreated :: Maybe Text + <*> arbitraryReducedMaybe n -- v1UserWithSettingsDeletionScheduledAt :: Maybe Text + <*> arbitraryReducedMaybe n -- v1UserWithSettingsEmail :: Maybe Text + <*> arbitraryReducedMaybe n -- v1UserWithSettingsId :: Maybe Int + <*> arbitraryReducedMaybe n -- v1UserWithSettingsIsLocalUser :: Maybe Bool + <*> arbitraryReducedMaybe n -- v1UserWithSettingsName :: Maybe Text + <*> arbitraryReducedMaybe n -- v1UserWithSettingsSettings :: Maybe V1UserSettings + <*> arbitraryReducedMaybe n -- v1UserWithSettingsUpdated :: Maybe Text + <*> arbitraryReducedMaybe n -- v1UserWithSettingsUsername :: Maybe Text + +instance Arbitrary V1VikunjaInfos where + arbitrary = sized genV1VikunjaInfos + +genV1VikunjaInfos :: Int -> Gen V1VikunjaInfos +genV1VikunjaInfos n = + V1VikunjaInfos + <$> arbitraryReducedMaybe n -- v1VikunjaInfosAuth :: Maybe V1AuthInfo + <*> arbitraryReducedMaybe n -- v1VikunjaInfosAvailableMigrators :: Maybe [Text] + <*> arbitraryReducedMaybe n -- v1VikunjaInfosCaldavEnabled :: Maybe Bool + <*> arbitraryReducedMaybe n -- v1VikunjaInfosDemoModeEnabled :: Maybe Bool + <*> arbitraryReducedMaybe n -- v1VikunjaInfosEmailRemindersEnabled :: Maybe Bool + <*> arbitraryReducedMaybe n -- v1VikunjaInfosEnabledBackgroundProviders :: Maybe [Text] + <*> arbitraryReducedMaybe n -- v1VikunjaInfosFrontendUrl :: Maybe Text + <*> arbitraryReducedMaybe n -- v1VikunjaInfosLegal :: Maybe V1LegalInfo + <*> arbitraryReducedMaybe n -- v1VikunjaInfosLinkSharingEnabled :: Maybe Bool + <*> arbitraryReducedMaybe n -- v1VikunjaInfosMaxFileSize :: Maybe Text + <*> arbitraryReducedMaybe n -- v1VikunjaInfosMotd :: Maybe Text + <*> arbitraryReducedMaybe n -- v1VikunjaInfosPublicTeamsEnabled :: Maybe Bool + <*> arbitraryReducedMaybe n -- v1VikunjaInfosRegistrationEnabled :: Maybe Bool + <*> arbitraryReducedMaybe n -- v1VikunjaInfosTaskAttachmentsEnabled :: Maybe Bool + <*> arbitraryReducedMaybe n -- v1VikunjaInfosTaskCommentsEnabled :: Maybe Bool + <*> arbitraryReducedMaybe n -- v1VikunjaInfosTotpEnabled :: Maybe Bool + <*> arbitraryReducedMaybe n -- v1VikunjaInfosUserDeletionEnabled :: Maybe Bool + <*> arbitraryReducedMaybe n -- v1VikunjaInfosVersion :: Maybe Text + <*> arbitraryReducedMaybe n -- v1VikunjaInfosWebhooksEnabled :: Maybe Bool + +instance Arbitrary WebHTTPError where + arbitrary = sized genWebHTTPError + +genWebHTTPError :: Int -> Gen WebHTTPError +genWebHTTPError n = + WebHTTPError + <$> arbitraryReducedMaybe n -- webHTTPErrorCode :: Maybe Int + <*> arbitraryReducedMaybe n -- webHTTPErrorMessage :: Maybe Text + + + + +instance Arbitrary ModelsBucketConfigurationModeKind where + arbitrary = arbitraryBoundedEnum + +instance Arbitrary ModelsProjectViewKind where + arbitrary = arbitraryBoundedEnum + +instance Arbitrary ModelsRelationKind where + arbitrary = arbitraryBoundedEnum + +instance Arbitrary ModelsReminderRelation where + arbitrary = arbitraryBoundedEnum + +instance Arbitrary ModelsRight where + arbitrary = arbitraryBoundedEnum + +instance Arbitrary ModelsSharingType where + arbitrary = arbitraryBoundedEnum + +instance Arbitrary ModelsTaskRepeatMode where + arbitrary = arbitraryBoundedEnum + diff --git a/tests/PropMime.hs b/tests/PropMime.hs new file mode 100644 index 0000000..32c005f --- /dev/null +++ b/tests/PropMime.hs @@ -0,0 +1,51 @@ +{-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE ConstraintKinds #-} +{-# OPTIONS_GHC -fno-warn-unused-imports #-} + +module PropMime where + +import Data.Aeson +import Data.Aeson.Types (parseEither) +import Data.Monoid ((<>)) +import Data.Typeable (Proxy(..), typeOf, Typeable) +import qualified Data.ByteString.Lazy.Char8 as BL8 +import Test.Hspec +import Test.QuickCheck +import Test.QuickCheck.Property +import Test.Hspec.QuickCheck (prop) + +import Vikunja.MimeTypes + +import ApproxEq + +-- * Type Aliases + +type ArbitraryMime mime a = ArbitraryRoundtrip (MimeUnrender mime) (MimeRender mime) a + +type ArbitraryRoundtrip from to a = (from a, to a, Arbitrary' a) + +type Arbitrary' a = (Arbitrary a, Show a, Typeable a) + +-- * Mime + +propMime + :: forall a b mime. + (ArbitraryMime mime a, Testable b) + => String -> (a -> a -> b) -> mime -> Proxy a -> Spec +propMime eqDescr eq m _ = + prop + (show (typeOf (undefined :: a)) <> " " <> show (typeOf (undefined :: mime)) <> " roundtrip " <> eqDescr) $ + \(x :: a) -> + let rendered = mimeRender' m x + actual = mimeUnrender' m rendered + expected = Right x + failMsg = + "ACTUAL: " <> show actual <> "\nRENDERED: " <> BL8.unpack rendered + in counterexample failMsg $ + either reject property (eq <$> actual <*> expected) + where + reject = property . const rejected + +propMimeEq :: (ArbitraryMime mime a, Eq a) => mime -> Proxy a -> Spec +propMimeEq = propMime "(EQ)" (==) diff --git a/tests/Test.hs b/tests/Test.hs new file mode 100644 index 0000000..5d189ba --- /dev/null +++ b/tests/Test.hs @@ -0,0 +1,113 @@ +{-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE RecordWildCards #-} +{-# LANGUAGE PartialTypeSignatures #-} + +module Main where + +import Data.Typeable (Proxy(..)) +import Test.Hspec +import Test.Hspec.QuickCheck + +import PropMime +import Instances () + +import Vikunja.Model +import Vikunja.MimeTypes + +main :: IO () +main = + hspec $ modifyMaxSize (const 10) $ do + describe "JSON instances" $ do + pure () + propMimeEq MimeJSON (Proxy :: Proxy AuthToken) + propMimeEq MimeJSON (Proxy :: Proxy BackgroundImage) + propMimeEq MimeJSON (Proxy :: Proxy FilesFile) + propMimeEq MimeJSON (Proxy :: Proxy HandlerAuthURL) + propMimeEq MimeJSON (Proxy :: Proxy MicrosofttodoMigration) + propMimeEq MimeJSON (Proxy :: Proxy MigrationStatus) + propMimeEq MimeJSON (Proxy :: Proxy ModelsAPIToken) + propMimeEq MimeJSON (Proxy :: Proxy ModelsBucket) + propMimeEq MimeJSON (Proxy :: Proxy ModelsBucketConfigurationModeKind) + propMimeEq MimeJSON (Proxy :: Proxy ModelsBucketCreatedBy) + propMimeEq MimeJSON (Proxy :: Proxy ModelsBulkAssignees) + propMimeEq MimeJSON (Proxy :: Proxy ModelsBulkTask) + propMimeEq MimeJSON (Proxy :: Proxy ModelsBulkTaskCreatedBy) + propMimeEq MimeJSON (Proxy :: Proxy ModelsBulkTaskSubscription) + propMimeEq MimeJSON (Proxy :: Proxy ModelsDatabaseNotifications) + propMimeEq MimeJSON (Proxy :: Proxy ModelsLabel) + propMimeEq MimeJSON (Proxy :: Proxy ModelsLabelCreatedBy) + propMimeEq MimeJSON (Proxy :: Proxy ModelsLabelTask) + propMimeEq MimeJSON (Proxy :: Proxy ModelsLabelTaskBulk) + propMimeEq MimeJSON (Proxy :: Proxy ModelsLinkSharing) + propMimeEq MimeJSON (Proxy :: Proxy ModelsLinkSharingSharedBy) + propMimeEq MimeJSON (Proxy :: Proxy ModelsMessage) + propMimeEq MimeJSON (Proxy :: Proxy ModelsProject) + propMimeEq MimeJSON (Proxy :: Proxy ModelsProjectDuplicate) + propMimeEq MimeJSON (Proxy :: Proxy ModelsProjectDuplicateDuplicatedProject) + propMimeEq MimeJSON (Proxy :: Proxy ModelsProjectOwner) + propMimeEq MimeJSON (Proxy :: Proxy ModelsProjectSubscription) + propMimeEq MimeJSON (Proxy :: Proxy ModelsProjectUser) + propMimeEq MimeJSON (Proxy :: Proxy ModelsProjectView) + propMimeEq MimeJSON (Proxy :: Proxy ModelsProjectViewBucketConfiguration) + propMimeEq MimeJSON (Proxy :: Proxy ModelsProjectViewKind) + propMimeEq MimeJSON (Proxy :: Proxy ModelsReaction) + propMimeEq MimeJSON (Proxy :: Proxy ModelsReactionUser) + propMimeEq MimeJSON (Proxy :: Proxy ModelsRelationKind) + propMimeEq MimeJSON (Proxy :: Proxy ModelsReminderRelation) + propMimeEq MimeJSON (Proxy :: Proxy ModelsRight) + propMimeEq MimeJSON (Proxy :: Proxy ModelsRouteDetail) + propMimeEq MimeJSON (Proxy :: Proxy ModelsSavedFilter) + propMimeEq MimeJSON (Proxy :: Proxy ModelsSavedFilterFilters) + propMimeEq MimeJSON (Proxy :: Proxy ModelsSavedFilterOwner) + propMimeEq MimeJSON (Proxy :: Proxy ModelsSharingType) + propMimeEq MimeJSON (Proxy :: Proxy ModelsSubscription) + propMimeEq MimeJSON (Proxy :: Proxy ModelsTask) + propMimeEq MimeJSON (Proxy :: Proxy ModelsTaskAssginee) + propMimeEq MimeJSON (Proxy :: Proxy ModelsTaskAttachment) + propMimeEq MimeJSON (Proxy :: Proxy ModelsTaskBucket) + propMimeEq MimeJSON (Proxy :: Proxy ModelsTaskCollection) + propMimeEq MimeJSON (Proxy :: Proxy ModelsTaskComment) + propMimeEq MimeJSON (Proxy :: Proxy ModelsTaskPosition) + propMimeEq MimeJSON (Proxy :: Proxy ModelsTaskRelation) + propMimeEq MimeJSON (Proxy :: Proxy ModelsTaskRelationCreatedBy) + propMimeEq MimeJSON (Proxy :: Proxy ModelsTaskReminder) + propMimeEq MimeJSON (Proxy :: Proxy ModelsTaskRepeatMode) + propMimeEq MimeJSON (Proxy :: Proxy ModelsTeam) + propMimeEq MimeJSON (Proxy :: Proxy ModelsTeamCreatedBy) + propMimeEq MimeJSON (Proxy :: Proxy ModelsTeamMember) + propMimeEq MimeJSON (Proxy :: Proxy ModelsTeamProject) + propMimeEq MimeJSON (Proxy :: Proxy ModelsTeamUser) + propMimeEq MimeJSON (Proxy :: Proxy ModelsTeamWithRight) + propMimeEq MimeJSON (Proxy :: Proxy ModelsUserWithRight) + propMimeEq MimeJSON (Proxy :: Proxy ModelsWebhook) + propMimeEq MimeJSON (Proxy :: Proxy ModelsWebhookCreatedBy) + propMimeEq MimeJSON (Proxy :: Proxy NotificationsDatabaseNotification) + propMimeEq MimeJSON (Proxy :: Proxy OpenidCallback) + propMimeEq MimeJSON (Proxy :: Proxy OpenidProvider) + propMimeEq MimeJSON (Proxy :: Proxy TodoistMigration) + propMimeEq MimeJSON (Proxy :: Proxy TrelloMigration) + propMimeEq MimeJSON (Proxy :: Proxy UserAPIUserPassword) + propMimeEq MimeJSON (Proxy :: Proxy UserEmailConfirm) + propMimeEq MimeJSON (Proxy :: Proxy UserEmailUpdate) + propMimeEq MimeJSON (Proxy :: Proxy UserLogin) + propMimeEq MimeJSON (Proxy :: Proxy UserPasswordReset) + propMimeEq MimeJSON (Proxy :: Proxy UserPasswordTokenRequest) + propMimeEq MimeJSON (Proxy :: Proxy UserTOTP) + propMimeEq MimeJSON (Proxy :: Proxy UserTOTPPasscode) + propMimeEq MimeJSON (Proxy :: Proxy UserToken) + propMimeEq MimeJSON (Proxy :: Proxy UserUser) + propMimeEq MimeJSON (Proxy :: Proxy V1AuthInfo) + propMimeEq MimeJSON (Proxy :: Proxy V1LegalInfo) + propMimeEq MimeJSON (Proxy :: Proxy V1LinkShareAuth) + propMimeEq MimeJSON (Proxy :: Proxy V1LocalAuthInfo) + propMimeEq MimeJSON (Proxy :: Proxy V1OpenIDAuthInfo) + propMimeEq MimeJSON (Proxy :: Proxy V1UserAvatarProvider) + propMimeEq MimeJSON (Proxy :: Proxy V1UserDeletionRequestConfirm) + propMimeEq MimeJSON (Proxy :: Proxy V1UserPassword) + propMimeEq MimeJSON (Proxy :: Proxy V1UserPasswordConfirmation) + propMimeEq MimeJSON (Proxy :: Proxy V1UserSettings) + propMimeEq MimeJSON (Proxy :: Proxy V1UserWithSettings) + propMimeEq MimeJSON (Proxy :: Proxy V1VikunjaInfos) + propMimeEq MimeJSON (Proxy :: Proxy WebHTTPError) + diff --git a/vikunja-api.cabal b/vikunja-api.cabal new file mode 100644 index 0000000..5e14794 --- /dev/null +++ b/vikunja-api.cabal @@ -0,0 +1,134 @@ +name: vikunja-api +version: 0.24.6.0 +synopsis: Auto-generated vikunja-api API Client +description: . + Client library for calling the Vikunja API API based on http-client. + . + host: localhost + . + base path: /api/v1 + . + Vikunja API API version: 0.24.6 + . + OpenAPI version: 3.0.1 + . +category: Web +homepage: https://openapi-generator.tech +author: Obsidian Systems LLC +maintainer: maintainer@obsidian.systems +copyright: 2024 Obsidian Systems LLC +license: BSD3 +build-type: Simple +cabal-version: >= 1.10 +tested-with: GHC ==8.10.7 +license-file: LICENSE + + +extra-source-files: + ChangeLog.md + README.md + openapi.yaml + +Flag UseKatip + Description: Use the katip package to provide logging (if false, use the default monad-logger package) + Default: True + Manual: True + +library + hs-source-dirs: + lib + ghc-options: -Wall -funbox-strict-fields + build-depends: + aeson >=1.0 && <3.0 + , base >=4.7 && <5.0 + , base64-bytestring >1.0 && <2.0 + , bytestring >=0.10.0 + , case-insensitive + , containers >=0.5.0.0 && <0.8 + , deepseq >= 1.4 && <1.6 + , exceptions >= 0.4 + , http-api-data >= 0.3.4 && <0.5 + , http-client >=0.5 && <0.8 + , http-client-tls + , http-media >= 0.4 && < 0.9 + , http-types >=0.8 && <0.13 + , iso8601-time >=0.1.3 && <0.2.0 + , microlens >= 0.4.3 + , mtl >=2.2.1 + , network >=2.6.2 && <3.9 + , random >=1.1 + , safe-exceptions <0.2 + , text >=0.11 && <1.3 + , time >=1.5 + , transformers >=0.4.0.0 + , unordered-containers + , vector >=0.10.9 && <0.13 + other-modules: + Paths_vikunja_api + exposed-modules: + Vikunja + Vikunja.API + Vikunja.API.Api + Vikunja.API.Assignees + Vikunja.API.Auth + Vikunja.API.Filter + Vikunja.API.Labels + Vikunja.API.Migration + Vikunja.API.Project + Vikunja.API.Service + Vikunja.API.Sharing + Vikunja.API.Subscriptions + Vikunja.API.Task + Vikunja.API.Team + Vikunja.API.Testing + Vikunja.API.User + Vikunja.API.Webhooks + Vikunja.Client + Vikunja.Core + Vikunja.Logging + Vikunja.MimeTypes + Vikunja.Model + Vikunja.ModelLens + default-language: Haskell2010 + + if flag(UseKatip) + build-depends: katip >=0.8 && < 1.0 + other-modules: Vikunja.LoggingKatip + cpp-options: -DUSE_KATIP + else + build-depends: monad-logger >=0.3 && <0.4 + other-modules: Vikunja.LoggingMonadLogger + cpp-options: -DUSE_MONAD_LOGGER + +test-suite tests + type: exitcode-stdio-1.0 + main-is: Test.hs + hs-source-dirs: + tests + ghc-options: -Wall -fno-warn-orphans + build-depends: + vikunja-api + , QuickCheck + , aeson + , base >=4.7 && <5.0 + , bytestring >=0.10.0 + , containers + , hspec >=1.8 + , iso8601-time + , mtl >=2.2.1 + , semigroups + , text + , time + , transformers >=0.4.0.0 + , unordered-containers + , vector + other-modules: + ApproxEq + Instances + PropMime + default-language: Haskell2010 + +source-repository head + type: git + location: https://github.com/obsidiansystems/vikunja-api +