You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// <auto-generated/>usingSystem.Runtime.Serialization;usingSystem;namespaceFirecracker.Management.Models{/// <summary>The CPU Template defines a set of flags to be disabled from the microvm so that the features exposed to the guest are the same as in the selected instance type.</summary>publicenumCpuTemplate{[EnumMember(Value="C3")]C3,[EnumMember(Value="T2")]T2,[EnumMember(Value="T2S")]T2S,[EnumMember(Value="T2CL")]T2CL,[EnumMember(Value="T2A")]T2A,[EnumMember(Value="V1N1")]V1N1,[EnumMember(Value="None")]None,}}
But a CS1061 compiler error is generated for the following line in the constructor:
CpuTemplate=CpuTemplate.None;
in the class:
// <auto-generated/>usingMicrosoft.Kiota.Abstractions.Serialization;usingSystem.Collections.Generic;usingSystem.IO;usingSystem.Linq;usingSystem;namespaceFirecracker.Management.Models{/// <summary>/// Describes the number of vCPUs, memory size, SMT capabilities and the CPU template./// </summary>publicclassMachineConfiguration:IAdditionalDataHolder,IParsable{/// <summary>Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.</summary>publicIDictionary<string,object>AdditionalData{get;set;}/// <summary>The CPU Template defines a set of flags to be disabled from the microvm so that the features exposed to the guest are the same as in the selected instance type.</summary>publicFirecracker.Management.Models.CpuTemplate?CpuTemplate{get;set;}/// <summary>Memory size of VM</summary>publicint?MemSizeMib{get;set;}/// <summary>Flag for enabling/disabling simultaneous multithreading. Can be enabled only on x86.</summary>publicbool?Smt{get;set;}/// <summary>Enable dirty page tracking. If this is enabled, then incremental guest memory snapshots can be created. These belong to diff snapshots, which contain, besides the microVM state, only the memory dirtied since a previous snapshot. Full snapshots each contain a full copy of the guest memory.</summary>publicbool?TrackDirtyPages{get;set;}/// <summary>Number of vCPUs (either 1 or an even number)</summary>publicint?VcpuCount{get;set;}/// <summary>/// Instantiates a new MachineConfiguration and sets the default values./// </summary>publicMachineConfiguration(){AdditionalData=newDictionary<string,object>();CpuTemplate=CpuTemplate.None;}/// <summary>/// Creates a new instance of the appropriate class based on discriminator value/// </summary>/// <param name="parseNode">The parse node to use to read the discriminator value and create the object</param>publicstaticMachineConfigurationCreateFromDiscriminatorValue(IParseNodeparseNode){_=parseNode??thrownewArgumentNullException(nameof(parseNode));returnnewMachineConfiguration();}/// <summary>/// The deserialization information for the current model/// </summary>publicIDictionary<string,Action<IParseNode>>GetFieldDeserializers(){returnnewDictionary<string,Action<IParseNode>>{{"cpu_template", n =>{CpuTemplate=n.GetEnumValue<CpuTemplate>();}},{"mem_size_mib", n =>{MemSizeMib=n.GetIntValue();}},{"smt", n =>{Smt=n.GetBoolValue();}},{"track_dirty_pages", n =>{TrackDirtyPages=n.GetBoolValue();}},{"vcpu_count", n =>{VcpuCount=n.GetIntValue();}},};}/// <summary>/// Serializes information the current object/// </summary>/// <param name="writer">Serialization writer to use to serialize this model</param>publicvoidSerialize(ISerializationWriterwriter){_=writer??thrownewArgumentNullException(nameof(writer));writer.WriteEnumValue<CpuTemplate>("cpu_template",CpuTemplate);writer.WriteIntValue("mem_size_mib",MemSizeMib);writer.WriteBoolValue("smt",Smt);writer.WriteBoolValue("track_dirty_pages",TrackDirtyPages);writer.WriteIntValue("vcpu_count",VcpuCount);writer.WriteAdditionalData(AdditionalData);}}}
Because there is a naming collision between Firecracker.Management.Models.CpuTemplate and Firecracker.Management.Models.MachineConfiguration.CpuTemplate
Thanks for reporting this. @andrueastman to fully qualify enums in default values using the same rationale as properties.
(or you if you feel like submitting a PR)
With Kiota v 1.6.0-preview.202308240001+e0fde4dcaca551c21c52a699c4ffdf5b1bc5b5b1
Using the following command:
kiota generate -l CSharp -c FirecrackerManagementClient -n Firecracker.Management -d https://raw.githubusercontent.com/firecracker-microvm/firecracker/main/src/api_server/swagger/firecracker.yaml -o "c:\temp\firecracker\client"
Which requires the following packages to compile:
The following enum is generated:
But a CS1061 compiler error is generated for the following line in the constructor:
in the class:
Because there is a naming collision between
Firecracker.Management.Models.CpuTemplate
andFirecracker.Management.Models.MachineConfiguration.CpuTemplate
The generated code in the constructor should be:
Or equivalent type alias.
The text was updated successfully, but these errors were encountered: