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

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (null != this._dnsResolverOutboundEndpoint)
            {
                var __w = new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.XNodeArray();
                foreach (var __x in this._dnsResolverOutboundEndpoint)
                {
                    AddIf(__x?.ToJson(null, serializationMode), __w.Add);
                }
                container.Add("dnsResolverOutboundEndpoints", __w);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._resourceGuid)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonString(this._resourceGuid.ToString()) : null, "resourceGuid", container.Add);
            }
            AfterToJson(ref container);
            return(container);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Serializes this instance of <see cref="Resource" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.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.DnsResolver.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="Resource" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonString(this._id.ToString()) : null, "id", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonString(this._name.ToString()) : null, "name", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonString(this._type.ToString()) : null, "type", container.Add);
            }
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="DnsResolverProperties" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.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.DnsResolver.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="DnsResolverProperties" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != this._virtualNetwork ? (Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode) this._virtualNetwork.ToJson(null, serializationMode) : null, "virtualNetwork", container.Add);
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._dnsResolverState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonString(this._dnsResolverState.ToString()) : null, "dnsResolverState", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._resourceGuid)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonString(this._resourceGuid.ToString()) : null, "resourceGuid", container.Add);
            }
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="ForwardingRuleProperties" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.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.DnsResolver.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="ForwardingRuleProperties" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != (((object)this._domainName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonString(this._domainName.ToString()) : null, "domainName", container.Add);
            if (null != this._targetDnsServer)
            {
                var __w = new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.XNodeArray();
                foreach (var __x in this._targetDnsServer)
                {
                    AddIf(__x?.ToJson(null, serializationMode), __w.Add);
                }
                container.Add("targetDnsServers", __w);
            }
            AddIf(null != this._metadata ? (Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode) this._metadata.ToJson(null, serializationMode) : null, "metadata", container.Add);
            AddIf(null != (((object)this._forwardingRuleState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonString(this._forwardingRuleState.ToString()) : null, "forwardingRuleState", container.Add);
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState", container.Add);
            }
            AfterToJson(ref container);
            return(container);
        }
Exemplo n.º 5
0
        /// <summary>
        /// Serializes this instance of <see cref="DnsResolverListResult" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.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.DnsResolver.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="DnsResolverListResult" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.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.DnsResolver.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.DnsResolver.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink", container.Add);
            }
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="DnsForwardingRuleset" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.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.DnsResolver.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="DnsForwardingRuleset" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            __trackedResource?.ToJson(container, serializationMode);
            AddIf(null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode) this._property.ToJson(null, serializationMode) : null, "properties", container.Add);
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode) this._systemData.ToJson(null, serializationMode) : null, "systemData", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._etag)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonString(this._etag.ToString()) : null, "etag", container.Add);
            }
            AfterToJson(ref container);
            return(container);
        }