@@ -30,22 +30,22 @@ pub struct PolicyPackageNameDefinition {
3030}
3131
3232#[ derive( Debug , Clone , Serialize ) ]
33- pub struct PolicyParameterDetails {
33+ pub struct PolicyParameter {
3434 pub name : String ,
3535 pub modifiable : bool ,
3636 pub required : bool ,
3737}
3838
3939#[ derive( Debug , Clone , Serialize ) ]
40- pub struct PolicyModifierDetails {
40+ pub struct PolicyModifier {
4141 pub name : String ,
4242}
4343
4444#[ derive( Debug , Clone , Serialize ) ]
45- pub struct PolicyParameterDefinition {
45+ pub struct PolicyParameters {
4646 pub source_file : String ,
47- pub parameters : Vec < PolicyParameterDetails > ,
48- pub modifiers : Vec < PolicyModifierDetails > ,
47+ pub parameters : Vec < PolicyParameter > ,
48+ pub modifiers : Vec < PolicyModifier > ,
4949}
5050
5151/// Create a default engine.
@@ -950,6 +950,8 @@ impl Engine {
950950 /// # Ok(())
951951 /// # }
952952 /// ```
953+ #[ cfg( feature = "azure_policy" ) ]
954+ #[ cfg_attr( docsrs, doc( cfg( feature = "azure_policy" ) ) ) ]
953955 pub fn get_policy_package_names ( & self ) -> Result < Vec < PolicyPackageNameDefinition > > {
954956 let mut package_names = vec ! [ ] ;
955957 for m in & self . modules {
@@ -981,7 +983,9 @@ impl Engine {
981983 /// # Ok(())
982984 /// # }
983985 /// ```
984- pub fn get_policy_parameters ( & self ) -> Result < Vec < PolicyParameterDefinition > > {
986+ #[ cfg( feature = "azure_policy" ) ]
987+ #[ cfg_attr( docsrs, doc( cfg( feature = "azure_policy" ) ) ) ]
988+ pub fn get_policy_parameters ( & self ) -> Result < Vec < PolicyParameters > > {
985989 let mut policy_parameter_definitions = vec ! [ ] ;
986990 for m in & self . modules {
987991 let mut parameters = vec ! [ ] ;
@@ -996,7 +1000,7 @@ impl Engine {
9961000
9971001 if paths. len ( ) == 2 && paths[ 0 ] == "parameters" {
9981002 // Todo: Fetch fields other than name from rego metadoc for the parameter
999- parameters. push ( PolicyParameterDetails {
1003+ parameters. push ( PolicyParameter {
10001004 name : paths[ 1 ] . to_string ( ) ,
10011005 modifiable : false ,
10021006 required : false ,
@@ -1014,7 +1018,7 @@ impl Engine {
10141018
10151019 if paths. len ( ) == 2 && paths[ 0 ] == "parameters" {
10161020 // Todo: Fetch fields other than name from rego metadoc for the parameter
1017- modifiers. push ( PolicyModifierDetails {
1021+ modifiers. push ( PolicyModifier {
10181022 name : paths[ 1 ] . to_string ( ) ,
10191023 } )
10201024 }
@@ -1025,7 +1029,7 @@ impl Engine {
10251029 }
10261030 }
10271031
1028- policy_parameter_definitions. push ( PolicyParameterDefinition {
1032+ policy_parameter_definitions. push ( PolicyParameters {
10291033 source_file : m. package . span . source . file ( ) . to_string ( ) ,
10301034 parameters,
10311035 modifiers,
0 commit comments