pub struct VersionCmdParams {Show 14 fields
pub project: String,
pub project_id: Option<i64>,
pub version_name: Option<String>,
pub version_id: Option<String>,
pub version_description: Option<String>,
pub version_start_date: Option<String>,
pub version_release_date: Option<String>,
pub version_archived: Option<bool>,
pub version_released: Option<bool>,
pub changelog_file: Option<String>,
pub transition_issues: Option<bool>,
pub transition_assignee: Option<String>,
pub versions_page_size: Option<i32>,
pub versions_page_offset: Option<i64>,
}Expand description
This struct defines the parameters for the Version commands
§Fields
project- The project key, always required.project_id- The project ID, optional.version_name- The version name, optional.version_id- The version ID, required for archive, delete, release and update.version_description- The version description, optional.version_start_date- The version start date, optional (default: today on create command).version_release_date- The version release date, optional (default: today on release command).version_archived- The version archived status, optional.version_released- The version released status, optional.changelog_file- The changelog file path, to be used for automatic description generation (changelog-based), optional: if set the script detects automatically the first tagged block in the changelog and use it as descriptionresolve_issues- The flag to resolve issues in the version, optional.versions_page_size- The page size for the version, optional.versions_page_offset- The page offset for the version, optional.
Fields§
§project: StringJira project key (required for all version operations).
project_id: Option<i64>Jira project id when key is not available.
version_name: Option<String>Version name to create or update.
version_id: Option<String>Version id required for archive, delete, release, and update operations.
version_description: Option<String>Human readable version description.
version_start_date: Option<String>Version start date in yyyy-mm-dd format.
version_release_date: Option<String>Version release date in yyyy-mm-dd format.
version_archived: Option<bool>Flag indicating whether the version is archived.
version_released: Option<bool>Flag indicating whether the version is released.
changelog_file: Option<String>Optional changelog file path used to build the description.
transition_issues: Option<bool>Whether to transition issues found in the changelog.
transition_assignee: Option<String>Account id used when reassigning transitioned issues.
versions_page_size: Option<i32>Page size used when listing versions.
versions_page_offset: Option<i64>Page offset used when listing versions.
Implementations§
Source§impl VersionCmdParams
Implementation of the VersionCmdParams struct
impl VersionCmdParams
Implementation of the VersionCmdParams struct
§Methods
new- returns a new VersionCmdParams structmerge_args- merges the current version with the optional argumentsmark_released- marks the version as releasedmark_archived- marks the version as archived
Sourcepub fn new() -> VersionCmdParams
pub fn new() -> VersionCmdParams
Sourcepub fn merge_args(
current_version: Version,
opt_args: Option<&VersionArgs>,
) -> VersionCmdParams
pub fn merge_args( current_version: Version, opt_args: Option<&VersionArgs>, ) -> VersionCmdParams
This method merges the current version with the optional arguments and returns a VersionCmdParams struct If the optional arguments are not given, it uses the current version values
§Arguments
current_version- A Version structopt_args- An Option<&VersionArgs> struct
§Returns
- A VersionCmdParams struct
§Examples
use jira_v3_openapi::models::Version;
use jirust_cli::args::commands::{VersionArgs, VersionActionValues, PaginationArgs, OutputArgs};
use jirust_cli::runners::jira_cmd_runners::version_cmd_runner::VersionCmdParams;
let mut current_version: Version = Version::new();
current_version.id = Some("12345".to_string());
current_version.project_id = Some(9876);
current_version.project = Some("TEST_PROJECT".to_string());
current_version.name = Some("v1.0".to_string());
current_version.description = Some("This is the first version".to_string());
let opt_args = VersionArgs {
version_act: VersionActionValues::List,
project_key: "project_key".to_string(),
project_id: None,
version_id: Some("97531".to_string()),
version_name: Some("version_name".to_string()),
version_description: Some("version_description".to_string()),
version_start_date: None,
version_release_date: None,
version_archived: None,
version_released: Some(true),
changelog_file: None,
pagination: PaginationArgs { page_size: None, page_offset: None },
output: OutputArgs { output_format: None, output_type: None },
transition_issues: None,
transition_assignee: None,
};
let params = VersionCmdParams::merge_args(current_version, Some(&opt_args));
assert_eq!(params.project, "TEST_PROJECT".to_string());
assert_eq!(params.project_id, Some(9876));
assert_eq!(params.version_id, Some("12345".to_string()));
assert_eq!(params.version_name, Some("version_name".to_string()));
assert_eq!(params.version_description, Some("version_description".to_string()));
assert_eq!(params.version_released, Some(true));Sourcepub fn mark_released(version: Version) -> VersionCmdParams
pub fn mark_released(version: Version) -> VersionCmdParams
This method marks the version as released and returns a VersionCmdParams struct It sets the version_released and version_release_date fields with the current date
§Arguments
version- A Version struct
§Returns
- A VersionCmdParams struct
§Examples
use jira_v3_openapi::models::Version;
use jirust_cli::runners::jira_cmd_runners::version_cmd_runner::VersionCmdParams;
let mut version: Version = Version::new();
version.id = Some("12345".to_string());
version.project_id = Some(9876);
version.project = Some("TEST_PROJECT".to_string());
version.name = Some("v1.0".to_string());
version.description = Some("This is the first version".to_string());
assert_eq!(version.released, None);
let params = VersionCmdParams::mark_released(version);
assert_eq!(params.version_released, Some(true));Sourcepub fn mark_archived(version: Version) -> VersionCmdParams
pub fn mark_archived(version: Version) -> VersionCmdParams
This method marks the version as archived and returns a VersionCmdParams struct
§Arguments
version- A Version struct
§Returns
- A VersionCmdParams struct
§Examples
use jira_v3_openapi::models::Version;
use jirust_cli::runners::jira_cmd_runners::version_cmd_runner::VersionCmdParams;
let mut version: Version = Version::new();
version.id = Some("12345".to_string());
version.project_id = Some(9876);
version.project = Some("TEST_PROJECT".to_string());
version.name = Some("v1.0".to_string());
version.description = Some("This is the first version".to_string());
assert_eq!(version.archived, None);
let params = VersionCmdParams::mark_archived(version);
assert_eq!(params.version_archived, Some(true));Trait Implementations§
Source§impl Default for VersionCmdParams
Implementation of the Default trait for the VersionCmdParams struct
impl Default for VersionCmdParams
Implementation of the Default trait for the VersionCmdParams struct
Source§fn default() -> Self
fn default() -> Self
This method returns a VersionCmdParams struct with default values and returns a VersionCmdParams struct
§Returns
- A VersionCmdParams struct initialized with default values
§Examples
use jirust_cli::runners::jira_cmd_runners::version_cmd_runner::VersionCmdParams;
let params = VersionCmdParams::default();
assert_eq!(params.project, "".to_string());
assert_eq!(params.project_id, None);
assert_eq!(params.version_name, None);
assert_eq!(params.version_id, None);
assert_eq!(params.version_description, None);
assert_eq!(params.version_start_date, None);
assert_eq!(params.version_release_date, None);
assert_eq!(params.version_archived, None);
assert_eq!(params.version_released, None);
assert_eq!(params.changelog_file, None);
assert_eq!(params.transition_issues, None);
assert_eq!(params.transition_assignee, None);
assert_eq!(params.versions_page_size, None);
assert_eq!(params.versions_page_offset, None);Source§impl From<&VersionArgs> for VersionCmdParams
Implementation of the From trait for the VersionArgs struct
This implementation allows the conversion of a VersionArgs struct to a VersionCmdParams struct.
impl From<&VersionArgs> for VersionCmdParams
Implementation of the From trait for the VersionArgs struct This implementation allows the conversion of a VersionArgs struct to a VersionCmdParams struct.
Source§fn from(args: &VersionArgs) -> Self
fn from(args: &VersionArgs) -> Self
This method converts the VersionArgs struct to a VersionCmdParams struct and returns a VersionCmdParams struct
§Arguments
args- A VersionArgs struct
§Returns
- A VersionCmdParams struct
§Examples
use jirust_cli::args::commands::{VersionActionValues, VersionArgs, PaginationArgs, OutputArgs};
use jirust_cli::runners::jira_cmd_runners::version_cmd_runner::VersionCmdParams;
let version_args = VersionArgs {
version_act: VersionActionValues::List,
project_key: "project_key".to_string(),
project_id: None,
version_id: None,
version_name: Some("version_name".to_string()),
version_description: Some("version_description".to_string()),
version_start_date: None,
version_release_date: None,
version_archived: None,
version_released: None,
changelog_file: None,
pagination: PaginationArgs { page_size: Some(10), page_offset: Some(0) },
output: OutputArgs { output_format: None, output_type: None },
transition_issues: None,
transition_assignee: None,
};
let params = VersionCmdParams::from(&version_args);
assert_eq!(params.project, "project_key".to_string());
assert_eq!(params.version_name, Some("version_name".to_string()));
assert_eq!(params.version_description, Some("version_description".to_string()));
assert_eq!(params.versions_page_size, Some(10));
assert_eq!(params.versions_page_offset, Some(0));