{
  "info": {
    "version": "2026-2",
    "contact": {},
    "description": "Service providing fueling functionalities",
    "title": "Fueling Service"
  },
  "openapi": "3.0.0",
  "servers": [
    {
      "description": "PACE Fueling Service",
      "url": "https://api.pace.cloud/fueling"
    }
  ],
  "paths": {
    "/2026-2/pollings/{pollingId}/pump-status": {
      "get": {
        "description": "Returns the current pump status immediately, or long-polls until the status changes if a known status is provided.",
        "operationId": "PollPumpStatus",
        "parameters": [
          {
            "description": "The unique identifier of the polling task.",
            "in": "path",
            "name": "pollingId",
            "required": true,
            "schema": {
              "example": "652a50ff-e3ae-4aae-b0f1-ba92c40f780f",
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "If set, waits for status to change. Otherwise returns current status.",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "enum": [
                "LOCKED",
                "FREE",
                "IN_USE",
                "READY_TO_PAY",
                "OUT_OF_ORDER"
              ],
              "example": "IN_USE",
              "nullable": false,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PollPumpStatusResponseDTO"
                }
              }
            },
            "description": "The current status of the pump."
          },
          "400": {
            "description": "The request parameters are invalid or missing"
          },
          "401": {
            "description": "Client authentication failed."
          },
          "403": {
            "description": "Missing one or more required scopes."
          },
          "404": {
            "description": "The polling task was not found"
          }
        },
        "security": [
          {
            "oauth2": [
              "fueling:pollings:read:one"
            ]
          },
          {
            "oauth2": [
              "fueling:pollings:read:authenticated"
            ]
          }
        ],
        "summary": "Poll or retrieve pump status",
        "tags": [
          "Polling"
        ],
        "x-beta": true
      }
    }
  },
  "tags": [
    {
      "name": "Polling",
      "description": "Endpoints for polling fueling details."
    }
  ],
  "components": {
    "securitySchemes": {
      "oauth2": {
        "type": "oauth2",
        "flows": {
          "authorizationCode": {
            "scopes": {
              "fueling:pollings:read:authenticated": "Allows polling fueling details for the authenticated user.",
              "fueling:pollings:read:one": "Allows polling fueling details."
            },
            "authorizationUrl": "https://id.pace.cloud/auth/realms/pace/protocol/openid-connect/auth",
            "refreshUrl": "https://id.pace.cloud/auth/realms/pace/protocol/openid-connect/token",
            "tokenUrl": "https://id.pace.cloud/auth/realms/pace/protocol/openid-connect/token"
          }
        }
      }
    },
    "schemas": {
      "PollPumpStatusResponseDTO": {
        "properties": {
          "data": {
            "additionalProperties": false,
            "allOf": [
              {
                "$ref": "#/components/schemas/PumpStatusDTO"
              }
            ],
            "description": "The current status of the pump.",
            "nullable": false
          }
        },
        "required": [
          "data"
        ],
        "type": "object"
      },
      "PumpStatusDTO": {
        "properties": {
          "id": {
            "description": "The unique identifier of the pump.",
            "example": "1ac5082e-b610-45dc-b754-3f53f004b912",
            "format": "uuid",
            "nullable": false,
            "type": "string"
          },
          "label": {
            "description": "The label of the pump",
            "example": "1",
            "nullable": false,
            "type": "string"
          },
          "status": {
            "description": "The current status of the pump.",
            "enum": [
              "LOCKED",
              "FREE",
              "IN_USE",
              "READY_TO_PAY",
              "OUT_OF_ORDER"
            ],
            "example": "IN_USE",
            "nullable": false,
            "type": "string"
          }
        },
        "required": [
          "id",
          "label",
          "status"
        ],
        "type": "object"
      }
    }
  }
}