---
openapi: 3.1.2
info:
  title: pollen API
  version: 3.5.5-SNAPSHOT
paths:
  /v2/status:
    get:
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PollenStatus"
      summary: Get Status
      operationId: status
      tags:
        - Health
  /v2/logout:
    delete:
      responses:
        '204':
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/UndefinedResponse"
      operationId: logout
      tags:
        - Auth
  /v2/login:
    post:
      parameters:
        - name: Authorization
          in: header
          schema:
            type: string
          required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PollenUserId"
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '500':
          $ref: '#/components/responses/500'
      operationId: login
      tags:
        - Auth
  /v2/feedback:
    post:
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Feedback"
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: boolean
        '400':
          $ref: '#/components/responses/400'
      summary: Add FeedBack
      operationId: addFeedBack
      tags:
        - Feedback
  /v2/gtu:
    get:
      responses:
        "200":
          description: OK
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
          headers:
            Content-Disposition:
              schema:
                type: string
      summary: download the GTU definition file
      operationId: getGtu
      tags:
        - Gtu
  /v2/gtu/define:
    get:
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: boolean
      summary: Is Gtu
      operationId: isGtu
      tags:
        - Gtu
  /v2/password-reset-requests:
    post:
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - email
              properties:
                email:
                  type: string
        required: true
      responses:
        '204':
          $ref: '#/components/responses/204'
      summary: Request of a lost password
      operationId: requestPasswordReset
      tags:
        - Auth
  /v2/password-reset-confirmations:
    put:
      parameters:
        - name: userId
          in: path
          required: true
          schema:
            type: string
            format: UserId
        - name: token
          in: query
          schema:
            type: string
      responses:
        "204":
          description: No Content
      summary: Confirm the request of a lost password
      operationId: confirmPasswordReset
      tags:
        - Auth
  /v2/users/:
    post:
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/NewUser"
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: string
                format: UserId
        "400":
          description: Bad Request
      summary: Create User
      operationId: CreateUser
      tags:
        - User
  /v2/users/{userId}:
    get:
      parameters:
        - name: userId
          in: path
          required: true
          schema:
            type: string
            format: UserId
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/User"
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      summary: Get User
      operationId: getUser
      tags:
        - User
    put:
      parameters:
        - name: userId
          in: path
          required: true
          schema:
            type: string
            format: UserId
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/User"
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/User"
        "400":
          description: Bad Request
      summary: Edit User
      operationId: EditUser
      tags:
        - User
    delete:
      parameters:
        - name: userId
          in: path
          required: true
          schema:
            type: string
            format: UserId
        - name: anonymize
          in: query
          schema:
            type: boolean
      responses:
        '204':
          $ref: '#/components/responses/204'
        '403':
          $ref: '#/components/responses/403'
      summary: Delete User
      operationId: deleteUser
      tags:
        -  User
  /v2/users/{userId}/validateEmail:
    put:
      parameters:
        - name: userId
          in: path
          required: true
          schema:
            type: string
            format: UserId
        - name: token
          in: query
          schema:
            type: string
      responses:
        '204':
          $ref: '#/components/responses/204'
      summary: Validate User Email
      operationId: validateUserEmail
      tags:
        - User
  /v2/user:
    get:
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/UserSummary"
        '401':
          $ref: '#/components/responses/401'
        '500':
          $ref: '#/components/responses/500'
      summary: Get Connected User
      operationId: getConnectedUser
      tags:
        - User
  /v2/user/password:
    put:
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ChangePassword"
        required: true
      responses:
        "204":
          description: No Content
        "400":
          description: Bad Request
      summary: ChangePassword
      operationId: changePassword
      tags:
        - User
  /v2/user/avatar:
    delete:
      responses:
        "204":
          description: No Content
      summary: Delete User Avatar
      operationId: deleteUserAvatar
      tags:
        - User
    post:
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - avatar
                - filename
                - contentType
              properties:
                avatar:
                  type: string
                  format: binary
                  description: Image file for the avatar
                filename:
                  type: string
                  description: Original file name
                contentType:
                  type: string
                  description: MIME type of the file
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: string
                format: ResourceId
        "400":
          description: Bad Request
      summary: Upload user avatar
      operationId: UploadAvatar
      tags:
        - User
  /v2/user/{userId}/email:
    post:
      parameters:
        - name: userId
          in: path
          required: true
          schema:
            type: string
            format: UserId
          description: ID of the user to add the email for
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/NewEmail"
      responses:
        '200':
          description: Email added
        '401':
          description: Not authenticated
      summary: Add email to connected user
      operationId: addEmail
      tags:
        - User
  /v2/user/{userId}/email/{emailAddressId}:
    put:
      parameters:
        - name: userId
          in: path
          required: true
          schema:
            type: string
            format: UserId
          description: ID of the user
        - name: emailAddressId
          in: path
          required: true
          schema:
            type: string
            format: UserEmailAddressId
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UserEmailAddress"
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/UserEmailAddress"
        "400":
          description: Bad Request
      summary: Edit Email Address
      operationId: EditEmailAddress
      tags:
        - User
    delete:
      parameters:
        - name: userId
          in: path
          required: true
          schema:
            type: string
            format: UserId
          description: ID of the user
        - name: emailAddressId
          in: path
          required: true
          schema:
            type: string
            format: UserEmailAddressId
      responses:
        "204":
          description: No Content
      summary: Remove email address
      operationId: removeEmailAddress
      tags:
        - User
  /v2/user/{userId}/email/{emailAddressId}/default:
    put:
      parameters:
        - name: userId
          in: path
          required: true
          schema:
            type: string
            format: UserId
        - name: emailAddressId
          in: path
          required: true
          schema:
            type: string
            format: UserEmailAddressId
      responses:
        "204":
          description: No Content
      summary: Set default email address
      operationId: setDefaultEmailAddress
      tags:
        - User
  /v2/user/{userId}/email/{emailAddressId}/resendValidation:
    post:
      parameters:
        - name: userId
          in: path
          required: true
          schema:
            type: string
            format: UserId
        - name: emailAddressId
          in: path
          required: true
          schema:
            type: string
            format: UserEmailAddressId
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ResendValidationRequest"
      responses:
        '201':
          description: Created
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
      summary: Resend validation for a mail
      operationId: resendValidation
      tags:
      - User
  /v2/favoriteLists:
    get:
      parameters:
        - name: desc
          in: query
          schema:
            type: boolean
        - name: order
          in: query
          schema:
            type: string
        - name: pageNumber
          in: query
          schema:
            type: integer
            format: int32
        - name: pageSize
          in: query
          schema:
            type: integer
            format: int32
        - name: search
          in: query
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PaginatedFavoriteLists"
        '401':
          description: Not authenticated
      summary: Get favorite lists
      operationId: getFavoriteLists
      tags:
        - FavoriteList
    post:
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/NewFavoriteList"
      responses:
        '200':
          description: Favorite list created
          content:
            application/json:
              schema:
                type: string
                format: FavoriteListId
        '400':
          description: Bad request
        '401':
          description: Not authenticated
      summary: Create favorite list
      operationId: createFavoriteList
      tags:
        - FavoriteList
  /v2/favoriteLists/exports:
    get:
      responses:
        "200":
          description: OK
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
      summary: Export Favorite Lists
      operationId: exportFavoriteLists
      tags:
        - FavoriteList
  /v2/favoriteLists/{favoriteListId}:
    get:
      parameters:
        - name: favoriteListId
          in: path
          required: true
          schema:
            type: string
            format: FavoriteListId
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FavoriteList"
      summary: Get Favorite List
      operationId: getFavoriteList
      tags:
        - FavoriteList
    put:
      parameters:
        - name: favoriteListId
          in: path
          required: true
          schema:
            type: string
            format: FavoriteListId
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/FavoriteList"
        required: true
      responses:
        "204":
          description: No Content
        "400":
          description: Bad Request
      summary: Edit Favorite List
      operationId: editFavoriteList
      tags:
        - FavoriteList
    delete:
      parameters:
        - name: favoriteListId
          in: path
          required: true
          schema:
            type: string
            format: FavoriteListId
      responses:
        "204":
          description: No Content
      summary: Delete Favorite List
      operationId: deleteFavoriteLists
      tags:
        - FavoriteList
  /v2/favoriteLists/{favoriteListId}/lists:
    get:
      parameters:
        - name: favoriteListId
          in: path
          required: true
          schema:
            type: string
            format: FavoriteListId
        - name: desc
          in: query
          schema:
            type: boolean
        - name: order
          in: query
          schema:
            type: string
        - name: pageNumber
          in: query
          schema:
            type: integer
            format: int32
        - name: pageSize
          in: query
          schema:
            type: integer
            format: int32
        - name: search
          in: query
          schema:
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PaginationResultChildFavoriteList"
      summary: Get Children Lists
      operationId: getChildrenLists
      tags:
        - FavoriteList
    post:
      parameters:
        - name: favoriteListId
          in: path
          required: true
          schema:
            type: string
            format: FavoriteListId
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/NewChildFavoriteList"
        required: true
      responses:
        "200":
          description: OK
        "400":
          description: Bad Request
      summary: Add Child List
      operationId: addChildList
      tags:
        - FavoriteList
  /v2/favoriteLists/{favoriteListId}/lists/{childListId}:
    put:
      parameters:
        - name: favoriteListId
          in: path
          required: true
          schema:
            type: string
            format: FavoriteListId
        - name: childListId
          in: path
          required: true
          schema:
            type: string
            format: ChildFavoriteListeId
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ChildFavoriteList"
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ChildFavoriteList"
        "400":
          description: Bad Request
      summary: Edit Child List
      operationId: EditChildList
      tags:
        - FavoriteList
    delete:
      parameters:
        - name: childListId
          in: path
          required: true
          schema:
            type: string
            format: ChildFavoriteListId
        - name: favoriteListId
          in: path
          required: true
          schema:
            type: string
            format: FavoriteListId
      responses:
        "204":
          description: No Content
      summary: Remove child list
      operationId: removeChildList
      tags:
        - FavoriteList
  /v2/favoriteLists/{favoriteListId}/members:
    get:
      parameters:
        - name: favoriteListId
          in: path
          required: true
          schema:
            type: string
            format: FavoriteListId
        - name: desc
          in: query
          schema:
            type: boolean
        - name: order
          in: query
          schema:
            type: string
        - name: pageNumber
          in: query
          schema:
            type: integer
            format: int32
        - name: pageSize
          in: query
          schema:
            type: integer
            format: int32
        - name: search
          in: query
          schema:
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PaginationResultFavoriteListMember"
      summary: Get Members
      operationId: getFavoriteListMembers
      tags:
        - FavoriteList
    post:
      parameters:
        - name: favoriteListId
          in: path
          required: true
          schema:
            type: string
            format: FavoriteListId
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/NewFavoriteListMember"
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: string
                format: FavoriteListMemberId
        "400":
          description: Bad Request
      summary: Add Member
      operationId: addMember
      tags:
        - FavoriteList
  /v2/favoriteLists/{favoriteListId}/members/{memberId}:
    delete:
      parameters:
        - name: favoriteListId
          in: path
          required: true
          schema:
            type: string
            format: FavoriteListId
        - name: memberId
          in: path
          required: true
          schema:
            type: string
            format: FavoriteListMemberId
      responses:
        "204":
          description: No Content
      summary: Delete Member
      operationId: deleteMember
      tags:
        - FavoriteList
    put:
      parameters:
        - name: favoriteListId
          in: path
          required: true
          schema:
            type: string
            format: FavoriteListId
        - name: memberId
          in: path
          required: true
          schema:
            type: string
            format: FavoriteListMemberId
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/FavoriteListMember"
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FavoriteListMember"
        "400":
          description: Bad Request
      summary: Edit Member
      operationId: editMember
      tags:
        - FavoriteList
  /v2/favoriteLists/{favoriteListId}/importCsv:
    post:
      parameters:
        - name: favoriteListId
          in: path
          required: true
          schema:
            type: string
            format: FavoriteListId
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CsvImport'
      responses:
        "201":
          description: Created
        "400":
          description: Bad Request
      summary: Import Favorite List Members From Csv
      operationId: importFavoriteListMembersFromCsv
      tags:
        - FavoriteList
  /v2/favoriteLists/{favoriteListId}/importLdap:
    post:
      parameters:
        - name: favoriteListId
          in: path
          required: true
          schema:
            type: string
            format: FavoriteListId
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/LdapImport"
      responses:
        "201":
          description: Created
      summary: Import Favorite List Members From Ldap
      operationId: importFavoriteListMembersFromLdap
      tags:
        - FavoriteList
  /v2/favoriteLists/parseCSV:
    post:
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - file
              properties:
                file:
                  type: string
                  format: binary
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/NewFavoriteListMember"
      summary: Get participant for voter list from CSV file
      operationId: parseFavoriteListMemberFromCsv
      tags:
        - FavoriteList
  /v2/favoriteLists/parseCSV/downloadCsvTemplate:
    post:
      parameters:
        - name: withWeight
          in: query
          required: false
          schema:
            type: boolean
            default: false
      responses:
        "200":
          description: OK
          content:
            text/csv:
              schema:
                type: string
                format: binary
        "400":
          description: Bad request
        "401":
          description: Unauthorized
      summary: download the template csv for import members
      operationId: downloadCsvTemplate
      tags:
        - FavoriteList
  /v2/polls:
    get:
      parameters:
        - name: search
          in: query
          schema:
            type: string
          required: false
        - name: usage
          in: query
          schema:
            $ref: '#/components/schemas/PollGetUsage'
          required: false
        - name: filter
          in: query
          schema:
            $ref: '#/components/schemas/PollGetFilter'
          required: false
        - name: pageNumber
          in: query
          schema:
            type: integer
            format: int32
        - name: pageSize
          in: query
          schema:
            type: integer
            format: int32
        - name: order
          in: query
          schema:
            type: string
        - name: desc
          in: query
          schema:
            type: boolean
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PaginatedPolls"
        '401':
          $ref: '#/components/responses/401'
        '500':
          $ref: '#/components/responses/500'
      summary: get a list (paginated) of the existing polls
      operationId: getPolls
      tags:
        - Poll
    post:
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PollRequest'
        required: true
      responses:
        "201":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PollIdRef'
        '400':
          $ref: '#/components/responses/400'
          description: Bad Request
      summary: Create a poll
      operationId: createPoll
      tags:
        - Poll
  /v2/polls/{pollId}:
    get:
      parameters:
        - name: pollId
          in: path
          required: true
          schema:
            type: string
            format: PollId
        - name: X-Pollen-Permission
          in: header
          schema:
            type: string
          required: false
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Poll'
      summary: Get the Poll through its id
      operationId: getPoll
      tags:
        - Poll
    put:
      parameters:
        - name: pollId
          in: path
          required: true
          schema:
            type: string
            format: PollId
        - name: X-Pollen-Permission
          in: header
          schema:
            type: string
          required: false
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PollEditRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PollIdRef'
      summary: Edit the poll
      operationId: editPoll
      tags:
        - Poll
    delete:
      parameters:
        - name: pollId
          in: path
          required: true
          schema:
            type: string
            format: PollId
        - name: X-Pollen-Permission
          in: header
          schema:
            type: string
          required: false
      responses:
        '204':
          $ref: '#/components/responses/204'
      summary: delete the poll
      operationId: deletePoll
      tags:
        - Poll
  /v2/polls/{pollId}/clone:
    post:
      parameters:
        - name: pollId
          in: path
          required: true
          schema:
            type: string
            format: PollId
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PollIdRef'
      summary: Create a copy of the existing poll
      operationId: clonePoll
      tags:
        - Poll
  /v2/polls/{pollId}/close:
    put:
      parameters:
        - name: pollId
          in: path
          required: true
          schema:
            type: string
            format: PollId
        - name: X-Pollen-Permission
          in: header
          schema:
            type: string
          required: false
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: string
                format: date-time
      summary: Close the poll to prevent any further votes
      operationId: closePoll
      tags:
        - Poll
  /v2/polls/{pollId}/reopen:
    put:
      parameters:
        - name: pollId
          in: path
          required: true
          schema:
            type: string
            format: PollId
        - name: X-Pollen-Permission
          in: header
          schema:
            type: string
          required: false
      responses:
        '204':
          $ref: '#/components/responses/204'
      summary: Reopen a closed poll to allow voting again
      operationId: reopenPoll
      tags:
        - Poll
  /v2/polls/{pollId}/assign:
    put:
      parameters:
        - name: pollId
          in: path
          required: true
          schema:
            type: string
            format: PollId
        - name: X-Pollen-Permission
          in: header
          schema:
            type: string
          required: false
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Poll"
      summary: Assign an existing poll to an user
      operationId: assignPoll
      tags:
        - Poll
  /v2/polls/{pollId}/invalidEmails:
    get:
      parameters:
        - name: pollId
          in: path
          required: true
          schema:
            type: string
            format: PollId
        - name: X-Pollen-Permission
          in: header
          schema:
            type: string
          required: false
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                uniqueItems: true
                items:
                  type: string
      summary: Get the invalid emails (email that may not exist)
      operationId: getInvalidEmails
      tags:
        - Poll
  /v2/polls/{pollId}/questions/choices:
    post:
      parameters:
        - name: pollId
          in: path
          required: true
          schema:
            type: string
            format: PollId
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Choice"
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ChoiceIdRef"
        "400":
          description: Bad Request
      summary: Add a new choice to an existing poll
      operationId: addChoice
      tags:
        - Poll
  /v2/polls/{pollId}/comments:
    get:
      parameters:
        - name: pollId
          in: path
          required: true
          schema:
            type: string
            format: PollId
        - name: pageNumber
          in: query
          schema:
            type: integer
            format: int32
        - name: pageSize
          in: query
          schema:
            type: integer
            format: int32
        - name: order
          in: query
          schema:
            type: string
        - name: desc
          in: query
          schema:
            type: boolean
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PaginatedComments"
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '500':
          $ref: '#/components/responses/500'
      summary: List poll comments
      operationId: getPollComments
      tags:
        - Comment
    post:
      parameters:
        - name: pollId
          in: path
          required: true
          schema:
            type: string
            format: PollId
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CommentInputs"
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CommentRef"
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '500':
          $ref: '#/components/responses/500'
      summary: Create poll comment
      operationId: createPollComment
      tags:
        - Comment
  /v2/polls/{pollId}/comments/{commentId}:
    put:
      parameters:
        - name: pollId
          in: path
          required: true
          schema:
            type: string
            format: PollId
        - name: commentId
          in: path
          required: true
          schema:
            type: string
            format: CommentId
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CommentInputs"
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CommentRef"
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '500':
          $ref: '#/components/responses/500'
      summary: Update existing poll comment
      operationId: updatePollComment
      tags:
        - Comment
    delete:
      parameters:
        - name: pollId
          in: path
          required: true
          schema:
            type: string
            format: PollId
        - name: commentId
          in: path
          required: true
          schema:
            type: string
            format: CommentId
      responses:
        '204':
          $ref: '#/components/responses/204'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '500':
          $ref: '#/components/responses/500'
      summary: Delete poll comment
      operationId: deletePollComment
      tags:
        - Comment
  /v2/polls/{pollId}/voterLists/{voterListId}:
    get:
      parameters:
        - name: pollId
          in: path
          required: true
          schema:
            type: string
            format: PollId
        - name: voterListId
          in: path
          required: true
          schema:
            type: string
            format: VoterListId
        - name: X-Pollen-Permission
          in: header
          schema:
            type: string
          required: false
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/VoterList"
      summary: Get the voter list from its id
      operationId: getVoterList
      tags:
        - VoterList
  /v2/polls/{pollId}/voterLists/{voterListId}/sublists:
    get:
      parameters:
        - name: pollId
          in: path
          required: true
          schema:
            type: string
            format: PollId
        - name: voterListId
          in: path
          required: true
          schema:
            type: string
            format: VoterListId
        - name: X-Pollen-Permission
          in: header
          schema:
            type: string
          required: false
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/VoterList"
      summary: Get the voter sublists of a voter list
      operationId: getVoterSublists
      tags:
        - VoterList
  /v2/polls/{pollId}/voterLists/{voterListId}/members:
    get:
      parameters:
        - name: pollId
          in: path
          required: true
          schema:
            type: string
            format: PollId
        - name: voterListId
          in: path
          required: true
          schema:
            type: string
            format: VoterListId
        - name: X-Pollen-Permission
          in: header
          schema:
            type: string
          required: false
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                uniqueItems: true
                items:
                  $ref: "#/components/schemas/VoterListMember"
      summary: Get the members of a voter list
      operationId: getVoterListMembers
      tags:
        - VoterList
  /v2/polls/{pollId}/voterLists/{voterListId}/send:
    post:
      parameters:
        - name: pollId
          in: path
          required: true
          schema:
            type: string
            format: PollId
        - name: voterListId
          in: path
          required: true
          schema:
            type: string
            format: VoterListId
        - name: X-Pollen-Permission
          in: header
          schema:
            type: string
          required: false
        - name: resend
          in: query
          required: false
          schema:
            type: boolean
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: integer
                format: int32
      summary: Send an invitation of all the member of a voter List
      operationId: sendInvitationVoterList
      tags:
        - VoterList
  /v2/polls/{pollId}/voterLists/{voterListId}/members/{memberId}/send:
    post:
      parameters:
        - name: pollId
          in: path
          required: true
          schema:
            type: string
            format: PollId
        - name: voterListId
          in: path
          required: true
          schema:
            type: string
            format: VoterListId
        - name: memberId
          in: path
          required: true
          schema:
            type: string
            format: VoterListMemberId
        - name: resend
          in: query
          required: false
          schema:
            type: boolean
        - name: X-Pollen-Permission
          in: header
          schema:
            type: string
          required: false
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: boolean
      summary: Send an invitation to a specific member
      operationId: sendInvitationMember
      tags:
        - VoterList
  /v2/polls/{pollId}/votes:
    get:
      parameters:
        - name: pollId
          in: path
          required: true
          schema:
            type: string
            format: PollId
        - name: order
          in: query
          schema:
            type: string
        - name: pageNumber
          in: query
          schema:
            type: integer
            format: int32
        - name: pageSize
          in: query
          schema:
            type: integer
            format: int32
        - name: X-Pollen-Permission
          in: header
          schema:
            type: string
          required: false
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PaginatedVotes"
      summary: Get all votes for a poll
      operationId: getVotes
      tags:
        - Vote
    post:
      parameters:
        - name: pollId
          in: path
          required: true
          schema:
            type: string
            format: PollId
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/NewVote"
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/VoteIdRef"
        '400':
          $ref: '#/components/responses/400'
      summary: Add a vote for a poll
      operationId: addVote
      tags:
        - Vote
  /v2/polls/{pollId}/votes/new:
    get:
      parameters:
        - name: pollId
          in: path
          required: true
          schema:
            type: string
            format: PollId
        - name: X-Pollen-Permission
          in: header
          schema:
            type: string
          required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Vote"
      summary: get a blank vote for restricted poll voter
      operationId: getNewVote
      tags:
        - Vote
  /v2/polls/{pollId}/votes/{voteId}:
    put:
      parameters:
        - name: pollId
          in: path
          required: true
          schema:
            type: string
            format: PollId
        - name: voteId
          in: path
          required: true
          schema:
            type: string
            format: VoteId
        - name: X-Pollen-Permission
          in: header
          schema:
            type: string
          required: false
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Vote"
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Vote"
        '400':
          $ref: '#/components/responses/400'
      summary: Edit a vote for a poll
      operationId: editVote
      tags:
        - Vote
    delete:
      parameters:
        - name: pollId
          in: path
          required: true
          schema:
            type: string
            format: PollId
        - name: voteId
          in: path
          required: true
          schema:
            type: string
            format: VoteId
        - name: X-Pollen-Permission
          in: header
          schema:
            type: string
          required: false
      responses:
        '204':
          $ref: '#/components/responses/204'
      summary: Delete a vote for a poll
      operationId: deleteVote
      tags:
        - Vote
  /v2/polls/{pollId}/results:
    get:
      parameters:
        - name: pollId
          in: path
          required: true
          schema:
            type: string
            format: PollId
        - name: X-Pollen-Permission
          in: header
          schema:
            type: string
          required: false
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/VoteCountingResult"
      summary: Get the result of a poll
      operationId: getMainResult
      tags:
        - VoteCounting
  /v2/resources:
    post:
      parameters:
        - name: height
          in: query
          schema:
            type: integer
            format: int32
        - name: width
          in: query
          schema:
            type: integer
            format: int32
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: "#/components/schemas/ResourceUpload"
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: string
                format: ResourceId
        '400':
          $ref: '#/components/responses/400'
      summary: post a new resource
      operationId: createResource
      tags:
        - Resource
  /v2/resources64:
    post:
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Resource64"
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: string
                format: ResourceId
        '400':
          $ref: '#/components/responses/400'
      summary: Create Resource 64
      operationId: createResource64
      tags:
        - Resource
  /v2/resources/{resourceId}:
    get:
      parameters:
        - name: resourceId
          in: path
          required: true
          schema:
            type: string
            format: ResourceId
      responses:
        '200':
          description: OK
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
        '204':
          $ref: '#/components/responses/204'
        '304':
          description: Not Modified
      summary: Get Resource
      operationId: getResource
      tags:
        - Resource
  /v2/resources/{resourceId}/preview:
    get:
      parameters:
        - name: resourceId
          in: path
          required: true
          schema:
            type: string
            format: ResourceId
        - name: maxDimension
          in: query
          schema:
            type: boolean
          required: false
      responses:
        '200':
          description: OK
          content:
            application/octet-stream:
              schema:
                $ref: "#/components/schemas/UndefinedResponse"
        '401':
          $ref: '#/components/responses/401'
        '500':
          $ref: '#/components/responses/500'
      summary: Get resource preview
      operationId: getPreview
      tags:
        - Resource
components:
  responses:
    '204':
      description: No Content
    '400':
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    '401':
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    '403':
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    '404':
      description: Not Found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    '500':
      description: Internal Server Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
  schemas:
    AppStatus:
      type: object
      properties:
        version:
          type: string
        commitId:
          type: string
        buildDate:
          type: string
    PersistenceStatus:
      type: object
      properties:
        nbPolls:
          type: integer
          format: int64
        errors:
          type: array
          items:
            type: string
    PollenStatus:
      type: object
      properties:
        app:
          $ref: "#/components/schemas/AppStatus"
        runtime:
          $ref: "#/components/schemas/RuntimeStatus"
        persistence:
          $ref: "#/components/schemas/PersistenceStatus"
    RuntimeStatus:
      type: object
      properties:
        jvmName:
          type: string
        javaVersion:
          type: string
        availableProcessors:
          type: integer
          format: int32
        loadAverage:
          type: number
          format: double
        memoryAllocated:
          type: string
        memoryUsed:
          type: string
        memoryFree:
          type: string
        memoryMax:
          type: string
        charset:
          type: string
        zoneId:
          type: string
        runningSince:
          type: string
          format: date-time
        uptime:
          type: string
    PollGetUsage:
      type: string
      enum:
        - ALL
        - INVITED
        - PARTICIPATED
        - CREATED
    PollGetFilter:
      type: string
      enum:
        - NONE
        - PAST
        - CURRENT
        - UPCOMING
    Pagination:
      type: object
      properties:
        count:
          type: integer
          format: int64
        currentPage:
          type: integer
          format: int32
        lastPage:
          type: integer
          format: int32
        pageSize:
          type: integer
          format: int32
        order:
          type: string
        desc:
          type: boolean
    VoteVisibility:
      type: string
      enum:
        - ANONYMOUS
        - CREATOR
        - VOTER
        - EVERYBODY
    CommentVisibility:
      type: string
      enum:
        - CREATOR
        - VOTER
        - EVERYBODY
    ResultVisibility:
      type: string
      enum:
        - CREATOR
        - VOTER
        - EVERYBODY
    PollStatus:
      type: string
      enum:
        - CREATED
        - VOTING
        - ADDING_CHOICES
        - CLOSED
    PollType:
      type: string
      enum:
        - PUBLIC
        - INVITED_ONLY
        - AUTHENTICATED_ONLY
    ResultPresentation:
      type: string
      enum:
        - TROPHY
        - BALLOT_BOX
    ChoiceType:
      type: string
      enum:
        - TEXT
        - DATE
        - RESOURCE
        - DATETIME
    PollRequest:
      type: object
      required:
        - poll
      properties:
        poll:
          $ref: "#/components/schemas/NewPoll"
        voterLists:
          type: array
          items:
            $ref: "#/components/schemas/VoterList"
        voterListMembers:
          type: array
          items:
            $ref: "#/components/schemas/VoterListMember"
    PollEditRequest:
      required:
        - poll
      type: object
      properties:
        poll:
          $ref: "#/components/schemas/Poll"
        voterLists:
          type: array
          items:
            $ref: "#/components/schemas/VoterList"
        voterListMembers:
          type: array
          items:
            $ref: "#/components/schemas/VoterListMember"
    PaginatedPolls:
      type: object
      required:
        - elements
        - pagination
      properties:
        elements:
          type: array
          items:
            $ref: "#/components/schemas/PollSummary"
        pagination:
          $ref: "#/components/schemas/Pagination"
    Poll:
      allOf:
        - $ref: "#/components/schemas/NewPoll"
        - type: object
          required:
            - id
            - createDate
            - closed
            - commentCount
            - participantCount
            - participantInvitedCount
            - canVote
          properties:
            id:
              type: string
              format: PollId
            createDate:
              type: string
              format: date-time
            permission:
              type: string
            closed:
              type: boolean
            commentCount:
              type: integer
              format: int64
            participantCount:
              type: integer
              format: int64
            participantInvitedCount:
              type: integer
              format: int64
            canVote:
              type: boolean
    NewPoll:
      type: object
      required:
        - creatorName
        - title
        - pollType
        - commentVisibility
        - voteVisibility
        - resultVisibility
        - resultPresentation
        - question
      properties:
        creatorName:
          type: string
        creatorEmail:
          type: string
        title:
          type: string
        description:
          type: string
        beginDate:
          type: string
          format: date-time
        endDate:
          type: string
          format: date-time
        anonymousVoteAllowed:
          type: boolean
        continuousResults:
          type: boolean
        pollType:
          $ref: "#/components/schemas/PollType"
        voteVisibility:
          $ref: "#/components/schemas/VoteVisibility"
        commentVisibility:
          $ref: "#/components/schemas/CommentVisibility"
        resultVisibility:
          $ref: "#/components/schemas/ResultVisibility"
        resultIsVisible:
          type: boolean
        commentIsVisible:
          type: boolean
        voteIsVisible:
          type: boolean
        participantsIsVisible:
          type: boolean
        status:
          $ref: "#/components/schemas/PollStatus"
        notifyMeHoursBeforePollEnds:
          type: integer
          format: int32
        voteNotification:
          type: boolean
        commentNotification:
          type: boolean
        newChoiceNotification:
          type: boolean
        notificationLocale:
          type: string
        report:
          $ref: "#/components/schemas/ReportResume"
        gtuValidated:
          type: boolean
        maxVoters:
          type: integer
          format: int32
        creatorAvatar:
          type: string
        emailAddressSuffixes:
          type: array
          items:
            type: string
        question:
            $ref: "#/components/schemas/Question"
        picture:
          type: string
        builtinPicture:
          type: string
        resultPresentation:
          $ref: "#/components/schemas/ResultPresentation"
    PollSummary:
      type: object
      required:
        - id
        - title
        - status
        - creatorName
        - voteCount
        - canVote
      properties:
        id:
          type: string
        title:
          type: string
        permission:
          type: string
        status:
          $ref: "#/components/schemas/PollStatus"
        creatorAvatar:
          type: string
        creatorName:
          type: string
        voteCount:
          type: integer
          format: int64
        description:
          type: string
        beginDate:
          type: string
          format: date-time
        endDate:
          type: string
          format: date-time
        picture:
          type: string
        builtinPicture:
          type: string
    Question:
      type: object
      required:
        - choices
        - voteCount
        - voteCountingType
      properties:
        permission:
          type: string
        createDate:
          type: string
          format: date-time
        beginChoiceDate:
          type: string
          format: date-time
        endChoiceDate:
          type: string
          format: date-time
        choiceAddAllowed:
          type: boolean
        voteCountingType:
          $ref: "#/components/schemas/VoteCountingType"
        VoteCountingConfig:
          $ref: "#/components/schemas/VoteCountingConfig"
        poll:
          type: string
        resultIsVisible:
          type: boolean
        commentIsVisible:
          type: boolean
        voteIsVisible:
          type: boolean
        participantsIsVisible:
          type: boolean
        choices:
          type: array
          items:
            $ref: "#/components/schemas/Choice"
        choiceCount:
          type: integer
          format: int64
        voteCount:
          type: integer
          format: int64
        commentCount:
          type: integer
          format: int64
        questionOrder:
          type: integer
          format: int32
        canVote:
          type: boolean
        report:
          $ref: "#/components/schemas/ReportResume"
    VoteCountingType:
      type: string
      enum:
          - NORMAL
          - CUMULATIVE
          - CONDORCET
          - NUMBER
          - BORDA
          - INSTANT_RUN_OFF
          - COOMBS
          - MAJORITY_JUDGMENT
    VoteCountingConfig:
      type: object
      required:
        - type
      discriminator:
        propertyName: type
        mapping:
          BORDA: '#/components/schemas/BordaConfig'
          MIN_MAX: '#/components/schemas/MinMaxChoicesNumberConfig'
          CUMULATIVE: '#/components/schemas/CumulativeConfig'
          MAJORITY_JUDGMENT: '#/components/schemas/MajorityJudgmentConfig'
          EMPTY: '#/components/schemas/EmptyVoteCountingConfig'
      properties:
        type:
          type: string
          enum:
            - BORDA
            - MIN_MAX
            - CUMULATIVE
            - MAJORITY_JUDGMENT
            - EMPTY
    BordaConfig:
      allOf:
        - $ref: '#/components/schemas/VoteCountingConfig'
        - type: object
          required:
            - maxChoiceNumber
            - minChoiceNumber
            - pointsByRank
          properties:
            maxChoiceNumber:
              type: integer
            minChoiceNumber:
              type: integer
            pointsByRank:
              type: array
              items:
                type: integer
    MinMaxChoicesNumberConfig:
      allOf:
        - $ref: '#/components/schemas/VoteCountingConfig'
        - type: object
          required:
            - maxChoiceNumber
            - minChoiceNumber
          properties:
            maxChoiceNumber:
              type: integer
            minChoiceNumber:
              type: integer
    CumulativeConfig:
      allOf:
        - $ref: '#/components/schemas/VoteCountingConfig'
        - type: object
          required:
            - points
          properties:
            points:
              type: integer
    MajorityJudgmentConfig:
      allOf:
        - $ref: '#/components/schemas/VoteCountingConfig'
        - type: object
          required:
            - grades
          properties:
            grades:
              type: array
              minItems: 1
              items:
                type: string
    EmptyVoteCountingConfig:
      allOf:
        - $ref: '#/components/schemas/VoteCountingConfig'
        - type: object
          properties: {}
    Choice:
      type: object
      required:
        - choiceOrder
        - choiceValue
        - choiceType
      properties:
        id:
          type: string
          format: ChoiceId
        permission:
          type: string
        choiceOrder:
          type: integer
          format: int32
        choiceValue:
          type: string
        choiceType:
          $ref: "#/components/schemas/ChoiceType"
        description:
          type: string
        choiceIsDeletable:
          type: boolean
        report:
          $ref: "#/components/schemas/ReportResume"
    VoterList:
      type: object
      required:
        - id
        - name
        - weight
        - countMembers
        - countSubLists
      properties:
        id:
          type: string
          format: VoterListId
        name:
          type: string
        weight:
          type: number
          format: double
        parentId:
          type: string
          format: VoterListId
        countSubLists:
          type: integer
          format: int64
        countMembers:
          type: integer
          format: int64
        allEmails:
          type: array
          uniqueItems: true
          items:
            type: string
    VoterListMember:
      type: object
      required:
        - id
        - name
        - weight
        - email
        - voterListId
      properties:
        id:
          type: string
          format: VoterListMemberId
        name:
          type: string
        avatar:
          type: string
        email:
          type: string
        weight:
          type: number
          format: double
        voterListId:
          type: string
          format: VoterListId
        invitationSent:
          type: boolean
        voting:
          type: boolean
        invalidEmail:
          type: boolean
    ReportResume:
      type: object
      properties:
        score:
          type: integer
          format: int64
        count:
          type: integer
          format: int64
        ignore:
          type: integer
          format: int64
    ChoiceIdRef:
      type: object
      required:
        - id
        - permission
    ResourceIdRef:
      type: object
      required:
        - id
        - permission
      properties:
        id:
          type: string
          format: VoteId
        permission:
          type: string
    VoteIdRef:
      type: object
      required:
        - id
        - permission
      properties:
        id:
          type: string
          format: VoteId
        permission:
          type: string
    PollIdRef:
      type: object
      required:
        - id
        - permission
      properties:
        id:
          type: string
          format: PollId
        permission:
          type: string
    PollenUserId:
      type: object
      required:
        - id
      properties:
        id:
          type: string
    UserSummary:
      type: object
      required:
        - id
        - name
        - gtuValidated
        - email
      properties:
        id:
          type: string
        name:
          type: string
        avatar:
          type: string
          format: ResourceId
        gtuValidated:
          type: boolean
        email:
          type: string
    User:
      type: object
      required:
        - id
        - name
        - emailAddresses
        - gtuValidated
      properties:
        id:
          type: string
          format: UserId
        name:
          type: string
        avatar:
          type: string
        emailAddresses:
          type: array
          items:
            $ref: '#/components/schemas/UserEmailAddress'
        gtuValidated:
          type: boolean
    NewUser:
      type: object
      required:
        - name
        - defaultEmailAddress
        - password
        - gtuValidated
      properties:
        name:
          type: string
        defaultEmailAddress:
          type: string
        password:
          type: string
        gtuValidated:
          type: boolean
    ChangePassword:
      type: object
      required:
        - oldPassword
        - newPassword
      properties:
        oldPassword:
          type: string
        newPassword:
          type: string
    UserEmailAddress:
      type: object
      required:
        - id
        - emailAddress
        - validated
        - emailAddress
        - emailDefault
      properties:
        id:
          type: string
          format: UserEmailAddressId
        emailAddress:
          type: string
        emailDefault:
          type: boolean
        validated:
          type: boolean
        pgpPublicKey:
          type: string
    NewEmail:
      type: object
      required:
        - email
      properties:
        email:
          type: string
          format: email
    ResendValidationRequest:
      type: object
      required:
        - email
      properties:
        email:
          type: string
          format: email
    UndefinedResponse:
      type: null
    PaginatedComments:
      type: object
      required:
        - elements
        - pagination
      properties:
        elements:
          type: array
          items:
            $ref: "#/components/schemas/Comment"
        pagination:
          $ref: "#/components/schemas/Pagination"
    CommentInputs:
      type: object
      required:
        - authorName
        - text
      properties:
        authorName:
          type: string
        text:
          type: string
    Comment:
      type: object
      allOf:
        - $ref: "#/components/schemas/CommentInputs"
      required:
        - id
        - postDate
      properties:
        id:
          type: string
        permission:
          type: string
        authorAvatar:
          type: string
        postDate:
          type: string
          format: date-time
    CommentRef:
      type: object
      required:
        - id
      properties:
        id:
          type: string
        permission:
          type: string
    ApiError:
      type: object
      description: Error
      properties:
        name:
          type: string
          description: unique name of the error.
        correlation_id:
          type: string
          description: Internal identifier used for correlation purposes
        arguments:
          type: array
          description: The argument of the reason for the error.
          items:
            type: string
        details:
          description: Additional details for the error.
          type: array
          items:
            $ref: "#/components/schemas/ApiErrorDetail"
      required:
        - name
        - correlation_id
    ApiErrorDetail:
      type: object
      description: Additional details for the error.
      properties:
        value:
          type: string
          description: The value of the field that caused the error
        location:
          type: string
          description: The location of the field that caused the error.
        issue:
          type: string
          description: The reason for the error
        arguments:
          description: The argument of the reason for the error.
          type: array
          items:
            type: string
      required:
        - issue
    PaginatedVotes:
      type: object
      required:
        - elements
        - pagination
      properties:
        elements:
          type: array
          items:
            $ref: "#/components/schemas/Vote"
        pagination:
          $ref: "#/components/schemas/Pagination"
    PaginatedFavoriteLists:
      type: object
      required:
        - elements
        - pagination
      properties:
        elements:
          type: array
          items:
            $ref: "#/components/schemas/FavoriteList"
        pagination:
          $ref: "#/components/schemas/Pagination"
    PaginationResultChildFavoriteList:
      type: object
      required:
        - elements
        - pagination
      properties:
        elements:
          type: array
          items:
            $ref: "#/components/schemas/ChildFavoriteList"
        pagination:
          $ref: "#/components/schemas/Pagination"
    PaginationResultFavoriteListMember:
      type: object
      required:
        - elements
        - pagination
      properties:
        elements:
          type: array
          items:
            $ref: "#/components/schemas/FavoriteListMember"
        pagination:
          $ref: "#/components/schemas/Pagination"
    NewVote:
      required:
        - choice
        - voterName
      type: object
      properties:
        choice:
          type: array
          uniqueItems: true
          items:
            $ref: "#/components/schemas/VoteToChoice"
        voterName:
          type: string
    Vote:
      allOf:
        - $ref: "#/components/schemas/NewVote"
      type: object
      required:
        - id
        - voterId
        - anonymous
        - ignored
      properties:
        id:
          type: string
          format: VoteId
        voterId:
          type: string
          format: PollenPrincipalId
        voterListMemberIds:
          type: array
          uniqueItems: true
          items:
            type: string
            format: VoterListMemberId
        voterAvatar:
          type: string
        permission:
          type: string
        anonymous:
          type: boolean
        weight:
          type: number
          format: double
        report:
          $ref: "#/components/schemas/ReportResume"
        ignored:
          type: boolean
    VoteToChoice:
      type: object
      required:
        - choiceId
        - voteValue
      properties:
        id:
          type: string
          format: VoteToChoiceId
        choiceId:
          type: string
          format: ChoiceId
        voteValue:
          type: number
    ChoiceScore:
      type: object
      required:
        - choiceId
        - scoreOrder
        - scoreValue
      properties:
        choiceId:
          type: string
          format: ChoiceId
        scoreValue:
          type: number
        scoreOrder:
          type: integer
          format: int32
    Battle:
      type: object
      required:
        - opponentId
        - runnerId
        - score
      properties:
        opponentId:
          type: string
        runnerId:
          type: string
        score:
          type: number
    Rank:
      type: object
      required:
        - choiceId
        - rank
        - score
      properties:
        choiceId:
          type: string
          format: ChoiceId
        rank:
          type: integer
        score:
          type: number
    RoundResult:
      type: object
      required:
        - choiceId
      properties:
        choiceId:
          type: string
          format: ChoiceId
        score:
          type: number
        firstScore:
          type: number
        lastScore:
          type: number
    BattleRound:
      type: object
      required:
        - roundChoices
        - choiceIdsExclude
      properties:
        roundChoices:
          type: array
          items:
            $ref: '#/components/schemas/RoundResult'
        choiceIdsExclude:
          type: array
          items:
            type: string
    ChoiceResultsDetails:
      required:
        - choiceId
        - voteByGrad
        - median
      type: object
      properties:
        choiceId:
          type: string
          format: ChoiceId
        voteByGrad:
          type: array
          items:
            type: integer
        median:
          type: number
    VoteCountingDetailResult:
      type: object
      required:
        - type
      discriminator:
        propertyName: type
        mapping:
          CONDORCET: '#/components/schemas/CondorcetDetailResult'
          BORDA: '#/components/schemas/BordaDetailResult'
          COOMBS: '#/components/schemas/CoombsDetailResult'
          INSTANT_RUNOFF: '#/components/schemas/InstantRunoffDetailResult'
          MAJORITY_JUDGMENT: '#/components/schemas/MajorityJudgmentDetailResult'
      properties:
        type:
          type: string
          enum:
            - CONDORCET
            - BORDA
            - COOMBS
            - INSTANT_RUNOFF
            - MAJORITY_JUDGMENT
    CondorcetDetailResult:
      allOf:
        - $ref: '#/components/schemas/VoteCountingDetailResult'
        - type: object
        - required:
            - battles
          properties:
            battles:
              type: array
              items:
                $ref: '#/components/schemas/Battle'
    BordaDetailResult:
      allOf:
        - $ref: '#/components/schemas/VoteCountingDetailResult'
        - type: object
        - required:
          - choiceRanks
          properties:
            choiceRanks:
              type: array
              items:
                $ref: '#/components/schemas/Rank'
    CoombsDetailResult:
      allOf:
        - $ref: '#/components/schemas/VoteCountingDetailResult'
        - type: object
        - required:
            - rounds
          properties:
            rounds:
              type: array
              items:
                $ref: '#/components/schemas/BattleRound'
    InstantRunoffDetailResult:
      allOf:
        - $ref: '#/components/schemas/VoteCountingDetailResult'
        - type: object
        - required:
          - rounds
          properties:
            rounds:
              type: array
              items:
                $ref: '#/components/schemas/BattleRound'
    MajorityJudgmentDetailResult:
      allOf:
        - $ref: '#/components/schemas/VoteCountingDetailResult'
        - type: object
        - required:
            - sumWeight
            - halfWeight
            - choiceResults
          properties:
            sumWeight:
              type: number
            halfWeight:
              type: number
            choiceResults:
              type: array
              items:
                $ref: '#/components/schemas/ChoiceResultsDetails'
    VoteCountingResult:
      type: object
      required:
        - scores
        - nbVotants
      properties:
        scores:
          type: array
          items:
            $ref: "#/components/schemas/ChoiceScore"
        detail:
          $ref: "#/components/schemas/VoteCountingDetailResult"
        nbVotants:
          type: integer
          format: int32
    FavoriteList:
      type: object
      required:
        - id
        - name
      properties:
        id:
          type: string
          format: FavoriteListId
        name:
          type: string
        countChildren:
          type: integer
          format: int64
        countMembers:
          type: integer
          format: int64
    NewFavoriteList:
      type: object
      required:
        - name
      properties:
        name:
          type: string
    ChildFavoriteList:
      type: object
      required:
        - id
        - child
        - weight
      properties:
        id:
          type: string
          format: ChildFavoriteListId
        child:
          $ref: "#/components/schemas/FavoriteList"
        weight:
          type: number
          format: double
    NewChildFavoriteList:
      type: object
      required:
        - child
        - weight
      properties:
        child:
          $ref: "#/components/schemas/FavoriteList"
        weight:
          type: number
          format: double
    FavoriteListMember:
      type: object
      required:
        - id
        - name
        - email
        - weight
      properties:
        id:
          type: string
          format: FavoriteListMemberId
        name:
          type: string
        email:
          type: string
        weight:
          type: number
          format: double
    NewFavoriteListMember:
      type: object
      required:
        - name
        - email
        - weight
      properties:
        name:
          type: string
        email:
          type: string
        weight:
          type: number
          format: double
    ResourceUpload:
      type: object
      required:
        - resource
        - fileName
        - resourceType
      properties:
        resource:
          type: string
          format: binary
        fileName:
          type: string
        contentType:
          type: string
        resourceType:
          $ref: "#/components/schemas/ResourceType"
    ResourceType:
      type: string
      enum:
        - CHOICE
        - SCREENSHOT
        - GTU
        - AVATAR
        - HEADER
    Resource64:
      type: object
      required:
        - data
        - name
        - contentType
        - resourceType
      properties:
        data:
          type: string
        name:
          type: string
        contentType:
          type: string
        resourceType:
          $ref: "#/components/schemas/ResourceType"
    CategoryFeeback:
      type: string
      enum:
        - BUG
        - ERGO
        - AUTRE
    Dimension:
      required:
        - width
        - height
      type: object
      properties:
        width:
          type: integer
          format: int32
        height:
          type: integer
          format: int32
    Locale:
      required:
        - language
      type: object
      properties:
        language:
          type: string
        country:
          type: string
    Feedback:
      required:
        - category
        - screenResolution
        - windowDimension
        - operatingSystem
        - location
        - browser
      type: object
      properties:
        description:
          type: string
        category:
          $ref: "#/components/schemas/CategoryFeeback"
        browser:
          type: string
        operatingSystem:
          type: string
        platform:
          type: string
        screenResolution:
          $ref: "#/components/schemas/Dimension"
        windowDimension:
          $ref: "#/components/schemas/Dimension"
        locale:
          $ref: "#/components/schemas/Locale"
        location:
          type: string
        locationTitle:
          type: string
        screenShotId:
          type: string
          format: ResourceId
        consoleHistory:
          type: string
        userEmail:
          type: string
    ImportMode:
      type: string
      enum:
        - CANCEL_ALL
        - SKIP_MEMBER
        - UPDATE_WEIGHT_AND_NAME
        - UPDATE_WEIGHT
        - UPDATE_NAME
    CsvImport:
      type: object
      required:
        - file
        - importMode
      properties:
        file:
          type: string
          format: binary
        importMode:
          $ref: '#/components/schemas/ImportMode'
    LdapImport:
      type: object
      required:
        - urlLdap
        - importMode
      properties:
        urlLdap:
          type: string
        importMode:
          $ref: "#/components/schemas/ImportMode"
