hatchet-sdk 0.2.8

This is an unofficial Rust SDK for Hatchet, a distributed, fault-tolerant task queue.
Documentation
/*
 * Hatchet API
 *
 * The Hatchet API
 *
 * The version of the OpenAPI document: 1.0.0
 *
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct EventCreateRequest {
    /// The key for the event.
    #[serde(rename = "key")]
    pub key: String,
    /// The data for the event.
    #[serde(rename = "data")]
    pub data: serde_json::Value,
    /// Additional metadata for the event.
    #[serde(rename = "additionalMetadata", skip_serializing_if = "Option::is_none")]
    pub additional_metadata: Option<serde_json::Value>,
    /// The priority of the event.
    #[serde(rename = "priority", skip_serializing_if = "Option::is_none")]
    pub priority: Option<i32>,
    /// The scope for event filtering.
    #[serde(rename = "scope", skip_serializing_if = "Option::is_none")]
    pub scope: Option<String>,
}

impl EventCreateRequest {
    pub fn new(key: String, data: serde_json::Value) -> EventCreateRequest {
        EventCreateRequest {
            key,
            data,
            additional_metadata: None,
            priority: None,
            scope: None,
        }
    }
}