nautobot-openapi 0.1.1

low level nautobot bindings (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
Documentation
/*
 * API Documentation
 *
 * Source of truth and network automation platform
 *
 * The version of the OpenAPI document: 2.4.20 (2.4)
 *
 * Generated by: https://openapi-generator.tech
 */

/// ScheduledJob : This base serializer implements common fields and logic for all ModelSerializers.  Namely, it:  - defines the `display` field which exposes a human friendly value for the given object. - ensures that `id` field is always present on the serializer as well. - ensures that `created` and `last_updated` fields are always present if applicable to this model and serializer. - ensures that `object_type` field is always present on the serializer which represents the content-type of this   serializer's associated model (e.g. \"dcim.device\"). This is required as the OpenAPI schema, using the   PolymorphicProxySerializer class defined below, relies upon this field as a way to identify to the client   which of several possible serializers are in use for a given attribute. - supports `?depth` query parameter. It is passed in as `nested_depth` to the `build_nested_field()` function   to enable the dynamic generation of nested serializers.

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct ScheduledJob {
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<uuid::Uuid>,
    #[serde(rename = "object_type", skip_serializing_if = "Option::is_none")]
    pub object_type: Option<String>,
    /// Human friendly display value
    #[serde(rename = "display", skip_serializing_if = "Option::is_none")]
    pub display: Option<String>,
    #[serde(rename = "url", skip_serializing_if = "Option::is_none")]
    pub url: Option<String>,
    #[serde(rename = "natural_slug", skip_serializing_if = "Option::is_none")]
    pub natural_slug: Option<String>,
    #[serde(rename = "queue", skip_serializing_if = "Option::is_none")]
    pub queue: Option<String>,
    #[serde(rename = "time_zone", skip_serializing_if = "Option::is_none")]
    pub time_zone: Option<String>,
    /// Human-readable description of this scheduled task
    #[serde(rename = "name")]
    pub name: String,
    /// The name of the Celery task that should be run. (Example: \"proj.tasks.import_contacts\")
    #[serde(rename = "task")]
    pub task: String,
    #[serde(rename = "interval")]
    pub interval: crate::models::JobExecutionTypeIntervalChoices,
    #[serde(
        rename = "args",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub args: Option<Option<serde_json::Value>>,
    #[serde(
        rename = "kwargs",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub kwargs: Option<Option<serde_json::Value>>,
    #[serde(
        rename = "celery_kwargs",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub celery_kwargs: Option<Option<serde_json::Value>>,
    /// If True, the schedule will only run the task a single time
    #[serde(rename = "one_off", skip_serializing_if = "Option::is_none")]
    pub one_off: Option<bool>,
    /// Datetime when the schedule should begin triggering the task to run
    #[serde(rename = "start_time")]
    pub start_time: String,
    /// Set to False to disable the schedule
    #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")]
    pub enabled: Option<bool>,
    /// Datetime that the schedule last triggered the task to run. Reset to None if enabled is set to False.
    #[serde(
        rename = "last_run_at",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub last_run_at: Option<Option<String>>,
    /// Running count of how many times the schedule has triggered the task
    #[serde(rename = "total_run_count", skip_serializing_if = "Option::is_none")]
    pub total_run_count: Option<i32>,
    /// Datetime that this scheduled job was last modified
    #[serde(rename = "date_changed", skip_serializing_if = "Option::is_none")]
    pub date_changed: Option<String>,
    /// Detailed description about the details of this scheduled job
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    #[serde(rename = "approval_required", skip_serializing_if = "Option::is_none")]
    pub approval_required: Option<bool>,
    /// Datetime that the schedule was approved
    #[serde(
        rename = "approved_at",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub approved_at: Option<Option<String>>,
    /// Cronjob syntax string for custom scheduling
    #[serde(rename = "crontab", skip_serializing_if = "Option::is_none")]
    pub crontab: Option<String>,
    #[serde(
        rename = "job_model",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub job_model: Option<Option<Box<crate::models::BulkWritableCircuitRequestTenant>>>,
    #[serde(
        rename = "job_queue",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub job_queue: Option<Option<Box<crate::models::JobQueueOverride>>>,
    #[serde(
        rename = "user",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub user: Option<Option<Box<crate::models::ScheduledJobUser>>>,
    #[serde(
        rename = "approved_by_user",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub approved_by_user: Option<Option<Box<crate::models::ScheduledJobApprovedByUser>>>,
}

impl ScheduledJob {
    /// This base serializer implements common fields and logic for all ModelSerializers.  Namely, it:  - defines the `display` field which exposes a human friendly value for the given object. - ensures that `id` field is always present on the serializer as well. - ensures that `created` and `last_updated` fields are always present if applicable to this model and serializer. - ensures that `object_type` field is always present on the serializer which represents the content-type of this   serializer's associated model (e.g. \"dcim.device\"). This is required as the OpenAPI schema, using the   PolymorphicProxySerializer class defined below, relies upon this field as a way to identify to the client   which of several possible serializers are in use for a given attribute. - supports `?depth` query parameter. It is passed in as `nested_depth` to the `build_nested_field()` function   to enable the dynamic generation of nested serializers.
    pub fn new(
        name: String,
        task: String,
        interval: crate::models::JobExecutionTypeIntervalChoices,
        start_time: String,
    ) -> ScheduledJob {
        ScheduledJob {
            id: None,
            object_type: None,
            display: None,
            url: None,
            natural_slug: None,
            queue: None,
            time_zone: None,
            name,
            task,
            interval,
            args: None,
            kwargs: None,
            celery_kwargs: None,
            one_off: None,
            start_time,
            enabled: None,
            last_run_at: None,
            total_run_count: None,
            date_changed: None,
            description: None,
            approval_required: None,
            approved_at: None,
            crontab: None,
            job_model: None,
            job_queue: None,
            user: None,
            approved_by_user: None,
        }
    }
}