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

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            __commonProperties?.ToJson(container, serializationMode);
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._dimension ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) this._dimension.ToJson(null, serializationMode) : null, "dimensions", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                if (null != this._specification)
                {
                    var __w = new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.XNodeArray();
                    foreach (var __x in this._specification)
                    {
                        AddIf(__x?.ToJson(null, serializationMode), __w.Add);
                    }
                    container.Add("specifications", __w);
                }
            }
            AfterToJson(ref container);
            return(container);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Serializes this instance of <see cref="AvailabilityInformation" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.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.EdgeOrder.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="AvailabilityInformation" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonObject();

            bool returnNow = false;

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

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._sasKeyForLabel)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonString(this._sasKeyForLabel.ToString()) : null, "sasKeyForLabel", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._carrierName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonString(this._carrierName.ToString()) : null, "carrierName", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._carrierDisplayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonString(this._carrierDisplayName.ToString()) : null, "carrierDisplayName", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._trackingId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonString(this._trackingId.ToString()) : null, "trackingId", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._trackingUrl)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonString(this._trackingUrl.ToString()) : null, "trackingUrl", container.Add);
            }
            AfterToJson(ref container);
            return(container);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Serializes this instance of <see cref="DeviceDetails" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.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.EdgeOrder.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="DeviceDetails" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._serialNumber)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonString(this._serialNumber.ToString()) : null, "serialNumber", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._managementResourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonString(this._managementResourceId.ToString()) : null, "managementResourceId", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._managementResourceTenantId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonString(this._managementResourceTenantId.ToString()) : null, "managementResourceTenantId", container.Add);
            }
            AfterToJson(ref container);
            return(container);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Serializes this instance of <see cref="OperationDisplay" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.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.EdgeOrder.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="OperationDisplay" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._provider)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonString(this._provider.ToString()) : null, "provider", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._resource)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonString(this._resource.ToString()) : null, "resource", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._operation)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonString(this._operation.ToString()) : null, "operation", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonString(this._description.ToString()) : null, "description", container.Add);
            }
            AfterToJson(ref container);
            return(container);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Serializes this instance of <see cref="Operation" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.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.EdgeOrder.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="Operation" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != this._display ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) this._display.ToJson(null, serializationMode) : null, "display", container.Add);
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonString(this._name.ToString()) : null, "name", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._isDataAction ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonBoolean((bool)this._isDataAction) : null, "isDataAction", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._origin)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonString(this._origin.ToString()) : null, "origin", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._actionType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonString(this._actionType.ToString()) : null, "actionType", container.Add);
            }
            AfterToJson(ref container);
            return(container);
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Serializes this instance of <see cref="ProductFamiliesMetadata" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.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.EdgeOrder.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="ProductFamiliesMetadata" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonObject();

            bool returnNow = false;

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

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._stageStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonString(this._stageStatus.ToString()) : null, "stageStatus", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._stageName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonString(this._stageName.ToString()) : null, "stageName", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._displayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonString(this._displayName.ToString()) : null, "displayName", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._startTime ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonString(this._startTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK", global::System.Globalization.CultureInfo.InvariantCulture)) : null, "startTime", container.Add);
            }
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="PurchaseMeterDetails" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.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.EdgeOrder.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="PurchaseMeterDetails" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            __meterDetails?.ToJson(container, serializationMode);
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._productId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonString(this._productId.ToString()) : null, "productId", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._skuId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonString(this._skuId.ToString()) : null, "skuId", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._termId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonString(this._termId.ToString()) : null, "termId", container.Add);
            }
            AfterToJson(ref container);
            return(container);
        }
Ejemplo n.º 10
0
        /// <summary>
        /// Serializes this instance of <see cref="BillingMeterDetails" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.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.EdgeOrder.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="BillingMeterDetails" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._meterDetail ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) this._meterDetail.ToJson(null, serializationMode) : null, "meterDetails", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonString(this._name.ToString()) : null, "name", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._meteringType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonString(this._meteringType.ToString()) : null, "meteringType", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._frequency)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonString(this._frequency.ToString()) : null, "frequency", container.Add);
            }
            AfterToJson(ref container);
            return(container);
        }
Ejemplo n.º 11
0
        /// <summary>
        /// Serializes this instance of <see cref="ErrorDetail" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.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.EdgeOrder.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="ErrorDetail" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonObject();

            bool returnNow = false;

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

            bool returnNow = false;

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

            bool returnNow = false;

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

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._productFamilyDisplayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonString(this._productFamilyDisplayName.ToString()) : null, "productFamilyDisplayName", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._configurationDisplayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonString(this._configurationDisplayName.ToString()) : null, "configurationDisplayName", container.Add);
            }
            AfterToJson(ref container);
            return(container);
        }
Ejemplo n.º 15
0
        /// <summary>
        /// Serializes this instance of <see cref="MeterDetails" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.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.EdgeOrder.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="MeterDetails" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != (((object)this._billingType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonString(this._billingType.ToString()) : null, "billingType", container.Add);
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._multiplier ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNumber((double)this._multiplier) : null, "multiplier", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._chargingType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonString(this._chargingType.ToString()) : null, "chargingType", container.Add);
            }
            AfterToJson(ref container);
            return(container);
        }
Ejemplo n.º 16
0
        /// <summary>
        /// Serializes this instance of <see cref="ProductDetails" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.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.EdgeOrder.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="ProductDetails" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != this._displayInfo ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) this._displayInfo.ToJson(null, serializationMode) : null, "displayInfo", container.Add);
            AddIf(null != this._hierarchyInformation ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) this._hierarchyInformation.ToJson(null, serializationMode) : null, "hierarchyInformation", container.Add);
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._count ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNumber((int)this._count) : null, "count", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._productDoubleEncryptionStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonString(this._productDoubleEncryptionStatus.ToString()) : null, "productDoubleEncryptionStatus", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                if (null != this._deviceDetail)
                {
                    var __w = new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.XNodeArray();
                    foreach (var __x in this._deviceDetail)
                    {
                        AddIf(__x?.ToJson(null, serializationMode), __w.Add);
                    }
                    container.Add("deviceDetails", __w);
                }
            }
            AfterToJson(ref container);
            return(container);
        }
Ejemplo n.º 17
0
        /// <summary>
        /// Serializes this instance of <see cref="ProductLine" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.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.EdgeOrder.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="ProductLine" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonObject();

            bool returnNow = false;

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

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != this._shippingAddress ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) this._shippingAddress.ToJson(null, serializationMode) : null, "shippingAddress", container.Add);
            AddIf(null != this._contactDetail ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) this._contactDetail.ToJson(null, serializationMode) : null, "contactDetails", container.Add);
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._addressValidationStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonString(this._addressValidationStatus.ToString()) : null, "addressValidationStatus", container.Add);
            }
            AfterToJson(ref container);
            return(container);
        }
Ejemplo n.º 19
0
        /// <summary>
        /// Serializes this instance of <see cref="Dimensions" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.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.EdgeOrder.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="Dimensions" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._length ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNumber((double)this._length) : null, "length", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._height ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNumber((double)this._height) : null, "height", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._width ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNumber((double)this._width) : null, "width", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._lengthHeightUnit)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonString(this._lengthHeightUnit.ToString()) : null, "lengthHeightUnit", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._weight ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNumber((double)this._weight) : null, "weight", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._depth ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNumber((double)this._depth) : null, "depth", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._weightUnit)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonString(this._weightUnit.ToString()) : null, "weightUnit", container.Add);
            }
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="BasicInformation" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.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.EdgeOrder.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="BasicInformation" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._description ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) this._description.ToJson(null, serializationMode) : null, "description", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._costInformation ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) this._costInformation.ToJson(null, serializationMode) : null, "costInformation", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._availabilityInformation ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) this._availabilityInformation.ToJson(null, serializationMode) : null, "availabilityInformation", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._displayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonString(this._displayName.ToString()) : null, "displayName", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                if (null != this._imageInformation)
                {
                    var __w = new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.XNodeArray();
                    foreach (var __x in this._imageInformation)
                    {
                        AddIf(__x?.ToJson(null, serializationMode), __w.Add);
                    }
                    container.Add("imageInformation", __w);
                }
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._hierarchyInformation ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) this._hierarchyInformation.ToJson(null, serializationMode) : null, "hierarchyInformation", container.Add);
            }
            AfterToJson(ref container);
            return(container);
        }
Ejemplo n.º 21
0
        /// <summary>
        /// Serializes this instance of <see cref="ProductFamilyProperties" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.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.EdgeOrder.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="ProductFamilyProperties" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonObject();

            bool returnNow = false;

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

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != this._productDetail ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) this._productDetail.ToJson(null, serializationMode) : null, "productDetails", container.Add);
            AddIf(null != (((object)this._orderItemType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonString(this._orderItemType.ToString()) : null, "orderItemType", container.Add);
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._currentStage ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) this._currentStage.ToJson(null, serializationMode) : null, "currentStage", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                if (null != this._orderItemStageHistory)
                {
                    var __w = new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.XNodeArray();
                    foreach (var __x in this._orderItemStageHistory)
                    {
                        AddIf(__x?.ToJson(null, serializationMode), __w.Add);
                    }
                    container.Add("orderItemStageHistory", __w);
                }
            }
            AddIf(null != this._preference ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) this._preference.ToJson(null, serializationMode) : null, "preferences", container.Add);
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._forwardShippingDetail ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) this._forwardShippingDetail.ToJson(null, serializationMode) : null, "forwardShippingDetails", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._reverseShippingDetail ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) this._reverseShippingDetail.ToJson(null, serializationMode) : null, "reverseShippingDetails", container.Add);
            }
            if (null != this._notificationEmailList)
            {
                var __r = new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.XNodeArray();
                foreach (var __s in this._notificationEmailList)
                {
                    AddIf(null != (((object)__s)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonString(__s.ToString()) : null, __r.Add);
                }
                container.Add("notificationEmailList", __r);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._cancellationReason)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonString(this._cancellationReason.ToString()) : null, "cancellationReason", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._cancellationStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonString(this._cancellationStatus.ToString()) : null, "cancellationStatus", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._deletionStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonString(this._deletionStatus.ToString()) : null, "deletionStatus", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._returnReason)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonString(this._returnReason.ToString()) : null, "returnReason", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._returnStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonString(this._returnStatus.ToString()) : null, "returnStatus", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._managementRpDetail ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) this._managementRpDetail.ToJson(null, serializationMode) : null, "managementRpDetails", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                if (null != this._managementRpDetailsList)
                {
                    var __m = new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.XNodeArray();
                    foreach (var __n in this._managementRpDetailsList)
                    {
                        AddIf(__n?.ToJson(null, serializationMode), __m.Add);
                    }
                    container.Add("managementRpDetailsList", __m);
                }
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._error ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) this._error.ToJson(null, serializationMode) : null, "error", container.Add);
            }
            AfterToJson(ref container);
            return(container);
        }
Ejemplo n.º 23
0
        /// <summary>
        /// Serializes this instance of <see cref="Description" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.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.EdgeOrder.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="Description" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonString(this._type.ToString()) : null, "descriptionType", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._shortDescription)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonString(this._shortDescription.ToString()) : null, "shortDescription", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._longDescription)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonString(this._longDescription.ToString()) : null, "longDescription", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                if (null != this._keyword)
                {
                    var __w = new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.XNodeArray();
                    foreach (var __x in this._keyword)
                    {
                        AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonString(__x.ToString()) : null, __w.Add);
                    }
                    container.Add("keywords", __w);
                }
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                if (null != this._attribute)
                {
                    var __r = new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.XNodeArray();
                    foreach (var __s in this._attribute)
                    {
                        AddIf(null != (((object)__s)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.JsonString(__s.ToString()) : null, __r.Add);
                    }
                    container.Add("attributes", __r);
                }
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.SerializationMode.IncludeReadOnly))
            {
                if (null != this._link)
                {
                    var __m = new Microsoft.Azure.PowerShell.Cmdlets.EdgeOrder.Runtime.Json.XNodeArray();
                    foreach (var __n in this._link)
                    {
                        AddIf(__n?.ToJson(null, serializationMode), __m.Add);
                    }
                    container.Add("links", __m);
                }
            }
            AfterToJson(ref container);
            return(container);
        }