예제 #1
0
        /// <summary>
        /// Serializes this instance of <see cref="MetricSpecification" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.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.WebPubSub.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="MetricSpecification" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._name.ToString()) : null, "name", container.Add);
            AddIf(null != (((object)this._displayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._displayName.ToString()) : null, "displayName", container.Add);
            AddIf(null != (((object)this._displayDescription)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._displayDescription.ToString()) : null, "displayDescription", container.Add);
            AddIf(null != (((object)this._unit)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._unit.ToString()) : null, "unit", container.Add);
            AddIf(null != (((object)this._aggregationType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._aggregationType.ToString()) : null, "aggregationType", container.Add);
            AddIf(null != (((object)this._fillGapWithZero)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._fillGapWithZero.ToString()) : null, "fillGapWithZero", container.Add);
            AddIf(null != (((object)this._category)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._category.ToString()) : null, "category", container.Add);
            if (null != this._dimension)
            {
                var __w = new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.XNodeArray();
                foreach (var __x in this._dimension)
                {
                    AddIf(__x?.ToJson(null, serializationMode), __w.Add);
                }
                container.Add("dimensions", __w);
            }
            AfterToJson(ref container);
            return(container);
        }
예제 #2
0
        /// <summary>
        /// Serializes this instance of <see cref="SkuList" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.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.WebPubSub.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="SkuList" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.SerializationMode.IncludeReadOnly))
            {
                if (null != this._value)
                {
                    var __w = new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.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.WebPubSub.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink", container.Add);
            }
            AfterToJson(ref container);
            return(container);
        }
예제 #3
0
        /// <summary>
        /// Serializes this instance of <see cref="ServiceSpecification" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.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.WebPubSub.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="ServiceSpecification" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (null != this._metricSpecification)
            {
                var __w = new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.XNodeArray();
                foreach (var __x in this._metricSpecification)
                {
                    AddIf(__x?.ToJson(null, serializationMode), __w.Add);
                }
                container.Add("metricSpecifications", __w);
            }
            if (null != this._logSpecification)
            {
                var __r = new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.XNodeArray();
                foreach (var __s in this._logSpecification)
                {
                    AddIf(__s?.ToJson(null, serializationMode), __r.Add);
                }
                container.Add("logSpecifications", __r);
            }
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="PrivateEndpointConnectionProperties" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode"
        /// />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.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.WebPubSub.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="PrivateEndpointConnectionProperties" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != this._privateEndpoint ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) this._privateEndpoint.ToJson(null, serializationMode) : null, "privateEndpoint", container.Add);
            AddIf(null != this._privateLinkServiceConnectionState ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) this._privateLinkServiceConnectionState.ToJson(null, serializationMode) : null, "privateLinkServiceConnectionState", container.Add);
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.SerializationMode.IncludeReadOnly))
            {
                if (null != this._groupId)
                {
                    var __w = new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.XNodeArray();
                    foreach (var __x in this._groupId)
                    {
                        AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(__x.ToString()) : null, __w.Add);
                    }
                    container.Add("groupIds", __w);
                }
            }
            AfterToJson(ref container);
            return(container);
        }
예제 #5
0
        /// <summary>
        /// Serializes this instance of <see cref="NetworkAcl" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.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.WebPubSub.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="NetworkAcl" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (null != this._allow)
            {
                var __w = new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.XNodeArray();
                foreach (var __x in this._allow)
                {
                    AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(__x.ToString()) : null, __w.Add);
                }
                container.Add("allow", __w);
            }
            if (null != this._deny)
            {
                var __r = new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.XNodeArray();
                foreach (var __s in this._deny)
                {
                    AddIf(null != (((object)__s)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(__s.ToString()) : null, __r.Add);
                }
                container.Add("deny", __r);
            }
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="EventHandler" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.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.WebPubSub.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="EventHandler" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != this._auth ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) this._auth.ToJson(null, serializationMode) : null, "auth", container.Add);
            AddIf(null != (((object)this._urlTemplate)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._urlTemplate.ToString()) : null, "urlTemplate", container.Add);
            AddIf(null != (((object)this._userEventPattern)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._userEventPattern.ToString()) : null, "userEventPattern", container.Add);
            if (null != this._systemEvent)
            {
                var __w = new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.XNodeArray();
                foreach (var __x in this._systemEvent)
                {
                    AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(__x.ToString()) : null, __w.Add);
                }
                container.Add("systemEvents", __w);
            }
            AfterToJson(ref container);
            return(container);
        }
예제 #7
0
        /// <summary>
        /// Serializes this instance of <see cref="WebPubSubNetworkAcLs" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.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.WebPubSub.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="WebPubSubNetworkAcLs" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != this._publicNetwork ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) this._publicNetwork.ToJson(null, serializationMode) : null, "publicNetwork", container.Add);
            AddIf(null != (((object)this._defaultAction)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._defaultAction.ToString()) : null, "defaultAction", container.Add);
            if (null != this._privateEndpoint)
            {
                var __w = new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.XNodeArray();
                foreach (var __x in this._privateEndpoint)
                {
                    AddIf(__x?.ToJson(null, serializationMode), __w.Add);
                }
                container.Add("privateEndpoints", __w);
            }
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="ErrorDetail" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.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.WebPubSub.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="ErrorDetail" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._code)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._code.ToString()) : null, "code", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._message.ToString()) : null, "message", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._target)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._target.ToString()) : null, "target", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.SerializationMode.IncludeReadOnly))
            {
                if (null != this._detail)
                {
                    var __w = new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.XNodeArray();
                    foreach (var __x in this._detail)
                    {
                        AddIf(__x?.ToJson(null, serializationMode), __w.Add);
                    }
                    container.Add("details", __w);
                }
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.SerializationMode.IncludeReadOnly))
            {
                if (null != this._additionalInfo)
                {
                    var __r = new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.XNodeArray();
                    foreach (var __s in this._additionalInfo)
                    {
                        AddIf(__s?.ToJson(null, serializationMode), __r.Add);
                    }
                    container.Add("additionalInfo", __r);
                }
            }
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="SkuCapacity" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.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.WebPubSub.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="SkuCapacity" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._minimum ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNumber((int)this._minimum) : null, "minimum", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._maximum ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNumber((int)this._maximum) : null, "maximum", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._default ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNumber((int)this._default) : null, "default", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.SerializationMode.IncludeReadOnly))
            {
                if (null != this._allowedValue)
                {
                    var __w = new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.XNodeArray();
                    foreach (var __x in this._allowedValue)
                    {
                        AddIf((Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNumber(__x), __w.Add);
                    }
                    container.Add("allowedValues", __w);
                }
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._scaleType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._scaleType.ToString()) : null, "scaleType", container.Add);
            }
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="PrivateLinkResourceProperties" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.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.WebPubSub.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="PrivateLinkResourceProperties" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != (((object)this._groupId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._groupId.ToString()) : null, "groupId", container.Add);
            if (null != this._requiredMember)
            {
                var __w = new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.XNodeArray();
                foreach (var __x in this._requiredMember)
                {
                    AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(__x.ToString()) : null, __w.Add);
                }
                container.Add("requiredMembers", __w);
            }
            if (null != this._requiredZoneName)
            {
                var __r = new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.XNodeArray();
                foreach (var __s in this._requiredZoneName)
                {
                    AddIf(null != (((object)__s)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(__s.ToString()) : null, __r.Add);
                }
                container.Add("requiredZoneNames", __r);
            }
            if (null != this._shareablePrivateLinkResourceType)
            {
                var __m = new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.XNodeArray();
                foreach (var __n in this._shareablePrivateLinkResourceType)
                {
                    AddIf(__n?.ToJson(null, serializationMode), __m.Add);
                }
                container.Add("shareablePrivateLinkResourceTypes", __m);
            }
            AfterToJson(ref container);
            return(container);
        }
예제 #11
0
        /// <summary>
        /// Serializes this instance of <see cref="WebPubSubHubProperties" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.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.WebPubSub.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="WebPubSubHubProperties" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (null != this._eventHandler)
            {
                var __w = new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.XNodeArray();
                foreach (var __x in this._eventHandler)
                {
                    AddIf(__x?.ToJson(null, serializationMode), __w.Add);
                }
                container.Add("eventHandlers", __w);
            }
            AddIf(null != (((object)this._anonymousConnectPolicy)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._anonymousConnectPolicy.ToString()) : null, "anonymousConnectPolicy", container.Add);
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="LiveTraceConfiguration" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.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.WebPubSub.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="LiveTraceConfiguration" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != (((object)this._enabled)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._enabled.ToString()) : null, "enabled", container.Add);
            if (null != this._category)
            {
                var __w = new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.XNodeArray();
                foreach (var __x in this._category)
                {
                    AddIf(__x?.ToJson(null, serializationMode), __w.Add);
                }
                container.Add("categories", __w);
            }
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="WebPubSubProperties" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.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.WebPubSub.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="WebPubSubProperties" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != this._tl ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) this._tl.ToJson(null, serializationMode) : null, "tls", container.Add);
            AddIf(null != this._liveTraceConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) this._liveTraceConfiguration.ToJson(null, serializationMode) : null, "liveTraceConfiguration", container.Add);
            AddIf(null != this._resourceLogConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) this._resourceLogConfiguration.ToJson(null, serializationMode) : null, "resourceLogConfiguration", container.Add);
            AddIf(null != this._networkAcL ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) this._networkAcL.ToJson(null, serializationMode) : null, "networkACLs", container.Add);
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._externalIP)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._externalIP.ToString()) : null, "externalIP", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._hostName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._hostName.ToString()) : null, "hostName", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._publicPort ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNumber((int)this._publicPort) : null, "publicPort", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._serverPort ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNumber((int)this._serverPort) : null, "serverPort", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._version)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._version.ToString()) : null, "version", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.SerializationMode.IncludeReadOnly))
            {
                if (null != this._privateEndpointConnection)
                {
                    var __w = new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.XNodeArray();
                    foreach (var __x in this._privateEndpointConnection)
                    {
                        AddIf(__x?.ToJson(null, serializationMode), __w.Add);
                    }
                    container.Add("privateEndpointConnections", __w);
                }
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.SerializationMode.IncludeReadOnly))
            {
                if (null != this._sharedPrivateLinkResource)
                {
                    var __r = new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.XNodeArray();
                    foreach (var __s in this._sharedPrivateLinkResource)
                    {
                        AddIf(__s?.ToJson(null, serializationMode), __r.Add);
                    }
                    container.Add("sharedPrivateLinkResources", __r);
                }
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._hostNamePrefix)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._hostNamePrefix.ToString()) : null, "hostNamePrefix", container.Add);
            }
            AddIf(null != (((object)this._publicNetworkAccess)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._publicNetworkAccess.ToString()) : null, "publicNetworkAccess", container.Add);
            AddIf(null != this._disableLocalAuth ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonBoolean((bool)this._disableLocalAuth) : null, "disableLocalAuth", container.Add);
            AddIf(null != this._disableAadAuth ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonBoolean((bool)this._disableAadAuth) : null, "disableAadAuth", container.Add);
            AfterToJson(ref container);
            return(container);
        }