/// <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);
        }
        /// <summary>
        /// Serializes this instance of <see cref="SystemData" /> 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="SystemData" /> 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._createdBy)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._createdBy.ToString()) : null, "createdBy", container.Add);
            AddIf(null != (((object)this._createdByType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._createdByType.ToString()) : null, "createdByType", container.Add);
            AddIf(null != this._createdAt ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._createdAt?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK", global::System.Globalization.CultureInfo.InvariantCulture)) : null, "createdAt", container.Add);
            AddIf(null != (((object)this._lastModifiedBy)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._lastModifiedBy.ToString()) : null, "lastModifiedBy", container.Add);
            AddIf(null != (((object)this._lastModifiedByType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._lastModifiedByType.ToString()) : null, "lastModifiedByType", container.Add);
            AddIf(null != this._lastModifiedAt ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._lastModifiedAt?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK", global::System.Globalization.CultureInfo.InvariantCulture)) : null, "lastModifiedAt", container.Add);
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="SharedPrivateLinkResourceProperties" /> 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="SharedPrivateLinkResourceProperties" /> 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);
            AddIf(null != (((object)this._privateLinkResourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._privateLinkResourceId.ToString()) : null, "privateLinkResourceId", 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);
            }
            AddIf(null != (((object)this._requestMessage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._requestMessage.ToString()) : null, "requestMessage", container.Add);
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._status.ToString()) : null, "status", container.Add);
            }
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="TrackedResource" /> 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="TrackedResource" /> 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);
            }
            __resource?.ToJson(container, serializationMode);
            AddIf(null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._location.ToString()) : null, "location", container.Add);
            AddIf(null != this._tag ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) this._tag.ToJson(null, serializationMode) : null, "tags", container.Add);
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="Operation" /> 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="Operation" /> 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._display ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) this._display.ToJson(null, serializationMode) : null, "display", container.Add);
            AddIf(null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) this._property.ToJson(null, serializationMode) : null, "properties", container.Add);
            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 != this._isDataAction ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonBoolean((bool)this._isDataAction) : null, "isDataAction", container.Add);
            AddIf(null != (((object)this._origin)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._origin.ToString()) : null, "origin", container.Add);
            AfterToJson(ref container);
            return(container);
        }
Esempio n. 6
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);
        }
        /// <summary>
        /// Serializes this instance of <see cref="WebPubSubIdentity" /> 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="WebPubSubIdentity" /> 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._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._location.ToString()) : null, "location", container.Add);
            AddIf(null != (((object)this._subscriptionId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._subscriptionId.ToString()) : null, "subscriptionId", container.Add);
            AddIf(null != (((object)this._resourceGroupName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._resourceGroupName.ToString()) : null, "resourceGroupName", container.Add);
            AddIf(null != (((object)this._resourceName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._resourceName.ToString()) : null, "resourceName", container.Add);
            AddIf(null != (((object)this._hubName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._hubName.ToString()) : null, "hubName", container.Add);
            AddIf(null != (((object)this._privateEndpointConnectionName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._privateEndpointConnectionName.ToString()) : null, "privateEndpointConnectionName", container.Add);
            AddIf(null != (((object)this._sharedPrivateLinkResourceName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._sharedPrivateLinkResourceName.ToString()) : null, "sharedPrivateLinkResourceName", container.Add);
            AddIf(null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._id.ToString()) : null, "id", container.Add);
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="ErrorResponse" /> 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="ErrorResponse" /> 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._error ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) this._error.ToJson(null, serializationMode) : null, "error", container.Add);
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="ResourceSku" /> 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="ResourceSku" /> 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._tier)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._tier.ToString()) : null, "tier", container.Add);
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._size)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._size.ToString()) : null, "size", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._family)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._family.ToString()) : null, "family", container.Add);
            }
            AddIf(null != this._capacity ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNumber((int)this._capacity) : null, "capacity", container.Add);
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="NameAvailability" /> 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="NameAvailability" /> 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._nameAvailable ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonBoolean((bool)this._nameAvailable) : null, "nameAvailable", container.Add);
            AddIf(null != (((object)this._reason)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._reason.ToString()) : null, "reason", container.Add);
            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);
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="WebPubSubHub" /> 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="WebPubSubHub" /> 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);
            }
            __resource?.ToJson(container, serializationMode);
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) this._systemData.ToJson(null, serializationMode) : null, "systemData", container.Add);
            }
            AddIf(null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) this._property.ToJson(null, serializationMode) : null, "properties", container.Add);
            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);
        }
Esempio n. 13
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);
        }
Esempio n. 15
0
        /// <summary>
        /// Serializes this instance of <see cref="TrackedResourceTags" /> 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="TrackedResourceTags" /> 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);
            }
            Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.JsonSerializable.ToJson(((Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.IAssociativeArray <string>) this).AdditionalProperties, container);
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="Dimension" /> 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="Dimension" /> 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._internalName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._internalName.ToString()) : null, "internalName", container.Add);
            AddIf(null != this._toBeExportedForShoebox ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonBoolean((bool)this._toBeExportedForShoebox) : null, "toBeExportedForShoebox", 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);
        }
Esempio n. 18
0
        /// <summary>
        /// Serializes this instance of <see cref="SignalRServiceUsage" /> 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="SignalRServiceUsage" /> 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._name ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) this._name.ToJson(null, serializationMode) : null, "name", container.Add);
            AddIf(null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._id.ToString()) : null, "id", container.Add);
            AddIf(null != this._currentValue ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNumber((long)this._currentValue) : null, "currentValue", container.Add);
            AddIf(null != this._limit ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNumber((long)this._limit) : null, "limit", 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);
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="WebPubSubTlsSettings" /> 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="WebPubSubTlsSettings" /> 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._clientCertEnabled ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonBoolean((bool)this._clientCertEnabled) : null, "clientCertEnabled", container.Add);
            AfterToJson(ref container);
            return(container);
        }
Esempio n. 20
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);
        }
Esempio n. 21
0
        /// <summary>
        /// Serializes this instance of <see cref="ManagedIdentity" /> 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="ManagedIdentity" /> 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._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._type.ToString()) : null, "type", container.Add);
            AddIf(null != this._userAssignedIdentity ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) this._userAssignedIdentity.ToJson(null, serializationMode) : null, "userAssignedIdentities", container.Add);
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._principalId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._principalId.ToString()) : null, "principalId", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._tenantId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._tenantId.ToString()) : null, "tenantId", container.Add);
            }
            AfterToJson(ref container);
            return(container);
        }
Esempio n. 22
0
        /// <summary>
        /// Serializes this instance of <see cref="Sku" /> 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="Sku" /> 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._sku1 ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) this._sku1.ToJson(null, serializationMode) : null, "sku", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._capacity ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) this._capacity.ToJson(null, serializationMode) : null, "capacity", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._resourceType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._resourceType.ToString()) : null, "resourceType", container.Add);
            }
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="OperationDisplay" /> 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="OperationDisplay" /> 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._provider)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._provider.ToString()) : null, "provider", container.Add);
            AddIf(null != (((object)this._resource)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._resource.ToString()) : null, "resource", container.Add);
            AddIf(null != (((object)this._operation)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._operation.ToString()) : null, "operation", container.Add);
            AddIf(null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._description.ToString()) : null, "description", container.Add);
            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);
        }
Esempio n. 26
0
        /// <summary>
        /// Serializes this instance of <see cref="Any" /> 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="Any" /> 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);
            }
            AfterToJson(ref container);
            return(container);
        }
Esempio n. 27
0
        /// <summary>
        /// Serializes this instance of <see cref="PrivateLinkResourceList" /> 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="PrivateLinkResourceList" /> 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._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);
            }
            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);
        }
Esempio n. 28
0
        /// <summary>
        /// Serializes this instance of <see cref="PrivateEndpointAcl" /> 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="PrivateEndpointAcl" /> 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);
            }
            __networkAcl?.ToJson(container, serializationMode);
            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);
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="WebPubSubKeys" /> 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="WebPubSubKeys" /> 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._primaryKey)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._primaryKey.ToString()) : null, "primaryKey", container.Add);
            AddIf(null != (((object)this._secondaryKey)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._secondaryKey.ToString()) : null, "secondaryKey", container.Add);
            AddIf(null != (((object)this._primaryConnectionString)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._primaryConnectionString.ToString()) : null, "primaryConnectionString", container.Add);
            AddIf(null != (((object)this._secondaryConnectionString)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._secondaryConnectionString.ToString()) : null, "secondaryConnectionString", container.Add);
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="PrivateLinkServiceConnectionState" /> 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="PrivateLinkServiceConnectionState" /> 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._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._status.ToString()) : null, "status", container.Add);
            AddIf(null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._description.ToString()) : null, "description", container.Add);
            AddIf(null != (((object)this._actionsRequired)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WebPubSub.Runtime.Json.JsonString(this._actionsRequired.ToString()) : null, "actionsRequired", container.Add);
            AfterToJson(ref container);
            return(container);
        }