Struct cfn_guard::ValidateBuilder

source ·
pub struct ValidateBuilder { /* private fields */ }
Expand description

. A builder to help construct the Validate command

Implementations§

source§

impl ValidateBuilder

source

pub fn rules(self, rules: Vec<String>) -> Self

a list of paths that point to rule files, or a directory containing rule files on a local machine. Only files that end with .guard or .ruleset will be evaluated conflicts with payload

source

pub fn data(self, data: Vec<String>) -> Self

a list of paths that point to data files, or a directory containing data files for the rules to be evaluated against. Only JSON, or YAML files will be used conflicts with payload

source

pub fn show_summary(self, args: Vec<ShowSummaryType>) -> Self

Controls if the summary table needs to be displayed. –show-summary fail (default) or –show-summary pass,fail (only show rules that did pass/fail) or –show-summary none (to turn it off) or –show-summary all (to show all the rules that pass, fail or skip) default is failed must be set to none if used together with the structured flag

source

pub fn input_params(self, input_params: Vec<String>) -> Self

a list of paths that point to data files, or a directory containing data files to be merged with the data argument and then the rules will be evaluated against them. Only JSON, or YAML files will be used

source

pub fn output_format(self, output: OutputFormatType) -> Self

Specify the format in which the output should be displayed default is single-line-summary if junit is used, structured attributed must be set to true

source

pub fn payload(self, arg: bool) -> Self

Tells the command that rules, and data will be passed via a reader, as a json payload. Conflicts with both rules, and data default is false

source

pub fn alphabetical(self, arg: bool) -> Self

Validate files in a directory ordered alphabetically, conflicts with last_modified field

source

pub fn last_modified(self, arg: bool) -> Self

Validate files in a directory ordered by last modified times, conflicts with alphabetical field

source

pub fn verbose(self, arg: bool) -> Self

Output verbose logging, conflicts with structured field default is false

source

pub fn print_json(self, arg: bool) -> Self

Print the parse tree in a json format. This can be used to get more details on how the clauses were evaluated conflicts with the structured attribute default is false

source

pub fn structured(self, arg: bool) -> Self

Prints the output which must be specified to JSON/YAML/JUnit in a structured format Conflicts with the following attributes verbose, print-json, output-format when set to “single-line-summary”, show-summary when set to anything other than “none” default is false

Trait Implementations§

source§

impl CommandBuilder<Validate> for ValidateBuilder

source§

fn try_build(self) -> Result<Validate, Error>

. attempts to construct a Validate command

This function will return an error if

  • conflicting attributes have been set
  • both rules is empty, and payload is false
source§

impl Debug for ValidateBuilder

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for ValidateBuilder

source§

fn default() -> Self

Returns the “default value” for a type. Read more

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, 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, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.