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

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != this._scale ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) this._scale.ToJson(null, serializationMode) : null, "scale", container.Add);
            AddIf(null != (((object)this._revisionSuffix)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonString(this._revisionSuffix.ToString()) : null, "revisionSuffix", container.Add);
            if (null != this._container)
            {
                var __w = new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.XNodeArray();
                foreach (var __x in this._container)
                {
                    AddIf(__x?.ToJson(null, serializationMode), __w.Add);
                }
                container.Add("containers", __w);
            }
            if (null != this._volume)
            {
                var __r = new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.XNodeArray();
                foreach (var __s in this._volume)
                {
                    AddIf(__s?.ToJson(null, serializationMode), __r.Add);
                }
                container.Add("volumes", __r);
            }
            AfterToJson(ref container);
            return(container);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Serializes this instance of <see cref="Configuration" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.App.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.App.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="Configuration" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != this._ingress ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) this._ingress.ToJson(null, serializationMode) : null, "ingress", container.Add);
            AddIf(null != this._dapr ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) this._dapr.ToJson(null, serializationMode) : null, "dapr", container.Add);
            if (null != this._secret)
            {
                var __w = new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.XNodeArray();
                foreach (var __x in this._secret)
                {
                    AddIf(__x?.ToJson(null, serializationMode), __w.Add);
                }
                container.Add("secrets", __w);
            }
            AddIf(null != (((object)this._activeRevisionsMode)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonString(this._activeRevisionsMode.ToString()) : null, "activeRevisionsMode", container.Add);
            if (null != this._registry)
            {
                var __r = new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.XNodeArray();
                foreach (var __s in this._registry)
                {
                    AddIf(__s?.ToJson(null, serializationMode), __r.Add);
                }
                container.Add("registries", __r);
            }
            AfterToJson(ref container);
            return(container);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Serializes this instance of <see cref="JwtClaimChecks" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.App.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.App.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="JwtClaimChecks" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonObject();

            bool returnNow = false;

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

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != (((object)this._host)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonString(this._host.ToString()) : null, "host", container.Add);
            if (null != this._httpHeader)
            {
                var __w = new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.XNodeArray();
                foreach (var __x in this._httpHeader)
                {
                    AddIf(__x?.ToJson(null, serializationMode), __w.Add);
                }
                container.Add("httpHeaders", __w);
            }
            AddIf(null != (((object)this._path)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonString(this._path.ToString()) : null, "path", container.Add);
            AddIf((Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNumber(this._port), "port", container.Add);
            AddIf(null != (((object)this._scheme)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonString(this._scheme.ToString()) : null, "scheme", container.Add);
            AfterToJson(ref container);
            return(container);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Serializes this instance of <see cref="Login" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.App.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.App.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="Login" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != this._route ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) this._route.ToJson(null, serializationMode) : null, "routes", container.Add);
            AddIf(null != this._cookieExpiration ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) this._cookieExpiration.ToJson(null, serializationMode) : null, "cookieExpiration", container.Add);
            AddIf(null != this._nonce ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) this._nonce.ToJson(null, serializationMode) : null, "nonce", container.Add);
            AddIf(null != this._preserveUrlFragmentsForLogin ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonBoolean((bool)this._preserveUrlFragmentsForLogin) : null, "preserveUrlFragmentsForLogins", container.Add);
            if (null != this._allowedExternalRedirectUrl)
            {
                var __w = new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.XNodeArray();
                foreach (var __x in this._allowedExternalRedirectUrl)
                {
                    AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonString(__x.ToString()) : null, __w.Add);
                }
                container.Add("allowedExternalRedirectUrls", __w);
            }
            AfterToJson(ref container);
            return(container);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Serializes this instance of <see cref="AzureActiveDirectoryValidation" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.App.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.App.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="AzureActiveDirectoryValidation" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != this._jwtClaimCheck ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) this._jwtClaimCheck.ToJson(null, serializationMode) : null, "jwtClaimChecks", container.Add);
            AddIf(null != this._defaultAuthorizationPolicy ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) this._defaultAuthorizationPolicy.ToJson(null, serializationMode) : null, "defaultAuthorizationPolicy", container.Add);
            if (null != this._allowedAudience)
            {
                var __w = new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.XNodeArray();
                foreach (var __x in this._allowedAudience)
                {
                    AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonString(__x.ToString()) : null, __w.Add);
                }
                container.Add("allowedAudiences", __w);
            }
            AfterToJson(ref container);
            return(container);
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Serializes this instance of <see cref="Scale" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.App.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.App.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="Scale" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != this._minReplica ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNumber((int)this._minReplica) : null, "minReplicas", container.Add);
            AddIf(null != this._maxReplica ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNumber((int)this._maxReplica) : null, "maxReplicas", container.Add);
            if (null != this._rule)
            {
                var __w = new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.XNodeArray();
                foreach (var __x in this._rule)
                {
                    AddIf(__x?.ToJson(null, serializationMode), __w.Add);
                }
                container.Add("rules", __w);
            }
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="GlobalValidation" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.App.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.App.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="GlobalValidation" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != (((object)this._unauthenticatedClientAction)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonString(this._unauthenticatedClientAction.ToString()) : null, "unauthenticatedClientAction", container.Add);
            AddIf(null != (((object)this._redirectToProvider)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonString(this._redirectToProvider.ToString()) : null, "redirectToProvider", container.Add);
            if (null != this._excludedPath)
            {
                var __w = new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.XNodeArray();
                foreach (var __x in this._excludedPath)
                {
                    AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonString(__x.ToString()) : null, __w.Add);
                }
                container.Add("excludedPaths", __w);
            }
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="AuthConfigCollection" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.App.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.App.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="AuthConfigCollection" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.App.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.App.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.App.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink", container.Add);
            }
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="ReplicaProperties" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.App.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.App.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="ReplicaProperties" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._createdTime ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonString(this._createdTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK", global::System.Globalization.CultureInfo.InvariantCulture)) : null, "createdTime", container.Add);
            }
            if (null != this._container)
            {
                var __w = new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.XNodeArray();
                foreach (var __x in this._container)
                {
                    AddIf(__x?.ToJson(null, serializationMode), __w.Add);
                }
                container.Add("containers", __w);
            }
            AfterToJson(ref container);
            return(container);
        }
Ejemplo n.º 11
0
        /// <summary>
        /// Serializes this instance of <see cref="QueueScaleRule" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.App.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.App.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="QueueScaleRule" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != (((object)this._queueName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonString(this._queueName.ToString()) : null, "queueName", container.Add);
            AddIf(null != this._queueLength ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNumber((int)this._queueLength) : null, "queueLength", container.Add);
            if (null != this._auth)
            {
                var __w = new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.XNodeArray();
                foreach (var __x in this._auth)
                {
                    AddIf(__x?.ToJson(null, serializationMode), __w.Add);
                }
                container.Add("auth", __w);
            }
            AfterToJson(ref container);
            return(container);
        }
Ejemplo n.º 12
0
        /// <summary>
        /// Serializes this instance of <see cref="DaprComponentProperties" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.App.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.App.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="DaprComponentProperties" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != (((object)this._componentType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonString(this._componentType.ToString()) : null, "componentType", container.Add);
            AddIf(null != (((object)this._version)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonString(this._version.ToString()) : null, "version", container.Add);
            AddIf(null != this._ignoreError ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonBoolean((bool)this._ignoreError) : null, "ignoreErrors", container.Add);
            AddIf(null != (((object)this._initTimeout)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonString(this._initTimeout.ToString()) : null, "initTimeout", container.Add);
            if (null != this._secret)
            {
                var __w = new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.XNodeArray();
                foreach (var __x in this._secret)
                {
                    AddIf(__x?.ToJson(null, serializationMode), __w.Add);
                }
                container.Add("secrets", __w);
            }
            if (null != this._metadata)
            {
                var __r = new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.XNodeArray();
                foreach (var __s in this._metadata)
                {
                    AddIf(__s?.ToJson(null, serializationMode), __r.Add);
                }
                container.Add("metadata", __r);
            }
            if (null != this._scope)
            {
                var __m = new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.XNodeArray();
                foreach (var __n in this._scope)
                {
                    AddIf(null != (((object)__n)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonString(__n.ToString()) : null, __m.Add);
                }
                container.Add("scopes", __m);
            }
            AfterToJson(ref container);
            return(container);
        }
Ejemplo n.º 13
0
        /// <summary>
        /// Serializes this instance of <see cref="Ingress" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.App.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.App.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="Ingress" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._fqdn)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonString(this._fqdn.ToString()) : null, "fqdn", container.Add);
            }
            AddIf(null != this._external ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonBoolean((bool)this._external) : null, "external", container.Add);
            AddIf(null != this._targetPort ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNumber((int)this._targetPort) : null, "targetPort", container.Add);
            AddIf(null != (((object)this._transport)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonString(this._transport.ToString()) : null, "transport", container.Add);
            if (null != this._traffic)
            {
                var __w = new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.XNodeArray();
                foreach (var __x in this._traffic)
                {
                    AddIf(__x?.ToJson(null, serializationMode), __w.Add);
                }
                container.Add("traffic", __w);
            }
            if (null != this._customDomain)
            {
                var __r = new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.XNodeArray();
                foreach (var __s in this._customDomain)
                {
                    AddIf(__s?.ToJson(null, serializationMode), __r.Add);
                }
                container.Add("customDomains", __r);
            }
            AddIf(null != this._allowInsecure ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonBoolean((bool)this._allowInsecure) : null, "allowInsecure", container.Add);
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="ContainerAppProperties" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.App.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.App.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="ContainerAppProperties" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != this._configuration ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) this._configuration.ToJson(null, serializationMode) : null, "configuration", container.Add);
            AddIf(null != this._template ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) this._template.ToJson(null, serializationMode) : null, "template", container.Add);
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState", container.Add);
            }
            AddIf(null != (((object)this._managedEnvironmentId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonString(this._managedEnvironmentId.ToString()) : null, "managedEnvironmentId", container.Add);
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._latestRevisionName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonString(this._latestRevisionName.ToString()) : null, "latestRevisionName", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._latestRevisionFqdn)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonString(this._latestRevisionFqdn.ToString()) : null, "latestRevisionFqdn", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._customDomainVerificationId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonString(this._customDomainVerificationId.ToString()) : null, "customDomainVerificationId", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.SerializationMode.IncludeReadOnly))
            {
                if (null != this._outboundIPAddress)
                {
                    var __w = new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.XNodeArray();
                    foreach (var __x in this._outboundIPAddress)
                    {
                        AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonString(__x.ToString()) : null, __w.Add);
                    }
                    container.Add("outboundIPAddresses", __w);
                }
            }
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="DefaultErrorResponseError" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.App.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.App.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="DefaultErrorResponseError" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._code)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonString(this._code.ToString()) : null, "code", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonString(this._message.ToString()) : null, "message", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._target)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonString(this._target.ToString()) : null, "target", container.Add);
            }
            if (null != this._detail)
            {
                var __w = new Microsoft.Azure.PowerShell.Cmdlets.App.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.App.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._innererror)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonString(this._innererror.ToString()) : null, "innererror", container.Add);
            }
            AfterToJson(ref container);
            return(container);
        }
Ejemplo n.º 16
0
        /// <summary>
        /// Serializes this instance of <see cref="SecretsCollection" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.App.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.App.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="SecretsCollection" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.App.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.App.Runtime.Json.XNodeArray();
                foreach (var __x in this._value)
                {
                    AddIf(__x?.ToJson(null, serializationMode), __w.Add);
                }
                container.Add("value", __w);
            }
            AfterToJson(ref container);
            return(container);
        }
Ejemplo n.º 17
0
        /// <summary>
        /// Serializes this instance of <see cref="AzureActiveDirectoryLogin" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.App.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.App.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="AzureActiveDirectoryLogin" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (null != this._loginParameter)
            {
                var __w = new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.XNodeArray();
                foreach (var __x in this._loginParameter)
                {
                    AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonString(__x.ToString()) : null, __w.Add);
                }
                container.Add("loginParameters", __w);
            }
            AddIf(null != this._disableWwwAuthenticate ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonBoolean((bool)this._disableWwwAuthenticate) : null, "disableWWWAuthenticate", container.Add);
            AfterToJson(ref container);
            return(container);
        }
Ejemplo n.º 18
0
        /// <summary>
        /// Serializes this instance of <see cref="OpenIdConnectLogin" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.App.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.App.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="OpenIdConnectLogin" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonObject();

            bool returnNow = false;

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

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != this._resource ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) this._resource.ToJson(null, serializationMode) : null, "resources", container.Add);
            AddIf(null != (((object)this._image)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonString(this._image.ToString()) : null, "image", container.Add);
            AddIf(null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonString(this._name.ToString()) : null, "name", container.Add);
            if (null != this._command)
            {
                var __w = new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.XNodeArray();
                foreach (var __x in this._command)
                {
                    AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonString(__x.ToString()) : null, __w.Add);
                }
                container.Add("command", __w);
            }
            if (null != this._arg)
            {
                var __r = new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.XNodeArray();
                foreach (var __s in this._arg)
                {
                    AddIf(null != (((object)__s)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonString(__s.ToString()) : null, __r.Add);
                }
                container.Add("args", __r);
            }
            if (null != this._env)
            {
                var __m = new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.XNodeArray();
                foreach (var __n in this._env)
                {
                    AddIf(__n?.ToJson(null, serializationMode), __m.Add);
                }
                container.Add("env", __m);
            }
            if (null != this._probe)
            {
                var __h = new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.XNodeArray();
                foreach (var __i in this._probe)
                {
                    AddIf(__i?.ToJson(null, serializationMode), __h.Add);
                }
                container.Add("probes", __h);
            }
            if (null != this._volumeMount)
            {
                var __c = new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.XNodeArray();
                foreach (var __d in this._volumeMount)
                {
                    AddIf(__d?.ToJson(null, serializationMode), __c.Add);
                }
                container.Add("volumeMounts", __c);
            }
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="CertificateProperties" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.App.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.App.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="CertificateProperties" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState", container.Add);
            }
            AddIf(null != (((object)this._password)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonString(System.Runtime.InteropServices.Marshal.PtrToStringBSTR(System.Runtime.InteropServices.Marshal.SecureStringToBSTR(this._password))) : null, "password", container.Add);
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._subjectName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonString(this._subjectName.ToString()) : null, "subjectName", container.Add);
            }
            AddIf(null != this._value ? global::System.Convert.ToBase64String(this._value) : null, (v) => container.Add("value", v));
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._issuer)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonString(this._issuer.ToString()) : null, "issuer", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._issueDate ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonString(this._issueDate?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK", global::System.Globalization.CultureInfo.InvariantCulture)) : null, "issueDate", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._expirationDate ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonString(this._expirationDate?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK", global::System.Globalization.CultureInfo.InvariantCulture)) : null, "expirationDate", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._thumbprint)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonString(this._thumbprint.ToString()) : null, "thumbprint", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._valid ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonBoolean((bool)this._valid) : null, "valid", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._publicKeyHash)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonString(this._publicKeyHash.ToString()) : null, "publicKeyHash", container.Add);
            }
            AfterToJson(ref container);
            return(container);
        }
Ejemplo n.º 21
0
        /// <summary>
        /// Serializes this instance of <see cref="CustomHostnameAnalysisResultProperties" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode"
        /// />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.App.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.App.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="CustomHostnameAnalysisResultProperties" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._customDomainVerificationFailureInfo ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) this._customDomainVerificationFailureInfo.ToJson(null, serializationMode) : null, "customDomainVerificationFailureInfo", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._hostName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonString(this._hostName.ToString()) : null, "hostName", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._isHostnameAlreadyVerified ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonBoolean((bool)this._isHostnameAlreadyVerified) : null, "isHostnameAlreadyVerified", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._customDomainVerificationTest)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonString(this._customDomainVerificationTest.ToString()) : null, "customDomainVerificationTest", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._hasConflictOnManagedEnvironment ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonBoolean((bool)this._hasConflictOnManagedEnvironment) : null, "hasConflictOnManagedEnvironment", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._conflictingContainerAppResourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonString(this._conflictingContainerAppResourceId.ToString()) : null, "conflictingContainerAppResourceId", container.Add);
            }
            if (null != this._cNameRecord)
            {
                var __w = new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.XNodeArray();
                foreach (var __x in this._cNameRecord)
                {
                    AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonString(__x.ToString()) : null, __w.Add);
                }
                container.Add("cNameRecords", __w);
            }
            if (null != this._txtRecord)
            {
                var __r = new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.XNodeArray();
                foreach (var __s in this._txtRecord)
                {
                    AddIf(null != (((object)__s)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonString(__s.ToString()) : null, __r.Add);
                }
                container.Add("txtRecords", __r);
            }
            if (null != this._aRecord)
            {
                var __m = new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.XNodeArray();
                foreach (var __n in this._aRecord)
                {
                    AddIf(null != (((object)__n)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonString(__n.ToString()) : null, __m.Add);
                }
                container.Add("aRecords", __m);
            }
            if (null != this._alternateCNameRecord)
            {
                var __h = new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.XNodeArray();
                foreach (var __i in this._alternateCNameRecord)
                {
                    AddIf(null != (((object)__i)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonString(__i.ToString()) : null, __h.Add);
                }
                container.Add("alternateCNameRecords", __h);
            }
            if (null != this._alternateTxtRecord)
            {
                var __c = new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.XNodeArray();
                foreach (var __d in this._alternateTxtRecord)
                {
                    AddIf(null != (((object)__d)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.Json.JsonString(__d.ToString()) : null, __c.Add);
                }
                container.Add("alternateTxtRecords", __c);
            }
            AfterToJson(ref container);
            return(container);
        }