// Code generated by oagen. DO NOT EDIT.

#[allow(unused_imports)]
use super::*;
#[allow(unused_imports)]
use crate::enums::*;
use serde::{Deserialize, Serialize};
/// Create a new edge connecting two blocks in a workflow.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct WorkflowEdgeCreateRequest {
    /// Workflow to create the edge in.
    pub workflow_id: String,
    /// Edge ID. Omit to let the server generate one (recommended).
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub id: Option<String>,
    /// Source block ID
    pub source_block: String,
    /// Target block ID
    pub target_block: String,
    /// Output handle
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub source_handle: Option<String>,
    /// Input handle
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub target_handle: Option<String>,
}
impl WorkflowEdgeCreateRequest {
    /// Construct a new `WorkflowEdgeCreateRequest` with the required fields set.
    #[allow(deprecated)]
    pub fn new(
        workflow_id: impl Into<String>,
        source_block: impl Into<String>,
        target_block: impl Into<String>,
    ) -> Self {
        Self {
            workflow_id: workflow_id.into(),
            id: Default::default(),
            source_block: source_block.into(),
            target_block: target_block.into(),
            source_handle: Default::default(),
            target_handle: Default::default(),
        }
    }
}
