pub struct ProjectCmdRunner { /* private fields */ }Expand description
Project command runner struct.
This struct is responsible for holding the project commands parameters and it is used to pass the parameters to the project commands runner.
Implementations§
Source§impl ProjectCmdRunner
Project command runner implementation.
impl ProjectCmdRunner
Project command runner implementation.
§Methods
new- Creates a new instance of the ProjectCmdRunner struct.list_jira_projects- Lists Jira projects.get_jira_project_issue_types- Gets Jira project issue types.get_jira_project_issue_type_id- Gets Jira project issue fields by issue type ID.
Sourcepub fn new(cfg_file: &ConfigFile) -> ProjectCmdRunner
pub fn new(cfg_file: &ConfigFile) -> ProjectCmdRunner
Creates a new instance of the ProjectCmdRunner struct.
§Arguments
cfg_file- A ConfigFile struct.
§Returns
- A new instance of the ProjectCmdRunner struct.
§Examples
use jirust_cli::config::config_file::ConfigFile;
use jirust_cli::runners::jira_cmd_runners::project_cmd_runner::ProjectCmdRunner;
use toml::Table;
let cfg_file = ConfigFile::new("dXNlcm5hbWU6YXBpX2tleQ==".to_string(), "jira_url".to_string(), "standard_resolution".to_string(), "standard_resolution_comment".to_string(), Table::new());
let project_cmd_runner = ProjectCmdRunner::new(&cfg_file);Sourcepub async fn create_jira_project(
&self,
params: ProjectCmdParams,
) -> Result<ProjectIdentifiers, Box<dyn Error>>
pub async fn create_jira_project( &self, params: ProjectCmdParams, ) -> Result<ProjectIdentifiers, Box<dyn Error>>
Create a new Jira project using the provided parameters.
§Arguments
params- The parameters for creating the project.
§Returns
A Result containing the project identifiers if successful, or an error if failed.
§Examples
use jirust_cli::runners::jira_cmd_runners::project_cmd_runner::{ProjectCmdRunner, ProjectCmdParams};
use jirust_cli::config::config_file::ConfigFile;
use toml::Table;
let cfg_file = ConfigFile::new("auth_token".to_string(), "jira_url".to_string(), "standard_resolution".to_string(), "standard_resolution_comment".to_string(), Table::new());
let project_cmd_runner = ProjectCmdRunner::new(&cfg_file);
let mut params = ProjectCmdParams::new();
params.project_key = Some("TEST".to_string());
params.project_name = Some("Test Project".to_string());
params.project_description = Some("This is a test project".to_string());
params.project_field_configuration_id = Some(12345);
params.project_issue_security_scheme_id = Some(67890);
params.project_issue_type_scheme_id = Some(54321);
let projects = project_cmd_runner.create_jira_project(params).await?;
Sourcepub async fn list_jira_projects(
&self,
params: ProjectCmdParams,
) -> Result<Vec<Project>, Box<dyn Error>>
pub async fn list_jira_projects( &self, params: ProjectCmdParams, ) -> Result<Vec<Project>, Box<dyn Error>>
Lists Jira projects.
§Arguments
params- A ProjectCmdParams struct.
§Returns
- A Result with a vector of Project structs or an error message.
§Examples
use jirust_cli::runners::jira_cmd_runners::project_cmd_runner::{ProjectCmdRunner, ProjectCmdParams};
use jirust_cli::config::config_file::ConfigFile;
use toml::Table;
let cfg_file = ConfigFile::new("auth_token".to_string(), "jira_url".to_string(), "standard_resolution".to_string(), "standard_resolution_comment".to_string(), Table::new());
let project_cmd_runner = ProjectCmdRunner::new(&cfg_file);
let params = ProjectCmdParams::new();
let projects = project_cmd_runner.list_jira_projects(params).await?;Sourcepub async fn get_jira_project_issue_types(
&self,
params: ProjectCmdParams,
) -> Result<Vec<IssueTypeIssueCreateMetadata>, Box<dyn Error>>
pub async fn get_jira_project_issue_types( &self, params: ProjectCmdParams, ) -> Result<Vec<IssueTypeIssueCreateMetadata>, Box<dyn Error>>
Gets Jira project issue types.
§Arguments
params- A ProjectCmdParams struct.
§Returns
- A Result with a vector of IssueTypeIssueCreateMetadata structs or an error message.
§Examples
use jirust_cli::runners::jira_cmd_runners::project_cmd_runner::{ProjectCmdRunner, ProjectCmdParams};
use jirust_cli::config::config_file::ConfigFile;
use toml::Table;
let cfg_file = ConfigFile::new("auth_token".to_string(), "jira_url".to_string(), "standard_resolution".to_string(), "standard_resolution_comment".to_string(), Table::new());
let project_cmd_runner = ProjectCmdRunner::new(&cfg_file);
let params = ProjectCmdParams::new();
let issue_types = project_cmd_runner.get_jira_project_issue_types(params).await?;Sourcepub async fn get_jira_project_issue_type_id(
&self,
params: ProjectCmdParams,
) -> Result<Vec<FieldCreateMetadata>, Box<dyn Error>>
pub async fn get_jira_project_issue_type_id( &self, params: ProjectCmdParams, ) -> Result<Vec<FieldCreateMetadata>, Box<dyn Error>>
Gets Jira project issue fields by issue type id.
§Arguments
params- A ProjectCmdParams struct.
§Returns
- A Result with a vector of FieldCreateMetadata structs or an error message.
§Examples
use jirust_cli::runners::jira_cmd_runners::project_cmd_runner::{ProjectCmdRunner, ProjectCmdParams};
use jirust_cli::config::config_file::ConfigFile;
use toml::Table;
let cfg_file = ConfigFile::new("auth_token".to_string(), "jira_url".to_string(), "standard_resolution".to_string(), "standard_resolution_comment".to_string(), Table::new());
let project_cmd_runner = ProjectCmdRunner::new(&cfg_file);
let params = ProjectCmdParams::new();
let issue_fields = project_cmd_runner.get_jira_project_issue_type_id(params).await?;Trait Implementations§
Source§impl ProjectCmdRunnerApi for ProjectCmdRunner
impl ProjectCmdRunnerApi for ProjectCmdRunner
Source§fn create_jira_project<'life0, 'async_trait>(
&'life0 self,
params: ProjectCmdParams,
) -> Pin<Box<dyn Future<Output = Result<ProjectIdentifiers, Box<dyn Error>>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn create_jira_project<'life0, 'async_trait>(
&'life0 self,
params: ProjectCmdParams,
) -> Pin<Box<dyn Future<Output = Result<ProjectIdentifiers, Box<dyn Error>>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Creates a Jira project with the provided parameters.
Source§fn list_jira_projects<'life0, 'async_trait>(
&'life0 self,
params: ProjectCmdParams,
) -> Pin<Box<dyn Future<Output = Result<Vec<Project>, Box<dyn Error>>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_jira_projects<'life0, 'async_trait>(
&'life0 self,
params: ProjectCmdParams,
) -> Pin<Box<dyn Future<Output = Result<Vec<Project>, Box<dyn Error>>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Lists Jira projects using pagination if provided.
Source§fn get_jira_project_issue_types<'life0, 'async_trait>(
&'life0 self,
params: ProjectCmdParams,
) -> Pin<Box<dyn Future<Output = Result<Vec<IssueTypeIssueCreateMetadata>, Box<dyn Error>>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_jira_project_issue_types<'life0, 'async_trait>(
&'life0 self,
params: ProjectCmdParams,
) -> Pin<Box<dyn Future<Output = Result<Vec<IssueTypeIssueCreateMetadata>, Box<dyn Error>>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Retrieves issue types available for a project key.
Source§fn get_jira_project_issue_type_id<'life0, 'async_trait>(
&'life0 self,
params: ProjectCmdParams,
) -> Pin<Box<dyn Future<Output = Result<Vec<FieldCreateMetadata>, Box<dyn Error>>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_jira_project_issue_type_id<'life0, 'async_trait>(
&'life0 self,
params: ProjectCmdParams,
) -> Pin<Box<dyn Future<Output = Result<Vec<FieldCreateMetadata>, Box<dyn Error>>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Retrieves fields for a specific project issue type.
Auto Trait Implementations§
impl Freeze for ProjectCmdRunner
impl !RefUnwindSafe for ProjectCmdRunner
impl Send for ProjectCmdRunner
impl Sync for ProjectCmdRunner
impl Unpin for ProjectCmdRunner
impl !UnwindSafe for ProjectCmdRunner
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more