/// <summary>
        /// Serializes this instance of <see cref="MarketplaceRegistrationDefinitionList" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode"
        /// />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonObject"/> container to serialize this object into. If the caller
        /// passes in <c>null</c>, a new instance will be created and returned to the caller.</param>
        /// <param name="serializationMode">Allows the caller to choose the depth of the serialization. See <see cref="Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="MarketplaceRegistrationDefinitionList" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.SerializationMode.IncludeReadOnly))
            {
                if (null != this._value)
                {
                    var __w = new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.XNodeArray();
                    foreach (var __x in this._value)
                    {
                        AddIf(__x?.ToJson(null, serializationMode), __w.Add);
                    }
                    container.Add("value", __w);
                }
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink", container.Add);
            }
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="Authorization" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonObject"/> container to serialize this object into. If the caller
        /// passes in <c>null</c>, a new instance will be created and returned to the caller.</param>
        /// <param name="serializationMode">Allows the caller to choose the depth of the serialization. See <see cref="Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="Authorization" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != (((object)this._principalId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonString(this._principalId.ToString()) : null, "principalId", container.Add);
            AddIf(null != (((object)this._principalIdDisplayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonString(this._principalIdDisplayName.ToString()) : null, "principalIdDisplayName", container.Add);
            AddIf(null != (((object)this._roleDefinitionId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonString(this._roleDefinitionId.ToString()) : null, "roleDefinitionId", container.Add);
            if (null != this._delegatedRoleDefinitionId)
            {
                var __w = new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.XNodeArray();
                foreach (var __x in this._delegatedRoleDefinitionId)
                {
                    AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonString(__x.ToString()) : null, __w.Add);
                }
                container.Add("delegatedRoleDefinitionIds", __w);
            }
            AfterToJson(ref container);
            return(container);
        }
示例#3
0
        /// <summary>
        /// Serializes this instance of <see cref="ErrorDefinition" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonObject"/> container to serialize this object into. If the caller
        /// passes in <c>null</c>, a new instance will be created and returned to the caller.</param>
        /// <param name="serializationMode">Allows the caller to choose the depth of the serialization. See <see cref="Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="ErrorDefinition" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != (((object)this._code)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonString(this._code.ToString()) : null, "code", container.Add);
            AddIf(null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonString(this._message.ToString()) : null, "message", container.Add);
            if (null != this._detail)
            {
                var __w = new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.XNodeArray();
                foreach (var __x in this._detail)
                {
                    AddIf(__x?.ToJson(null, serializationMode), __w.Add);
                }
                container.Add("details", __w);
            }
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="JustInTimeAccessPolicy" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonObject"/> container to serialize this object into. If the caller
        /// passes in <c>null</c>, a new instance will be created and returned to the caller.</param>
        /// <param name="serializationMode">Allows the caller to choose the depth of the serialization. See <see cref="Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="JustInTimeAccessPolicy" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != (((object)this._multiFactorAuthProvider)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonString(this._multiFactorAuthProvider.ToString()) : null, "multiFactorAuthProvider", container.Add);
            AddIf((Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode)(null != this._maximumActivationDuration ? new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonString(global::System.Xml.XmlConvert.ToString((global::System.TimeSpan) this._maximumActivationDuration)): null), "maximumActivationDuration", container.Add);
            if (null != this._managedByTenantApprover)
            {
                var __w = new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.XNodeArray();
                foreach (var __x in this._managedByTenantApprover)
                {
                    AddIf(__x?.ToJson(null, serializationMode), __w.Add);
                }
                container.Add("managedByTenantApprovers", __w);
            }
            AfterToJson(ref container);
            return(container);
        }
示例#5
0
        /// <summary>
        /// Serializes this instance of <see cref="RegistrationDefinitionProperties" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonObject"/> container to serialize this object into. If the caller
        /// passes in <c>null</c>, a new instance will be created and returned to the caller.</param>
        /// <param name="serializationMode">Allows the caller to choose the depth of the serialization. See <see cref="Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="RegistrationDefinitionProperties" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonString(this._description.ToString()) : null, "description", container.Add);
            if (null != this._authorization)
            {
                var __w = new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.XNodeArray();
                foreach (var __x in this._authorization)
                {
                    AddIf(__x?.ToJson(null, serializationMode), __w.Add);
                }
                container.Add("authorizations", __w);
            }
            if (null != this._eligibleAuthorization)
            {
                var __r = new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.XNodeArray();
                foreach (var __s in this._eligibleAuthorization)
                {
                    AddIf(__s?.ToJson(null, serializationMode), __r.Add);
                }
                container.Add("eligibleAuthorizations", __r);
            }
            AddIf(null != (((object)this._registrationDefinitionName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonString(this._registrationDefinitionName.ToString()) : null, "registrationDefinitionName", container.Add);
            AddIf(null != (((object)this._managedByTenantId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonString(this._managedByTenantId.ToString()) : null, "managedByTenantId", container.Add);
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._managedByTenantName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonString(this._managedByTenantName.ToString()) : null, "managedByTenantName", container.Add);
            }
            AfterToJson(ref container);
            return(container);
        }
示例#6
0
        /// <summary>
        /// Serializes this instance of <see cref="MarketplaceRegistrationDefinitionProperties" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode"
        /// />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonObject"/> container to serialize this object into. If the caller
        /// passes in <c>null</c>, a new instance will be created and returned to the caller.</param>
        /// <param name="serializationMode">Allows the caller to choose the depth of the serialization. See <see cref="Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="MarketplaceRegistrationDefinitionProperties" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode"
        /// />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != (((object)this._managedByTenantId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonString(this._managedByTenantId.ToString()) : null, "managedByTenantId", container.Add);
            if (null != this._authorization)
            {
                var __w = new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.XNodeArray();
                foreach (var __x in this._authorization)
                {
                    AddIf(__x?.ToJson(null, serializationMode), __w.Add);
                }
                container.Add("authorizations", __w);
            }
            if (null != this._eligibleAuthorization)
            {
                var __r = new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.XNodeArray();
                foreach (var __s in this._eligibleAuthorization)
                {
                    AddIf(__s?.ToJson(null, serializationMode), __r.Add);
                }
                container.Add("eligibleAuthorizations", __r);
            }
            AddIf(null != (((object)this._offerDisplayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonString(this._offerDisplayName.ToString()) : null, "offerDisplayName", container.Add);
            AddIf(null != (((object)this._publisherDisplayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonString(this._publisherDisplayName.ToString()) : null, "publisherDisplayName", container.Add);
            AddIf(null != (((object)this._planDisplayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonString(this._planDisplayName.ToString()) : null, "planDisplayName", container.Add);
            AfterToJson(ref container);
            return(container);
        }