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

            bool returnNow = false;

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

            bool returnNow = false;

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

            bool returnNow = false;

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

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != (((object)this._subscriptionId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonString(this._subscriptionId.ToString()) : null, "subscriptionId", container.Add);
            AddIf(null != (((object)this._resourceGroupName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonString(this._resourceGroupName.ToString()) : null, "resourceGroupName", container.Add);
            AddIf(null != (((object)this._accountName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonString(this._accountName.ToString()) : null, "accountName", container.Add);
            AddIf(null != (((object)this._creatorName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonString(this._creatorName.ToString()) : null, "creatorName", container.Add);
            AddIf(null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonString(this._id.ToString()) : null, "id", container.Add);
            AfterToJson(ref container);
            return(container);
        }
Esempio n. 6
0
        /// <summary>
        /// Serializes this instance of <see cref="OperationDisplay" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.Maps.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.Maps.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="OperationDisplay" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonObject();

            bool returnNow = false;

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

            bool returnNow = false;

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

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            __resource?.ToJson(container, serializationMode);
            AddIf(null != this._tag ? (Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonNode) this._tag.ToJson(null, serializationMode) : null, "tags", container.Add);
            AddIf(null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonString(this._location.ToString()) : null, "location", container.Add);
            AfterToJson(ref container);
            return(container);
        }
Esempio n. 9
0
        /// <summary>
        /// Serializes this instance of <see cref="MapsAccount" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.Maps.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.Maps.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="MapsAccount" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonObject();

            bool returnNow = false;

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

            bool returnNow = false;
            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return container;
            }
            AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add );
            AddIf( null != (((object)this._displayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonString(this._displayName.ToString()) : null, "displayName" ,container.Add );
            AddIf( null != (((object)this._displayDescription)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonString(this._displayDescription.ToString()) : null, "displayDescription" ,container.Add );
            AddIf( null != (((object)this._unit)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonString(this._unit.ToString()) : null, "unit" ,container.Add );
            if (null != this._dimension)
            {
                var __w = new Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.XNodeArray();
                foreach( var __x in this._dimension )
                {
                    AddIf(__x?.ToJson(null, serializationMode) ,__w.Add);
                }
                container.Add("dimensions",__w);
            }
            AddIf( null != (((object)this._aggregationType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonString(this._aggregationType.ToString()) : null, "aggregationType" ,container.Add );
            AddIf( null != this._fillGapWithZero ? (Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonBoolean((bool)this._fillGapWithZero) : null, "fillGapWithZero" ,container.Add );
            AddIf( null != (((object)this._category)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonString(this._category.ToString()) : null, "category" ,container.Add );
            AddIf( null != (((object)this._resourceIdDimensionNameOverride)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonString(this._resourceIdDimensionNameOverride.ToString()) : null, "resourceIdDimensionNameOverride" ,container.Add );
            AfterToJson(ref container);
            return container;
        }
Esempio n. 11
0
        /// <summary>
        /// Serializes this instance of <see cref="SystemData" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.Maps.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.Maps.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="SystemData" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Maps.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.Maps.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonString(this._createdBy.ToString()) : null, "createdBy", container.Add);
            AddIf(null != (((object)this._createdByType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonString(this._createdByType.ToString()) : null, "createdByType", container.Add);
            AddIf(null != this._createdAt ? (Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Maps.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.Maps.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonString(this._lastModifiedBy.ToString()) : null, "lastModifiedBy", container.Add);
            AddIf(null != (((object)this._lastModifiedByType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonString(this._lastModifiedByType.ToString()) : null, "lastModifiedByType", container.Add);
            AddIf(null != this._lastModifiedAt ? (Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Maps.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);
        }
Esempio n. 12
0
        /// <summary>
        /// Serializes this instance of <see cref="Any" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.Maps.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.Maps.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="Any" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AfterToJson(ref container);
            return(container);
        }
Esempio n. 13
0
        /// <summary>
        /// Serializes this instance of <see cref="MapsAccountKeys" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.Maps.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.Maps.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="MapsAccountKeys" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._primaryKeyLastUpdated)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonString(this._primaryKeyLastUpdated.ToString()) : null, "primaryKeyLastUpdated", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._primaryKey)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonString(this._primaryKey.ToString()) : null, "primaryKey", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._secondaryKey)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonString(this._secondaryKey.ToString()) : null, "secondaryKey", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._secondaryKeyLastUpdated)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonString(this._secondaryKeyLastUpdated.ToString()) : null, "secondaryKeyLastUpdated", container.Add);
            }
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="MapsAccountProperties" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.Maps.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.Maps.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="MapsAccountProperties" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._uniqueId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonString(this._uniqueId.ToString()) : null, "uniqueId", container.Add);
            }
            AddIf(null != this._disableLocalAuth ? (Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonBoolean((bool)this._disableLocalAuth) : null, "disableLocalAuth", container.Add);
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState", container.Add);
            }
            AfterToJson(ref container);
            return(container);
        }
Esempio n. 15
0
        /// <summary>
        /// Serializes this instance of <see cref="CreatorProperties" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.Maps.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.Maps.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="CreatorProperties" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonObject();

            bool returnNow = false;

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

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != (((object)this._keyType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonString(this._keyType.ToString()) : null, "keyType", container.Add);
            AfterToJson(ref container);
            return(container);
        }
Esempio n. 17
0
        /// <summary>
        /// Serializes this instance of <see cref="ErrorDetail" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.Maps.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.Maps.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="ErrorDetail" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonObject();

            bool returnNow = false;

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

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.JsonSerializable.ToJson(((Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.IAssociativeArray <string>) this).AdditionalProperties, container);
            AfterToJson(ref container);
            return(container);
        }
Esempio n. 19
0
        /// <summary>
        /// Serializes this instance of <see cref="Dimension" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.Maps.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.Maps.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="Dimension" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonString(this._name.ToString()) : null, "name", container.Add);
            AddIf(null != (((object)this._displayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonString(this._displayName.ToString()) : null, "displayName", container.Add);
            AddIf(null != (((object)this._internalName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonString(this._internalName.ToString()) : null, "internalName", container.Add);
            AddIf(null != (((object)this._internalMetricName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonString(this._internalMetricName.ToString()) : null, "internalMetricName", container.Add);
            AddIf(null != (((object)this._sourceMdmNamespace)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonString(this._sourceMdmNamespace.ToString()) : null, "sourceMdmNamespace", container.Add);
            AddIf(null != this._toBeExportedToShoebox ? (Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Maps.Runtime.Json.JsonBoolean((bool)this._toBeExportedToShoebox) : null, "toBeExportedToShoebox", container.Add);
            AfterToJson(ref container);
            return(container);
        }