ProjectCmdRunner

Struct ProjectCmdRunner 

Source
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.

§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.
Source

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);
Source

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?;
Source

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?;
Source

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?;
Source

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

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,

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,

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,

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,

Retrieves fields for a specific project issue type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more