/// <summary> /// Converts the <paramref name="sourceValue" /> parameter into an instance of <see cref="FluxConfiguration" /> /// </summary> /// <param name="sourceValue">the value to convert into an instance of <see cref="FluxConfiguration" />.</param> /// <returns> /// an instance of <see cref="FluxConfiguration" />, or <c>null</c> if there is no suitable conversion. /// </returns> public static Microsoft.Azure.PowerShell.Cmdlets.KubernetesConfiguration.Models.Api20220301.IFluxConfiguration ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return(null); } global::System.Type type = sourceValue.GetType(); if (typeof(Microsoft.Azure.PowerShell.Cmdlets.KubernetesConfiguration.Models.Api20220301.IFluxConfiguration).IsAssignableFrom(type)) { return(sourceValue); } try { return(FluxConfiguration.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString()));; } catch { // Unable to use JSON pattern } if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) { return(FluxConfiguration.DeserializeFromPSObject(sourceValue)); } if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) { return(FluxConfiguration.DeserializeFromDictionary(sourceValue)); } return(null); }