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