internal static LinuxConfiguration DeserializeLinuxConfiguration(JsonElement element) { Optional <bool> disablePasswordAuthentication = default; Optional <SshConfiguration> ssh = default; Optional <bool> provisionVMAgent = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("disablePasswordAuthentication")) { disablePasswordAuthentication = property.Value.GetBoolean(); continue; } if (property.NameEquals("ssh")) { ssh = SshConfiguration.DeserializeSshConfiguration(property.Value); continue; } if (property.NameEquals("provisionVMAgent")) { provisionVMAgent = property.Value.GetBoolean(); continue; } } return(new LinuxConfiguration(Optional.ToNullable(disablePasswordAuthentication), ssh.Value, Optional.ToNullable(provisionVMAgent))); }
internal LinuxConfiguration(bool?disablePasswordAuthentication, SshConfiguration ssh, bool?provisionVmAgent, LinuxPatchSettings patchSettings) { DisablePasswordAuthentication = disablePasswordAuthentication; Ssh = ssh; ProvisionVmAgent = provisionVmAgent; PatchSettings = patchSettings; }
internal static LinuxConfiguration DeserializeLinuxConfiguration(JsonElement element) { Optional <bool> disablePasswordAuthentication = default; Optional <SshConfiguration> ssh = default; Optional <bool> provisionVMAgent = default; Optional <LinuxPatchSettings> patchSettings = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("disablePasswordAuthentication")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } disablePasswordAuthentication = property.Value.GetBoolean(); continue; } if (property.NameEquals("ssh")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } ssh = SshConfiguration.DeserializeSshConfiguration(property.Value); continue; } if (property.NameEquals("provisionVMAgent")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } provisionVMAgent = property.Value.GetBoolean(); continue; } if (property.NameEquals("patchSettings")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } patchSettings = LinuxPatchSettings.DeserializeLinuxPatchSettings(property.Value); continue; } } return(new LinuxConfiguration(Optional.ToNullable(disablePasswordAuthentication), ssh.Value, Optional.ToNullable(provisionVMAgent), patchSettings.Value)); }
internal static LinuxConfiguration DeserializeLinuxConfiguration(JsonElement element) { bool? disablePasswordAuthentication = default; SshConfiguration ssh = default; bool? provisionVMAgent = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("disablePasswordAuthentication")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } disablePasswordAuthentication = property.Value.GetBoolean(); continue; } if (property.NameEquals("ssh")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } ssh = SshConfiguration.DeserializeSshConfiguration(property.Value); continue; } if (property.NameEquals("provisionVMAgent")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } provisionVMAgent = property.Value.GetBoolean(); continue; } } return(new LinuxConfiguration(disablePasswordAuthentication, ssh, provisionVMAgent)); }