jira_v3_openapi 1.5.2

Jira Cloud platform REST API lib (OpenAPI document version: 1001.0.0-SNAPSHOT-37416ade0f89f7cb291510843b8a4bbd682b33a1)
Documentation
/*
 * The Jira Cloud platform REST API
 *
 * Jira Cloud platform REST API documentation
 *
 * The version of the OpenAPI document: 1001.0.0-SNAPSHOT-37416ade0f89f7cb291510843b8a4bbd682b33a1
 * Contact: ecosystem@atlassian.com
 * Generated by: https://openapi-generator.tech
 */

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

/// RedactionPosition : Represents the position of the redaction
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct RedactionPosition {
    /// The ADF pointer indicating the position of the text to be redacted. This is only required when redacting from rich text(ADF) fields. For plain text fields, this field can be omitted.
    #[serde(rename = "adfPointer", skip_serializing_if = "Option::is_none")]
    pub adf_pointer: Option<String>,
    /// The text which will be redacted, encoded using SHA256 hash and Base64 digest
    #[serde(rename = "expectedText")]
    pub expected_text: String,
    /// The start index(inclusive) for the redaction in specified content
    #[serde(rename = "from")]
    pub from: i32,
    /// The ending index(exclusive) for the redaction in specified content
    #[serde(rename = "to")]
    pub to: i32,
}

impl RedactionPosition {
    /// Represents the position of the redaction
    pub fn new(expected_text: String, from: i32, to: i32) -> RedactionPosition {
        RedactionPosition {
            adf_pointer: None,
            expected_text,
            from,
            to,
        }
    }
}