text-document-direct-access 1.4.0

Entity CRUD controllers and DTOs for text-document
Documentation
// Generated by Qleany v1.5.0 from entity_dtos.tera

pub use common::entities::CharVerticalAlignment;
pub use common::entities::InlineContent;
use common::entities::InlineElement;
pub use common::entities::UnderlineStyle;
use common::types::EntityId;
use serde::{Deserialize, Serialize};
use std::convert::From;

#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
pub struct InlineElementDto {
    pub id: EntityId,
    pub created_at: chrono::DateTime<chrono::Utc>,
    pub updated_at: chrono::DateTime<chrono::Utc>,
    pub content: InlineContent,
    pub fmt_font_family: Option<String>,
    pub fmt_font_point_size: Option<i64>,
    pub fmt_font_weight: Option<i64>,
    pub fmt_font_bold: Option<bool>,
    pub fmt_font_italic: Option<bool>,
    pub fmt_font_underline: Option<bool>,
    pub fmt_font_overline: Option<bool>,
    pub fmt_font_strikeout: Option<bool>,
    pub fmt_letter_spacing: Option<i64>,
    pub fmt_word_spacing: Option<i64>,
    pub fmt_anchor_href: Option<String>,
    pub fmt_anchor_names: Vec<String>,
    pub fmt_is_anchor: Option<bool>,
    pub fmt_tooltip: Option<String>,
    pub fmt_underline_style: Option<UnderlineStyle>,
    pub fmt_vertical_alignment: Option<CharVerticalAlignment>,
}

impl From<InlineElementDto> for InlineElement {
    fn from(dto: InlineElementDto) -> Self {
        InlineElement {
            id: dto.id,
            created_at: dto.created_at,
            updated_at: dto.updated_at,
            content: dto.content,
            fmt_font_family: dto.fmt_font_family,
            fmt_font_point_size: dto.fmt_font_point_size,
            fmt_font_weight: dto.fmt_font_weight,
            fmt_font_bold: dto.fmt_font_bold,
            fmt_font_italic: dto.fmt_font_italic,
            fmt_font_underline: dto.fmt_font_underline,
            fmt_font_overline: dto.fmt_font_overline,
            fmt_font_strikeout: dto.fmt_font_strikeout,
            fmt_letter_spacing: dto.fmt_letter_spacing,
            fmt_word_spacing: dto.fmt_word_spacing,
            fmt_anchor_href: dto.fmt_anchor_href,
            fmt_anchor_names: dto.fmt_anchor_names,
            fmt_is_anchor: dto.fmt_is_anchor,
            fmt_tooltip: dto.fmt_tooltip,
            fmt_underline_style: dto.fmt_underline_style,
            fmt_vertical_alignment: dto.fmt_vertical_alignment,
        }
    }
}

impl From<&InlineElementDto> for InlineElement {
    fn from(dto: &InlineElementDto) -> Self {
        InlineElement {
            id: dto.id,
            created_at: dto.created_at,
            updated_at: dto.updated_at,
            content: dto.content.clone(),
            fmt_font_family: dto.fmt_font_family.clone(),
            fmt_font_point_size: dto.fmt_font_point_size,
            fmt_font_weight: dto.fmt_font_weight,
            fmt_font_bold: dto.fmt_font_bold,
            fmt_font_italic: dto.fmt_font_italic,
            fmt_font_underline: dto.fmt_font_underline,
            fmt_font_overline: dto.fmt_font_overline,
            fmt_font_strikeout: dto.fmt_font_strikeout,
            fmt_letter_spacing: dto.fmt_letter_spacing,
            fmt_word_spacing: dto.fmt_word_spacing,
            fmt_anchor_href: dto.fmt_anchor_href.clone(),
            fmt_anchor_names: dto.fmt_anchor_names.clone(),
            fmt_is_anchor: dto.fmt_is_anchor,
            fmt_tooltip: dto.fmt_tooltip.clone(),
            fmt_underline_style: dto.fmt_underline_style.clone(),
            fmt_vertical_alignment: dto.fmt_vertical_alignment.clone(),
        }
    }
}

impl From<InlineElement> for InlineElementDto {
    fn from(entity: InlineElement) -> Self {
        InlineElementDto {
            id: entity.id,
            created_at: entity.created_at,
            updated_at: entity.updated_at,
            content: entity.content,
            fmt_font_family: entity.fmt_font_family,
            fmt_font_point_size: entity.fmt_font_point_size,
            fmt_font_weight: entity.fmt_font_weight,
            fmt_font_bold: entity.fmt_font_bold,
            fmt_font_italic: entity.fmt_font_italic,
            fmt_font_underline: entity.fmt_font_underline,
            fmt_font_overline: entity.fmt_font_overline,
            fmt_font_strikeout: entity.fmt_font_strikeout,
            fmt_letter_spacing: entity.fmt_letter_spacing,
            fmt_word_spacing: entity.fmt_word_spacing,
            fmt_anchor_href: entity.fmt_anchor_href,
            fmt_anchor_names: entity.fmt_anchor_names,
            fmt_is_anchor: entity.fmt_is_anchor,
            fmt_tooltip: entity.fmt_tooltip,
            fmt_underline_style: entity.fmt_underline_style,
            fmt_vertical_alignment: entity.fmt_vertical_alignment,
        }
    }
}

#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
pub struct CreateInlineElementDto {
    pub created_at: chrono::DateTime<chrono::Utc>,
    pub updated_at: chrono::DateTime<chrono::Utc>,
    pub content: InlineContent,
    pub fmt_font_family: Option<String>,
    pub fmt_font_point_size: Option<i64>,
    pub fmt_font_weight: Option<i64>,
    pub fmt_font_bold: Option<bool>,
    pub fmt_font_italic: Option<bool>,
    pub fmt_font_underline: Option<bool>,
    pub fmt_font_overline: Option<bool>,
    pub fmt_font_strikeout: Option<bool>,
    pub fmt_letter_spacing: Option<i64>,
    pub fmt_word_spacing: Option<i64>,
    pub fmt_anchor_href: Option<String>,
    pub fmt_anchor_names: Vec<String>,
    pub fmt_is_anchor: Option<bool>,
    pub fmt_tooltip: Option<String>,
    pub fmt_underline_style: Option<UnderlineStyle>,
    pub fmt_vertical_alignment: Option<CharVerticalAlignment>,
}

impl From<CreateInlineElementDto> for InlineElement {
    fn from(dto: CreateInlineElementDto) -> Self {
        InlineElement {
            id: 0,
            created_at: dto.created_at,
            updated_at: dto.updated_at,
            content: dto.content,
            fmt_font_family: dto.fmt_font_family,
            fmt_font_point_size: dto.fmt_font_point_size,
            fmt_font_weight: dto.fmt_font_weight,
            fmt_font_bold: dto.fmt_font_bold,
            fmt_font_italic: dto.fmt_font_italic,
            fmt_font_underline: dto.fmt_font_underline,
            fmt_font_overline: dto.fmt_font_overline,
            fmt_font_strikeout: dto.fmt_font_strikeout,
            fmt_letter_spacing: dto.fmt_letter_spacing,
            fmt_word_spacing: dto.fmt_word_spacing,
            fmt_anchor_href: dto.fmt_anchor_href,
            fmt_anchor_names: dto.fmt_anchor_names,
            fmt_is_anchor: dto.fmt_is_anchor,
            fmt_tooltip: dto.fmt_tooltip,
            fmt_underline_style: dto.fmt_underline_style,
            fmt_vertical_alignment: dto.fmt_vertical_alignment,
        }
    }
}

impl From<&CreateInlineElementDto> for InlineElement {
    fn from(dto: &CreateInlineElementDto) -> Self {
        InlineElement {
            id: 0,
            created_at: dto.created_at,
            updated_at: dto.updated_at,
            content: dto.content.clone(),
            fmt_font_family: dto.fmt_font_family.clone(),
            fmt_font_point_size: dto.fmt_font_point_size,
            fmt_font_weight: dto.fmt_font_weight,
            fmt_font_bold: dto.fmt_font_bold,
            fmt_font_italic: dto.fmt_font_italic,
            fmt_font_underline: dto.fmt_font_underline,
            fmt_font_overline: dto.fmt_font_overline,
            fmt_font_strikeout: dto.fmt_font_strikeout,
            fmt_letter_spacing: dto.fmt_letter_spacing,
            fmt_word_spacing: dto.fmt_word_spacing,
            fmt_anchor_href: dto.fmt_anchor_href.clone(),
            fmt_anchor_names: dto.fmt_anchor_names.clone(),
            fmt_is_anchor: dto.fmt_is_anchor,
            fmt_tooltip: dto.fmt_tooltip.clone(),
            fmt_underline_style: dto.fmt_underline_style.clone(),
            fmt_vertical_alignment: dto.fmt_vertical_alignment.clone(),
        }
    }
}

impl From<InlineElement> for CreateInlineElementDto {
    fn from(entity: InlineElement) -> Self {
        CreateInlineElementDto {
            created_at: entity.created_at,
            updated_at: entity.updated_at,
            content: entity.content,
            fmt_font_family: entity.fmt_font_family,
            fmt_font_point_size: entity.fmt_font_point_size,
            fmt_font_weight: entity.fmt_font_weight,
            fmt_font_bold: entity.fmt_font_bold,
            fmt_font_italic: entity.fmt_font_italic,
            fmt_font_underline: entity.fmt_font_underline,
            fmt_font_overline: entity.fmt_font_overline,
            fmt_font_strikeout: entity.fmt_font_strikeout,
            fmt_letter_spacing: entity.fmt_letter_spacing,
            fmt_word_spacing: entity.fmt_word_spacing,
            fmt_anchor_href: entity.fmt_anchor_href,
            fmt_anchor_names: entity.fmt_anchor_names,
            fmt_is_anchor: entity.fmt_is_anchor,
            fmt_tooltip: entity.fmt_tooltip,
            fmt_underline_style: entity.fmt_underline_style,
            fmt_vertical_alignment: entity.fmt_vertical_alignment,
        }
    }
}

#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
pub struct UpdateInlineElementDto {
    pub id: EntityId,
    pub created_at: chrono::DateTime<chrono::Utc>,
    pub updated_at: chrono::DateTime<chrono::Utc>,
    pub content: InlineContent,
    pub fmt_font_family: Option<String>,
    pub fmt_font_point_size: Option<i64>,
    pub fmt_font_weight: Option<i64>,
    pub fmt_font_bold: Option<bool>,
    pub fmt_font_italic: Option<bool>,
    pub fmt_font_underline: Option<bool>,
    pub fmt_font_overline: Option<bool>,
    pub fmt_font_strikeout: Option<bool>,
    pub fmt_letter_spacing: Option<i64>,
    pub fmt_word_spacing: Option<i64>,
    pub fmt_anchor_href: Option<String>,
    pub fmt_anchor_names: Vec<String>,
    pub fmt_is_anchor: Option<bool>,
    pub fmt_tooltip: Option<String>,
    pub fmt_underline_style: Option<UnderlineStyle>,
    pub fmt_vertical_alignment: Option<CharVerticalAlignment>,
}

impl From<UpdateInlineElementDto> for InlineElement {
    fn from(dto: UpdateInlineElementDto) -> Self {
        InlineElement {
            id: dto.id,
            created_at: dto.created_at,
            updated_at: dto.updated_at,
            content: dto.content,
            fmt_font_family: dto.fmt_font_family,
            fmt_font_point_size: dto.fmt_font_point_size,
            fmt_font_weight: dto.fmt_font_weight,
            fmt_font_bold: dto.fmt_font_bold,
            fmt_font_italic: dto.fmt_font_italic,
            fmt_font_underline: dto.fmt_font_underline,
            fmt_font_overline: dto.fmt_font_overline,
            fmt_font_strikeout: dto.fmt_font_strikeout,
            fmt_letter_spacing: dto.fmt_letter_spacing,
            fmt_word_spacing: dto.fmt_word_spacing,
            fmt_anchor_href: dto.fmt_anchor_href,
            fmt_anchor_names: dto.fmt_anchor_names,
            fmt_is_anchor: dto.fmt_is_anchor,
            fmt_tooltip: dto.fmt_tooltip,
            fmt_underline_style: dto.fmt_underline_style,
            fmt_vertical_alignment: dto.fmt_vertical_alignment,
        }
    }
}

impl From<&UpdateInlineElementDto> for InlineElement {
    fn from(dto: &UpdateInlineElementDto) -> Self {
        InlineElement {
            id: dto.id,
            created_at: dto.created_at,
            updated_at: dto.updated_at,
            content: dto.content.clone(),
            fmt_font_family: dto.fmt_font_family.clone(),
            fmt_font_point_size: dto.fmt_font_point_size,
            fmt_font_weight: dto.fmt_font_weight,
            fmt_font_bold: dto.fmt_font_bold,
            fmt_font_italic: dto.fmt_font_italic,
            fmt_font_underline: dto.fmt_font_underline,
            fmt_font_overline: dto.fmt_font_overline,
            fmt_font_strikeout: dto.fmt_font_strikeout,
            fmt_letter_spacing: dto.fmt_letter_spacing,
            fmt_word_spacing: dto.fmt_word_spacing,
            fmt_anchor_href: dto.fmt_anchor_href.clone(),
            fmt_anchor_names: dto.fmt_anchor_names.clone(),
            fmt_is_anchor: dto.fmt_is_anchor,
            fmt_tooltip: dto.fmt_tooltip.clone(),
            fmt_underline_style: dto.fmt_underline_style.clone(),
            fmt_vertical_alignment: dto.fmt_vertical_alignment.clone(),
        }
    }
}

impl From<InlineElement> for UpdateInlineElementDto {
    fn from(entity: InlineElement) -> Self {
        UpdateInlineElementDto {
            id: entity.id,
            created_at: entity.created_at,
            updated_at: entity.updated_at,
            content: entity.content,
            fmt_font_family: entity.fmt_font_family,
            fmt_font_point_size: entity.fmt_font_point_size,
            fmt_font_weight: entity.fmt_font_weight,
            fmt_font_bold: entity.fmt_font_bold,
            fmt_font_italic: entity.fmt_font_italic,
            fmt_font_underline: entity.fmt_font_underline,
            fmt_font_overline: entity.fmt_font_overline,
            fmt_font_strikeout: entity.fmt_font_strikeout,
            fmt_letter_spacing: entity.fmt_letter_spacing,
            fmt_word_spacing: entity.fmt_word_spacing,
            fmt_anchor_href: entity.fmt_anchor_href,
            fmt_anchor_names: entity.fmt_anchor_names,
            fmt_is_anchor: entity.fmt_is_anchor,
            fmt_tooltip: entity.fmt_tooltip,
            fmt_underline_style: entity.fmt_underline_style,
            fmt_vertical_alignment: entity.fmt_vertical_alignment,
        }
    }
}

impl From<InlineElementDto> for UpdateInlineElementDto {
    fn from(dto: InlineElementDto) -> Self {
        UpdateInlineElementDto {
            id: dto.id,
            created_at: dto.created_at,
            updated_at: dto.updated_at,
            content: dto.content,
            fmt_font_family: dto.fmt_font_family,
            fmt_font_point_size: dto.fmt_font_point_size,
            fmt_font_weight: dto.fmt_font_weight,
            fmt_font_bold: dto.fmt_font_bold,
            fmt_font_italic: dto.fmt_font_italic,
            fmt_font_underline: dto.fmt_font_underline,
            fmt_font_overline: dto.fmt_font_overline,
            fmt_font_strikeout: dto.fmt_font_strikeout,
            fmt_letter_spacing: dto.fmt_letter_spacing,
            fmt_word_spacing: dto.fmt_word_spacing,
            fmt_anchor_href: dto.fmt_anchor_href,
            fmt_anchor_names: dto.fmt_anchor_names,
            fmt_is_anchor: dto.fmt_is_anchor,
            fmt_tooltip: dto.fmt_tooltip,
            fmt_underline_style: dto.fmt_underline_style,
            fmt_vertical_alignment: dto.fmt_vertical_alignment,
        }
    }
}