public override void Remove(Parameter item) { base.Remove(item); // find a Property in OptionsParameterModelType with the same name and remove it. OptionsParameterModelType.Remove(prop => prop.Name == item.Name); }
public MethodJs() { // methods that have no group name get the client name as their name Group.OnGet += groupName => { return(groupName.IsNullOrEmpty() ? CodeModel?.Name.Value : groupName); }; OptionsParameterTemplateModel = (ParameterJs)New <Parameter>(new { Name = "options", SerializedName = "options", IsRequired = false, Documentation = "Optional Parameters.", Location = ParameterLocation.None, ModelType = New <CompositeType>(new { Name = "options", SerializedName = "options", Documentation = "Optional Parameters." }) }); OptionsParameterModelType.Add(New <Core.Model.Property>(new { IsReadOnly = false, Name = "customHeaders", IsRequired = false, Documentation = "Headers that will be added to the request", ModelType = New <PrimaryType>(KnownPrimaryType.Object), SerializedName = "customHeaders" })); }
public override Parameter Add(Parameter item) { var parameter = base.Add(item) as ParameterJs; if (parameter.IsLocal && !parameter.IsRequired) { OptionsParameterModelType.Add(New <Core.Model.Property>(new { IsReadOnly = false, Name = parameter.Name, IsRequired = parameter.IsRequired, DefaultValue = parameter.DefaultValue, Documentation = parameter.Documentation, ModelType = parameter.ModelType, SerializedName = parameter.SerializedName, Constraints = parameter.Constraints, // optionalProperty.Constraints.AddRange(parameter.Constraints); Extensions = parameter.Extensions // optionalProperty.Extensions.AddRange(parameter.Extensions); })); } return(parameter); }