/// <summary>
        /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Runtime.Json.JsonObject into a new instance of <see cref="ServerPropertiesForGeoRestore" />.
        /// </summary>
        /// <param name="json">A Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Runtime.Json.JsonObject instance to deserialize from.</param>
        internal ServerPropertiesForGeoRestore(Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Runtime.Json.JsonObject json)
        {
            bool returnNow = false;

            BeforeFromJson(json, ref returnNow);
            if (returnNow)
            {
                return;
            }
            __serverPropertiesForCreate = new Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Models.Api20171201.ServerPropertiesForCreate(json);
            { _sourceServerId = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Runtime.Json.JsonString>("sourceServerId"), out var __jsonSourceServerId) ? (string)__jsonSourceServerId : (string)SourceServerId; }
            AfterFromJson(json);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Runtime.Json.JsonObject into a new instance of <see cref="ServerPropertiesForDefaultCreate" />.
        /// </summary>
        /// <param name="json">A Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Runtime.Json.JsonObject instance to deserialize from.</param>
        internal ServerPropertiesForDefaultCreate(Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Runtime.Json.JsonObject json)
        {
            bool returnNow = false;

            BeforeFromJson(json, ref returnNow);
            if (returnNow)
            {
                return;
            }
            __serverPropertiesForCreate = new Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Models.Api20171201.ServerPropertiesForCreate(json);
            { _administratorLogin = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Runtime.Json.JsonString>("administratorLogin"), out var __jsonAdministratorLogin) ? (string)__jsonAdministratorLogin : (string)AdministratorLogin; }
            { _administratorLoginPassword = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Runtime.Json.JsonString>("administratorLoginPassword"), out var __jsonAdministratorLoginPassword) ? new System.Net.NetworkCredential("", (string)__jsonAdministratorLoginPassword).SecurePassword : AdministratorLoginPassword; }
            AfterFromJson(json);
        }
        /// <summary>
        /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Runtime.Json.JsonObject into a new instance of <see cref="ServerPropertiesForRestore" />.
        /// </summary>
        /// <param name="json">A Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Runtime.Json.JsonObject instance to deserialize from.</param>
        internal ServerPropertiesForRestore(Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Runtime.Json.JsonObject json)
        {
            bool returnNow = false;

            BeforeFromJson(json, ref returnNow);
            if (returnNow)
            {
                return;
            }
            __serverPropertiesForCreate = new Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Models.Api20171201.ServerPropertiesForCreate(json);
            { _sourceServerId = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Runtime.Json.JsonString>("sourceServerId"), out var __jsonSourceServerId) ? (string)__jsonSourceServerId : (string)SourceServerId; }
            { _restorePointInTime = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.PostgreSql.Runtime.Json.JsonString>("restorePointInTime"), out var __jsonRestorePointInTime) ? global::System.DateTime.TryParse((string)__jsonRestorePointInTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonRestorePointInTimeValue) ? __jsonRestorePointInTimeValue : RestorePointInTime : RestorePointInTime; }
            AfterFromJson(json);
        }