コード例 #1
0
        /// <summary>
        /// Serializes this instance of <see cref="LocationResource" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Communication.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.Communication.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.Communication.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="LocationResource" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Communication.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.Communication.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Communication.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Communication.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Communication.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.Communication.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Communication.Runtime.Json.JsonString(this._location.ToString()) : null, "location", container.Add);
            AfterToJson(ref container);
            return(container);
        }
コード例 #2
0
        /// <summary>
        /// Serializes this instance of <see cref="SystemData" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Communication.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.Communication.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.Communication.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="SystemData" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Communication.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.Communication.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Communication.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Communication.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Communication.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.Communication.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Communication.Runtime.Json.JsonString(this._createdBy.ToString()) : null, "createdBy", container.Add);
            AddIf(null != (((object)this._createdByType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Communication.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Communication.Runtime.Json.JsonString(this._createdByType.ToString()) : null, "createdByType", container.Add);
            AddIf(null != this._createdAt ? (Microsoft.Azure.PowerShell.Cmdlets.Communication.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Communication.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.Communication.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Communication.Runtime.Json.JsonString(this._lastModifiedBy.ToString()) : null, "lastModifiedBy", container.Add);
            AddIf(null != (((object)this._lastModifiedByType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Communication.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Communication.Runtime.Json.JsonString(this._lastModifiedByType.ToString()) : null, "lastModifiedByType", container.Add);
            AddIf(null != this._lastModifiedAt ? (Microsoft.Azure.PowerShell.Cmdlets.Communication.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Communication.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);
        }
コード例 #3
0
        /// <summary>
        /// Serializes this instance of <see cref="ErrorResponse" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Communication.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.Communication.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.Communication.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="ErrorResponse" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Communication.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.Communication.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Communication.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Communication.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Communication.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != this._error ? (Microsoft.Azure.PowerShell.Cmdlets.Communication.Runtime.Json.JsonNode) this._error.ToJson(null, serializationMode) : null, "error", container.Add);
            AfterToJson(ref container);
            return(container);
        }
コード例 #4
0
        /// <summary>
        /// Serializes this instance of <see cref="NameAvailability" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Communication.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.Communication.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.Communication.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="NameAvailability" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Communication.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.Communication.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Communication.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Communication.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Communication.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != this._nameAvailable ? (Microsoft.Azure.PowerShell.Cmdlets.Communication.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Communication.Runtime.Json.JsonBoolean((bool)this._nameAvailable) : null, "nameAvailable", container.Add);
            AddIf(null != (((object)this._reason)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Communication.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Communication.Runtime.Json.JsonString(this._reason.ToString()) : null, "reason", container.Add);
            AddIf(null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Communication.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Communication.Runtime.Json.JsonString(this._message.ToString()) : null, "message", container.Add);
            AfterToJson(ref container);
            return(container);
        }
コード例 #5
0
        /// <summary>
        /// Serializes this instance of <see cref="ServiceSpecification" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Communication.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.Communication.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.Communication.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="ServiceSpecification" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Communication.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.Communication.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Communication.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Communication.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Communication.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.Communication.Runtime.Json.XNodeArray();
                foreach (var __x in this._metricSpecification)
                {
                    AddIf(__x?.ToJson(null, serializationMode), __w.Add);
                }
                container.Add("metricSpecifications", __w);
            }
            AfterToJson(ref container);
            return(container);
        }
コード例 #6
0
        /// <summary>
        /// Serializes this instance of <see cref="Resource" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Communication.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.Communication.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.Communication.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="Resource" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Communication.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.Communication.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Communication.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Communication.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Communication.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Communication.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Communication.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Communication.Runtime.Json.JsonString(this._id.ToString()) : null, "id", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Communication.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Communication.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Communication.Runtime.Json.JsonString(this._name.ToString()) : null, "name", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Communication.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Communication.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Communication.Runtime.Json.JsonString(this._type.ToString()) : null, "type", container.Add);
            }
            AfterToJson(ref container);
            return(container);
        }