openapi: 3.0.0
info:
  version: 3.3.0
  title: Gitee Team Classes
  description: |
    Gitee Team Classes API

    # Introduction
    This Api is base on Parse Class Api

    # Headers
    The following parameters in headers are required for all api
    - Content-Type  (must be 'text/plain')
    - Accept-Language  (e.g. zh-CN,en-US)
components:
  schemas:
    ContentType:
      name: Content-Type
      in: header
      description: Content Type(must be 'text/plain')
      required: true
      schema:
        type: string
    AcceptLanguage:
      name: Accept-Language
      in: header
      description: Accept Language(e.g. zh-CN,en-US)
      required: true
      schema:
        type: string
    UpdateId:
      name: UpdateId
      in: path
      description: The objectId to update
      required: true
      schema:
        type: string
    DeleteId:
      name: DeleteId
      in: path
      description: The objectId to delete
      required: true
      schema:
        type: string
  _ApplicationId:
    type: string
    description: ApplicationId(e.g. osc)
    example: osc
  _SessionToken:
    type: string
    description: User token
  QueryMethod:
    type: string
    enum:
      - GET
    description: must be "Get"
    example: GET
  UpdateMethod:
    type: string
    enum:
      - PUT
    description: must be "PUT"
  DeleteMethod:
    type: string
    enum:
      - DELETE
    description: must be "DELETE"
  Count:
    type: number
    description: Counts the number of objects that match this query.
  TimeString:
    type: string
    example: '2023-02-08T08:24:11.137Z'
  User:
    type: object
    properties:
      __type:
        type: string
        example: Pointer
      className:
        type: string
        example: _User
      objectId:
        type: string
        example: jasPZZVVEQ
  Skip:
    type: number
    description: >-
      Sets the number of results to skip before returning any results. This is
      useful for pagination. Default is to skip zero results.
  Limit:
    type: number
    description: >-
      Sets the limit of the number of results to return. The default limit is
      100.
  Include:
    oneOf:
      - type: string
      - type: string[]
    description: >-
      Includes nested objects for the provided key.You can use dot notation to
      specify which fields in the included object are also fetched.
  Order:
    oneOf:
      - type: string
      - type: string[]
    description: >
      Sorts the results in order by the given key, but can also add secondary
      sort descriptors without overwriting _order.


      e.g. `"+createAt"`  `"-updateAt"`
  Keys:
    oneOf:
      - type: string
      - type: string[]
    description: >
      Restricts the fields of the returned objects to include only the provided
      keys.
  ExcludeKeys:
    oneOf:
      - type: string
      - type: string[]
    description: >
      Restricts the fields of the returned objects to all keys except the
      provided keys. `excludeKeys` takes precedence over `keys` and `include`.
  Condition:
    type: object
    properties:
      $regex:
        type: string
        description: matches
      $inQuery:
        type: object
        description: matchesQuery
        properties:
          className:
            type: string
          where:
            $ref: '#/components/Condition'
      $ne:
        type: string | boolean
        description: notEqualTo
      $lt:
        type: number
        description: lessThan
      $gt:
        type: number
        description: greaterThan
      $lte:
        type: number
        description: lessThanOrEqualTo
      $gte:
        type: number
        description: greaterThanOrEqualTo
      $in:
        type: string[]
        description: containedIn
      $nin:
        type: string[]
        description: notContainedIn
tags:
  - name: ItemType
    description: Item Type Api
paths:
  /parse/classes/:queryItemType:
    post:
      tags:
        - ItemType
      summary: Query ItemType
      parameters:
        - $ref: '#/components/schemas/ContentType'
        - $ref: '#/components/schemas/AcceptLanguage'
        - name: queryItemType
          in: path
          description: Must be "ItemType"
          required: true
          schema:
            type: string
      requestBody:
        content:
          text/plain:
            schema:
              type: object
              required:
                - _ApplicationId
                - _SessionToken
                - _method
              properties:
                _ApplicationId:
                  $ref: '#/components/_ApplicationId'
                _SessionToken:
                  $ref: '#/components/_SessionToken'
                _method:
                  $ref: '#/components/QueryMethod'
                skip:
                  $ref: '#/components/Skip'
                limit:
                  $ref: '#/components/Limit'
                include:
                  $ref: '#/components/Include'
                order:
                  $ref: '#/components/Order'
                keys:
                  $ref: '#/components/Keys'
                excludeKeys:
                  $ref: '#/components/ExcludeKeys'
                where:
                  description: Query condition
                  type: object
                  properties:
                    objectId:
                      oneOf:
                        - type: string
                        - $ref: '#/components/Condition'
                    name:
                      oneOf:
                        - type: string
                        - $ref: '#/components/Condition'
                    key:
                      oneOf:
                        - type: string
                        - $ref: '#/components/Condition'
      responses:
        '200':
          description: Return query results
          content:
            application/json:
              schema:
                type: object
                properties:
                  count:
                    $ref: '#/components/Count'
                  results:
                    type: array
                    items:
                      type: object
                      properties:
                        objectId:
                          type: string
                          example: fZRM3fnHyb
                        name:
                          type: string
                          example: Story
                        key:
                          type: string
                          example: story
                        icon:
                          type: string
                          example: /icons/Issue_Risk.svg
                        createdAt:
                          $ref: '#/components/TimeString'
                        createdBy:
                          $ref: '#/components/User'
      x-codeSamples:
        - lang: js
          source: |
            const data = await axios({
              url: '/parse/classes/ItemType',
              method: 'POST',
              data:{
                _ApplicationId: 'osc',
                _SessionToken: '',
                _method: 'GET',
                where: {
                  objectId: {
                    $in: ['UWHEDRRz7j', 'jasPZZVVEQ'],
                  },
                  key: {
                    $regex: '\\Q\\E'
                  },
                  name: 'Story'
                },
                limit: 10,
                order: '-createAt'
              },
              headers: {
                "Content-Type": "text/plain",
                "Accept-Language": "zh-CN",
              }
            })
  /parse/classes/ItemType:
    post:
      tags:
        - ItemType
      summary: Create ItemType
      parameters:
        - $ref: '#/components/schemas/ContentType'
        - $ref: '#/components/schemas/AcceptLanguage'
      requestBody:
        content:
          text/plain:
            schema:
              type: object
              required:
                - _ApplicationId
                - _SessionToken
              properties:
                _ApplicationId:
                  $ref: '#/components/_ApplicationId'
                _SessionToken:
                  $ref: '#/components/_SessionToken'
      responses:
        '200':
          description: Return created object
          content:
            application/json:
              schema:
                type: object
                properties:
                  objectId:
                    type: string
                    example: fZRM3fnHyb
                  createAt:
                    $ref: '#/components/TimeString'
                  createdBy:
                    $ref: '#/components/User'
      x-codeSamples:
        - lang: js
          source: |
            const data = await axios({
              url: '/parse/classes/ItemType',
              method: 'POST',
              data:{
                _ApplicationId: 'osc',
                _SessionToken: '',
                name: 'Story',
                key: 'story',
                icon: '/icons/Issue_Plan.svg',
              },
              headers: {
                "Content-Type": "text/plain",
                "Accept-Language": "zh-CN",
              }
            })
  /parse/classes/ItemType/:updateId:
    post:
      tags:
        - ItemType
      summary: Update ItemType
      parameters:
        - $ref: '#/components/schemas/ContentType'
        - $ref: '#/components/schemas/AcceptLanguage'
        - $ref: '#/components/schemas/UpdateId'
      requestBody:
        content:
          text/plain:
            schema:
              type: object
              required:
                - _ApplicationId
                - _SessionToken
                - _method
              properties:
                _ApplicationId:
                  $ref: '#/components/_ApplicationId'
                _SessionToken:
                  $ref: '#/components/_SessionToken'
                _method:
                  $ref: '#/components/UpdateMethod'
      responses:
        '200':
          description: Returns an object
          content:
            application/json:
              schema:
                type: object
                properties:
                  updatedAt:
                    $ref: '#/components/TimeString'
                  createdBy:
                    $ref: '#/components/User'
                  updatedBy:
                    $ref: '#/components/User'
      x-codeSamples:
        - lang: js
          source: |
            const itemTypeId = 'uAKYZbdYP4';
            const data = await axios({
              url: `/parse/classes/ItemType/${itemTypeId}`,
              method: 'POST',
              data:{
                _ApplicationId: 'osc',
                _SessionToken: '',
                _method: 'PUT',
                name: 'Story',
                key: 'story',
                icon: '/icons/Issue_Plan.svg',
              },
              headers: {
                "Content-Type": "text/plain",
                "Accept-Language": "zh-CN",
              }
            })
  /parse/classes/ItemType/:deleteId:
    post:
      tags:
        - ItemType
      summary: Delete ItemType
      parameters:
        - $ref: '#/components/schemas/ContentType'
        - $ref: '#/components/schemas/AcceptLanguage'
        - $ref: '#/components/schemas/DeleteId'
      requestBody:
        content:
          text/plain:
            schema:
              type: object
              required:
                - _ApplicationId
                - _SessionToken
                - _method
              properties:
                _ApplicationId:
                  $ref: '#/components/_ApplicationId'
                _SessionToken:
                  $ref: '#/components/_SessionToken'
                _method:
                  $ref: '#/components/DeleteMethod'
      responses:
        '200':
          description: Return empty object
          content:
            application/json:
              schema:
                type: object
      x-codeSamples:
        - lang: js
          source: |
            const itemTypeId = 'uAKYZbdYP4';
            await axios({
              url: `/parse/classes/ItemType/${itemTypeId}`,
              method: 'POST',
              data:{
                _ApplicationId: 'osc',
                _SessionToken: '',
                _method: 'DELETE',
              },
              headers: {
                "Content-Type": "text/plain",
                "Accept-Language": "zh-CN",
              }
            })
