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

            BeforeFromJson(json, ref returnNow);
            if (returnNow)
            {
                return;
            }
            __roleManagementPolicyRule = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRule(json);
            { _setting = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject>("setting"), out var __jsonSetting) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ApprovalSettings.FromJson(__jsonSetting) : Setting; }
            AfterFromJson(json);
        }
        /// <summary>
        /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject into a new instance of <see cref="RoleManagementPolicyEnablementRule" />.
        /// </summary>
        /// <param name="json">A Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject instance to deserialize from.</param>
        internal RoleManagementPolicyEnablementRule(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json)
        {
            bool returnNow = false;

            BeforeFromJson(json, ref returnNow);
            if (returnNow)
            {
                return;
            }
            __roleManagementPolicyRule = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRule(json);
            { _enabledRule = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonArray>("enabledRules"), out var __jsonEnabledRules) ? If(__jsonEnabledRules as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonArray, out var __v) ? new global::System.Func <Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.EnablementRules[]>(() => global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u) => (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.EnablementRules)(__u is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString __t ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.EnablementRules)(__t.ToString()) : ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.EnablementRules) "")))))() : null : EnabledRule; }
            AfterFromJson(json);
        }
        /// <summary>
        /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject into a new instance of <see cref="RoleManagementPolicyExpirationRule" />.
        /// </summary>
        /// <param name="json">A Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject instance to deserialize from.</param>
        internal RoleManagementPolicyExpirationRule(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json)
        {
            bool returnNow = false;

            BeforeFromJson(json, ref returnNow);
            if (returnNow)
            {
                return;
            }
            __roleManagementPolicyRule = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRule(json);
            { _isExpirationRequired = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonBoolean>("isExpirationRequired"), out var __jsonIsExpirationRequired) ? (bool?)__jsonIsExpirationRequired : IsExpirationRequired; }
            { _maximumDuration = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString>("maximumDuration"), out var __jsonMaximumDuration) ? (string)__jsonMaximumDuration : (string)MaximumDuration; }
            AfterFromJson(json);
        }
        /// <summary>
        /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject into a new instance of <see cref="RoleManagementPolicyAuthenticationContextRule"
        /// />.
        /// </summary>
        /// <param name="json">A Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject instance to deserialize from.</param>
        internal RoleManagementPolicyAuthenticationContextRule(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json)
        {
            bool returnNow = false;

            BeforeFromJson(json, ref returnNow);
            if (returnNow)
            {
                return;
            }
            __roleManagementPolicyRule = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRule(json);
            { _isEnabled = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonBoolean>("isEnabled"), out var __jsonIsEnabled) ? (bool?)__jsonIsEnabled : IsEnabled; }
            { _claimValue = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString>("claimValue"), out var __jsonClaimValue) ? (string)__jsonClaimValue : (string)ClaimValue; }
            AfterFromJson(json);
        }
Exemple #5
0
        /// <summary>
        /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject into a new instance of <see cref="RoleManagementPolicyNotificationRule" />.
        /// </summary>
        /// <param name="json">A Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject instance to deserialize from.</param>
        internal RoleManagementPolicyNotificationRule(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json)
        {
            bool returnNow = false;

            BeforeFromJson(json, ref returnNow);
            if (returnNow)
            {
                return;
            }
            __roleManagementPolicyRule = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRule(json);
            { _notificationType = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString>("notificationType"), out var __jsonNotificationType) ? (string)__jsonNotificationType : (string)NotificationType; }
            { _notificationLevel = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString>("notificationLevel"), out var __jsonNotificationLevel) ? (string)__jsonNotificationLevel : (string)NotificationLevel; }
            { _recipientType = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString>("recipientType"), out var __jsonRecipientType) ? (string)__jsonRecipientType : (string)RecipientType; }
            { _notificationRecipient = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonArray>("notificationRecipients"), out var __jsonNotificationRecipients) ? If(__jsonNotificationRecipients as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonArray, out var __v) ? new global::System.Func <string[]>(() => global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u) => (string)(__u is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null))))() : null : NotificationRecipient; }
            { _isDefaultRecipientsEnabled = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonBoolean>("isDefaultRecipientsEnabled"), out var __jsonIsDefaultRecipientsEnabled) ? (bool?)__jsonIsDefaultRecipientsEnabled : IsDefaultRecipientsEnabled; }
            AfterFromJson(json);
        }