private static TypePropertyFlags GetTypePropertyFlags(Azure.Bicep.Types.Concrete.ObjectProperty input) { var flags = TypePropertyFlags.None; if (input.Flags.HasFlag(Azure.Bicep.Types.Concrete.ObjectPropertyFlags.Required)) { flags |= TypePropertyFlags.Required; } if (input.Flags.HasFlag(Azure.Bicep.Types.Concrete.ObjectPropertyFlags.ReadOnly)) { flags |= TypePropertyFlags.ReadOnly; } if (input.Flags.HasFlag(Azure.Bicep.Types.Concrete.ObjectPropertyFlags.WriteOnly)) { flags |= TypePropertyFlags.WriteOnly; } if (input.Flags.HasFlag(Azure.Bicep.Types.Concrete.ObjectPropertyFlags.DeployTimeConstant)) { flags |= TypePropertyFlags.DeployTimeConstant; } if (!input.Flags.HasFlag(Azure.Bicep.Types.Concrete.ObjectPropertyFlags.Required) && !input.Flags.HasFlag(Azure.Bicep.Types.Concrete.ObjectPropertyFlags.ReadOnly)) { // for non-required and non-readonly resource properties, we allow null assignment flags |= TypePropertyFlags.AllowImplicitNull; } return(flags); }
private static TypePropertyFlags GetTypePropertyFlags(Azure.Bicep.Types.Concrete.ObjectProperty input) { var flags = TypePropertyFlags.None; if (input.Flags.HasFlag(Azure.Bicep.Types.Concrete.ObjectPropertyFlags.Required)) { flags |= TypePropertyFlags.Required; } if (input.Flags.HasFlag(Azure.Bicep.Types.Concrete.ObjectPropertyFlags.ReadOnly)) { flags |= TypePropertyFlags.ReadOnly; } if (input.Flags.HasFlag(Azure.Bicep.Types.Concrete.ObjectPropertyFlags.WriteOnly)) { flags |= TypePropertyFlags.WriteOnly; } if (input.Flags.HasFlag(Azure.Bicep.Types.Concrete.ObjectPropertyFlags.DeployTimeConstant)) { flags |= TypePropertyFlags.SkipInlining; } return(flags); }
private TypeProperty GetTypeProperty(string name, Azure.Bicep.Types.Concrete.ObjectProperty input) { return(new TypeProperty(name, GetTypeReference(input.Type), GetTypePropertyFlags(input))); }
private TypeProperty GetTypeProperty(string name, Azure.Bicep.Types.Concrete.ObjectProperty input) { var type = input.Type ?? throw new ArgumentException(); return(new TypeProperty(name, GetTypeReference(type, false), GetTypePropertyFlags(input))); }