windmill-api 1.684.0

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
Documentation
/*
 * Windmill API
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.684.0
 * Contact: contact@windmill.dev
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct SqsTrigger {
    /// The full URL of the AWS SQS queue to poll for messages
    #[serde(rename = "queue_url")]
    pub queue_url: String,
    #[serde(rename = "aws_auth_resource_type")]
    pub aws_auth_resource_type: models::AwsAuthResourceType,
    /// Path to the AWS resource containing credentials or OIDC configuration
    #[serde(rename = "aws_resource_path")]
    pub aws_resource_path: String,
    /// Array of SQS message attribute names to include with each message
    #[serde(rename = "message_attributes", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub message_attributes: Option<Option<Vec<String>>>,
    /// ID of the server currently handling this trigger (internal)
    #[serde(rename = "server_id", skip_serializing_if = "Option::is_none")]
    pub server_id: Option<String>,
    /// Timestamp of last server heartbeat (internal)
    #[serde(rename = "last_server_ping", skip_serializing_if = "Option::is_none")]
    pub last_server_ping: Option<String>,
    /// Last error message if the trigger failed
    #[serde(rename = "error", skip_serializing_if = "Option::is_none")]
    pub error: Option<String>,
    /// Path to a script or flow to run when the triggered job fails
    #[serde(rename = "error_handler_path", skip_serializing_if = "Option::is_none")]
    pub error_handler_path: Option<String>,
    /// The arguments to pass to the script or flow
    #[serde(rename = "error_handler_args", skip_serializing_if = "Option::is_none")]
    pub error_handler_args: Option<std::collections::HashMap<String, serde_json::Value>>,
    #[serde(rename = "retry", skip_serializing_if = "Option::is_none")]
    pub retry: Option<Box<models::Retry>>,
    /// The unique path identifier for this trigger
    #[serde(rename = "path")]
    pub path: String,
    /// Path to the script or flow to execute when triggered
    #[serde(rename = "script_path")]
    pub script_path: String,
    /// The user or group this trigger runs as (permissioned_as)
    #[serde(rename = "permissioned_as")]
    pub permissioned_as: String,
    /// Additional permissions for this trigger
    #[serde(rename = "extra_perms")]
    pub extra_perms: std::collections::HashMap<String, bool>,
    /// The workspace this trigger belongs to
    #[serde(rename = "workspace_id")]
    pub workspace_id: String,
    /// Username of the last person who edited this trigger
    #[serde(rename = "edited_by")]
    pub edited_by: String,
    /// Timestamp of the last edit
    #[serde(rename = "edited_at")]
    pub edited_at: String,
    /// True if script_path points to a flow, false if it points to a script
    #[serde(rename = "is_flow")]
    pub is_flow: bool,
    #[serde(rename = "mode")]
    pub mode: models::TriggerMode,
    #[serde(rename = "labels", skip_serializing_if = "Option::is_none")]
    pub labels: Option<Vec<String>>,
}

impl SqsTrigger {
    pub fn new(queue_url: String, aws_auth_resource_type: models::AwsAuthResourceType, aws_resource_path: String, path: String, script_path: String, permissioned_as: String, extra_perms: std::collections::HashMap<String, bool>, workspace_id: String, edited_by: String, edited_at: String, is_flow: bool, mode: models::TriggerMode) -> SqsTrigger {
        SqsTrigger {
            queue_url,
            aws_auth_resource_type,
            aws_resource_path,
            message_attributes: None,
            server_id: None,
            last_server_ping: None,
            error: None,
            error_handler_path: None,
            error_handler_args: None,
            retry: None,
            path,
            script_path,
            permissioned_as,
            extra_perms,
            workspace_id,
            edited_by,
            edited_at,
            is_flow,
            mode,
            labels: None,
        }
    }
}