Skip to content

AlterTransaction

Description

      description: |
        Alter a transaction with a list of actions such as setting status or properties.
        The server should either succeed and apply all actions, or fail and apply no action.

Request Schema

    AlterTransactionRequest:
      type: object
      description: |
        Alter a transaction with a list of actions.
        The server should either succeed and apply all actions, or fail and apply no action.
      required:
        - actions
      properties:
        id:
          type: array
          items:
            type: string
        actions:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/AlterTransactionAction'
Supporting action schemas:

Set Status Action:

      type: object
      required:
        - status
      properties:
        status:
          $ref: '#/components/schemas/TransactionStatus'
Set Property Action:
        properties:
          type: object
          additionalProperties:
            type: string

    AlterTransactionSetStatus:
      type: object
      properties:
        status:
          $ref: '#/components/schemas/TransactionStatus'
Unset Property Action:
      type: string
      description: |
        The behavior if the property key already exists.
        - OVERWRITE (default): overwrite the existing value with the provided value
        - FAIL: fail the entire operation
        - SKIP: keep the existing value and skip setting the provided value
      enum:
        - OVERWRITE

Response Schema

    AlterTransactionResponse:
      type: object
      required:
        - status
      properties:
        status:
          $ref: '#/components/schemas/TransactionStatus'
        properties:
          type: object
          additionalProperties:
            type: string

Set Status Action

    AlterTransactionSetStatus:
      type: object
      properties:
        status:
          $ref: '#/components/schemas/TransactionStatus'

Set Property Action

    AlterTransactionSetProperty:
      type: object
      properties:
        key:
          type: string
        value:
          type: string
        mode:
          $ref: '#/components/schemas/SetPropertyMode'

Unset Property Action

    AlterTransactionUnsetProperty:
      type: object
      properties:
        key:
          type: string
        mode:
          $ref: '#/components/schemas/UnsetPropertyMode'