/// <summary> /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.Json.JsonObject into a new instance of <see cref="AzureRetentionRule" />. /// </summary> /// <param name="json">A Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.Json.JsonObject instance to deserialize from.</param> internal AzureRetentionRule(Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.Json.JsonObject json) { bool returnNow = false; BeforeFromJson(json, ref returnNow); if (returnNow) { return; } __basePolicyRule = new Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.BasePolicyRule(json); { _isDefault = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.Json.JsonBoolean>("isDefault"), out var __jsonIsDefault) ? (bool?)__jsonIsDefault : IsDefault; } { _lifecycle = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.Json.JsonArray>("lifecycles"), out var __jsonLifecycles) ? If(__jsonLifecycles as Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.Json.JsonArray, out var __v) ? new global::System.Func <Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.ISourceLifeCycle[]>(() => global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u) => (Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.ISourceLifeCycle)(Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.SourceLifeCycle.FromJson(__u)))))() : null : Lifecycle; } AfterFromJson(json); }
/// <summary> /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.Json.JsonObject into a new instance of <see cref="AzureBackupRule" />. /// </summary> /// <param name="json">A Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.Json.JsonObject instance to deserialize from.</param> internal AzureBackupRule(Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.Json.JsonObject json) { bool returnNow = false; BeforeFromJson(json, ref returnNow); if (returnNow) { return; } __basePolicyRule = new Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.BasePolicyRule(json); { _backupParameter = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.Json.JsonObject>("backupParameters"), out var __jsonBackupParameters) ? Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.BackupParameters.FromJson(__jsonBackupParameters) : BackupParameter; } { _dataStore = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.Json.JsonObject>("dataStore"), out var __jsonDataStore) ? Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.DataStoreInfoBase.FromJson(__jsonDataStore) : DataStore; } { _trigger = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.Json.JsonObject>("trigger"), out var __jsonTrigger) ? Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.TriggerContext.FromJson(__jsonTrigger) : Trigger; } AfterFromJson(json); }