/*
 * The Jira Cloud platform REST API
 *
 * Jira Cloud platform REST API documentation
 *
 * The version of the OpenAPI document: 1001.0.0-SNAPSHOT-48dd1e2d75e7eac65741e465279d2700f927137d
 * Contact: ecosystem@atlassian.com
 * Generated by: https://openapi-generator.tech
 */

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

/// VersionRelatedWork : Associated related work to a version
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct VersionRelatedWork {
    /// The category of the related work
    #[serde(rename = "category")]
    pub category: String,
    /// The ID of the issue associated with the related work (if there is one). Cannot be updated via the Rest API.
    #[serde(rename = "issueId", skip_serializing_if = "Option::is_none")]
    pub issue_id: Option<i64>,
    /// The id of the related work. For the native release note related work item, this will be null, and Rest API does not support updating it.
    #[serde(rename = "relatedWorkId", skip_serializing_if = "Option::is_none")]
    pub related_work_id: Option<String>,
    /// The title of the related work
    #[serde(rename = "title", skip_serializing_if = "Option::is_none")]
    pub title: Option<String>,
    /// The URL of the related work. Will be null for the native release note related work item, but is otherwise required.
    #[serde(rename = "url", skip_serializing_if = "Option::is_none")]
    pub url: Option<String>,
}

impl VersionRelatedWork {
    /// Associated related work to a version
    pub fn new(category: String) -> VersionRelatedWork {
        VersionRelatedWork {
            category,
            issue_id: None,
            related_work_id: None,
            title: None,
            url: None,
        }
    }
}

