{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "#/components/schemas/scaleway.containers.v1.Trigger",
  "title": "scaleway.containers.v1.Trigger",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Trigger unique ID. (UUID format)",
      "example": "6170692e-7363-616c-6577-61792e636f6d"
    },
    "name": {
      "type": "string",
      "description": "Name of the trigger."
    },
    "description": {
      "type": "string",
      "description": "Description of the trigger."
    },
    "tags": {
      "type": "array",
      "description": "Tags of the trigger.",
      "items": {
        "type": "string"
      }
    },
    "status": {
      "type": "string",
      "description": "Trigger status.",
      "enum": [
        "unknown_status",
        "ready",
        "deleting",
        "error",
        "updating",
        "creating",
        "locking",
        "locked",
        "upgrading"
      ],
      "x-enum-descriptions": {
        "values": {
          "unknown_status": "Unknown status",
          "ready": "Ready status",
          "deleting": "Deleting status",
          "error": "Error status",
          "updating": "Updating status. Resource is being redeployed to match the desired configuration",
          "creating": "Creating status. Resource is being created",
          "locking": "Locking status",
          "locked": "Locked status. Resource cannot be modified",
          "upgrading": "Upgrading status. Resource is being upgraded as part of a planned maintenance. No downtime is expected"
        }
      },
      "default": "unknown_status"
    },
    "error_message": {
      "type": "string",
      "description": "Trigger last error message."
    },
    "container_id": {
      "type": "string",
      "description": "ID of the container to trigger. (UUID format)",
      "example": "6170692e-7363-616c-6577-61792e636f6d"
    },
    "destination_config": {
      "type": "object",
      "description": "Configuration of the destination to trigger.",
      "properties": {
        "http_path": {
          "type": "string",
          "description": "The HTTP path to send the request to (e.g., \"/my-webhook-endpoint\")."
        },
        "http_method": {
          "type": "string",
          "description": "The HTTP method to use when sending the request (e.g., get, post, put, patch, delete). Must be specified as lowercase.",
          "enum": [
            "unknown_http_method",
            "get",
            "post",
            "put",
            "patch",
            "delete"
          ],
          "default": "unknown_http_method"
        }
      },
      "x-properties-order": [
        "http_path",
        "http_method"
      ]
    },
    "source_type": {
      "type": "string",
      "description": "Type of source that will trigger the container.",
      "enum": [
        "unknown_source_type",
        "cron",
        "sqs",
        "nats"
      ],
      "x-enum-descriptions": {
        "values": {
          "unknown_source_type": "Unknown source type",
          "cron": "Cron source type",
          "sqs": "SQS source type",
          "nats": "NATS source type"
        }
      },
      "default": "unknown_source_type"
    },
    "cron_config": {
      "type": "object",
      "description": "Configuration for a cron source.",
      "properties": {
        "schedule": {
          "type": "string",
          "description": "UNIX cron schedule to run job (e.g., \"* * * * *\")."
        },
        "timezone": {
          "type": "string",
          "description": "Timezone for the cron schedule, in tz database format (e.g., \"Europe/Paris\")."
        },
        "body": {
          "type": "string",
          "description": "Body to send to the container when the trigger is invoked."
        },
        "headers": {
          "type": "object",
          "description": "Additional headers to send to the container when the trigger is invoked.",
          "properties": {
            "<headerKey>": {
              "type": "string",
              "description": "Additional headers to send to the container when the trigger is invoked."
            }
          },
          "additionalProperties": true
        }
      },
      "nullable": true,
      "x-properties-order": [
        "schedule",
        "timezone",
        "body",
        "headers"
      ],
      "x-one-of": "source_config"
    },
    "sqs_config": {
      "type": "object",
      "description": "Configuration for an SQS queue source.",
      "properties": {
        "region": {
          "type": "string",
          "description": "The region where the SQS queue is hosted (e.g., \"fr-par\", \"nl-ams\")."
        },
        "endpoint": {
          "type": "string",
          "description": "Endpoint URL to use to access SQS (e.g., \"https://sqs.mnq.fr-par.scaleway.com\")."
        },
        "access_key_id": {
          "type": "string",
          "description": "The access key for accessing the SQS queue."
        },
        "queue_url": {
          "type": "string",
          "description": "The URL of the SQS queue to monitor for messages."
        }
      },
      "nullable": true,
      "x-properties-order": [
        "region",
        "endpoint",
        "access_key_id",
        "queue_url"
      ],
      "x-one-of": "source_config"
    },
    "nats_config": {
      "type": "object",
      "description": "Configuration for a NATS source.",
      "properties": {
        "server_urls": {
          "type": "array",
          "description": "The URLs of the NATS servers (e.g., \"nats://nats.mnq.fr-par.scaleway.com:4222\").",
          "items": {
            "type": "string"
          }
        },
        "subject": {
          "type": "string",
          "description": "NATS subject to subscribe to (e.g., \"my-subject\")."
        }
      },
      "nullable": true,
      "x-properties-order": [
        "server_urls",
        "subject"
      ],
      "x-one-of": "source_config"
    },
    "created_at": {
      "type": "string",
      "description": "Trigger creation date. (RFC 3339 format)",
      "format": "date-time",
      "example": "2022-03-22T12:34:56.123456Z",
      "nullable": true
    },
    "updated_at": {
      "type": "string",
      "description": "Trigger last update date. (RFC 3339 format)",
      "format": "date-time",
      "example": "2022-03-22T12:34:56.123456Z",
      "nullable": true
    }
  },
  "x-properties-order": [
    "id",
    "name",
    "description",
    "tags",
    "status",
    "error_message",
    "container_id",
    "destination_config",
    "source_type",
    "cron_config",
    "sqs_config",
    "nats_config",
    "created_at",
    "updated_at"
  ]
}