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

            bool returnNow = false;

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

            bool returnNow = false;

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

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SerializationMode.IncludeReadOnly))
            {
                if (null != this._name)
                {
                    var __w = new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.XNodeArray();
                    foreach (var __x in this._name)
                    {
                        AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonString(__x.ToString()) : null, __w.Add);
                    }
                    container.Add("name", __w);
                }
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SerializationMode.IncludeReadOnly))
            {
                if (null != this._capability)
                {
                    var __r = new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.XNodeArray();
                    foreach (var __s in this._capability)
                    {
                        AddIf(__s?.ToJson(null, serializationMode), __r.Add);
                    }
                    container.Add("capabilities", __r);
                }
            }
            AfterToJson(ref container);
            return(container);
        }
예제 #5
0
        /// <summary>
        /// Serializes this instance of <see cref="Any" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.DiskPool.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.DiskPool.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="Any" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AfterToJson(ref container);
            return(container);
        }
예제 #6
0
        /// <summary>
        /// Serializes this instance of <see cref="DiskPool" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.DiskPool.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.DiskPool.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="DiskPool" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.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.DiskPool.Runtime.Json.JsonNode) this._sku.ToJson(null, serializationMode) : null, "sku", container.Add);
            AddIf(null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode) this._property.ToJson(null, serializationMode) : null, "properties", container.Add);
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode) this._systemData.ToJson(null, serializationMode) : null, "systemData", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._managedBy)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonString(this._managedBy.ToString()) : null, "managedBy", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SerializationMode.IncludeReadOnly))
            {
                if (null != this._managedByExtended)
                {
                    var __w = new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.XNodeArray();
                    foreach (var __x in this._managedByExtended)
                    {
                        AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonString(__x.ToString()) : null, __w.Add);
                    }
                    container.Add("managedByExtended", __w);
                }
            }
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="DiskPoolUpdateTags" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.DiskPool.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.DiskPool.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="DiskPoolUpdateTags" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonObject();

            bool returnNow = false;

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

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._code)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonString(this._code.ToString()) : null, "code", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonString(this._message.ToString()) : null, "message", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._target)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonString(this._target.ToString()) : null, "target", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SerializationMode.IncludeReadOnly))
            {
                if (null != this._detail)
                {
                    var __w = new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.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.DiskPool.Runtime.SerializationMode.IncludeReadOnly))
            {
                if (null != this._additionalInfo)
                {
                    var __r = new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.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);
        }
        /// <summary>
        /// Serializes this instance of <see cref="SystemMetadata" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.DiskPool.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.DiskPool.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="SystemMetadata" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.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.DiskPool.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonString(this._createdBy.ToString()) : null, "createdBy", container.Add);
            AddIf(null != (((object)this._createdByType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonString(this._createdByType.ToString()) : null, "createdByType", container.Add);
            AddIf(null != this._createdAt ? (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.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.DiskPool.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonString(this._lastModifiedBy.ToString()) : null, "lastModifiedBy", container.Add);
            AddIf(null != (((object)this._lastModifiedByType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonString(this._lastModifiedByType.ToString()) : null, "lastModifiedByType", container.Add);
            AddIf(null != this._lastModifiedAt ? (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.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);
        }
        /// <summary>
        /// Serializes this instance of <see cref="DiskPoolCreateProperties" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.DiskPool.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.DiskPool.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="DiskPoolCreateProperties" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (null != this._availabilityZone)
            {
                var __w = new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.XNodeArray();
                foreach (var __x in this._availabilityZone)
                {
                    AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonString(__x.ToString()) : null, __w.Add);
                }
                container.Add("availabilityZones", __w);
            }
            if (null != this._disk)
            {
                var __r = new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.XNodeArray();
                foreach (var __s in this._disk)
                {
                    AddIf(__s?.ToJson(null, serializationMode), __r.Add);
                }
                container.Add("disks", __r);
            }
            AddIf(null != (((object)this._subnetId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonString(this._subnetId.ToString()) : null, "subnetId", container.Add);
            if (null != this._additionalCapability)
            {
                var __m = new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.XNodeArray();
                foreach (var __n in this._additionalCapability)
                {
                    AddIf(null != (((object)__n)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonString(__n.ToString()) : null, __m.Add);
                }
                container.Add("additionalCapabilities", __m);
            }
            AfterToJson(ref container);
            return(container);
        }
예제 #11
0
        /// <summary>
        /// Serializes this instance of <see cref="ResourceSkuInfo" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.DiskPool.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.DiskPool.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="ResourceSkuInfo" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._locationInfo ? (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode) this._locationInfo.ToJson(null, serializationMode) : null, "locationInfo", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._apiVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonString(this._apiVersion.ToString()) : null, "apiVersion", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._resourceType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonString(this._resourceType.ToString()) : null, "resourceType", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SerializationMode.IncludeReadOnly))
            {
                if (null != this._capability)
                {
                    var __w = new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.XNodeArray();
                    foreach (var __x in this._capability)
                    {
                        AddIf(__x?.ToJson(null, serializationMode), __w.Add);
                    }
                    container.Add("capabilities", __w);
                }
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonString(this._name.ToString()) : null, "name", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._tier)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonString(this._tier.ToString()) : null, "tier", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SerializationMode.IncludeReadOnly))
            {
                if (null != this._restriction)
                {
                    var __r = new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.XNodeArray();
                    foreach (var __s in this._restriction)
                    {
                        AddIf(__s?.ToJson(null, serializationMode), __r.Add);
                    }
                    container.Add("restrictions", __r);
                }
            }
            AfterToJson(ref container);
            return(container);
        }
예제 #12
0
        /// <summary>
        /// Serializes this instance of <see cref="DiskPoolCreate" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.DiskPool.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.DiskPool.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="DiskPoolCreate" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != this._sku ? (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode) this._sku.ToJson(null, serializationMode) : null, "sku", container.Add);
            AddIf(null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode) this._property.ToJson(null, serializationMode) : null, "properties", container.Add);
            AddIf(null != this._tag ? (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode) this._tag.ToJson(null, serializationMode) : null, "tags", container.Add);
            AddIf(null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonString(this._location.ToString()) : null, "location", container.Add);
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonString(this._id.ToString()) : null, "id", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonString(this._name.ToString()) : null, "name", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonString(this._type.ToString()) : null, "type", container.Add);
            }
            AfterToJson(ref container);
            return(container);
        }
예제 #13
0
        /// <summary>
        /// Serializes this instance of <see cref="IscsiLun" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.DiskPool.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.DiskPool.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="IscsiLun" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.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.DiskPool.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonString(this._name.ToString()) : null, "name", container.Add);
            AddIf(null != (((object)this._managedDiskAzureResourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonString(this._managedDiskAzureResourceId.ToString()) : null, "managedDiskAzureResourceId", container.Add);
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._lun ? (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNumber((int)this._lun) : null, "lun", container.Add);
            }
            AfterToJson(ref container);
            return(container);
        }
예제 #14
0
        /// <summary>
        /// Serializes this instance of <see cref="ResourceSkuRestrictions" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.DiskPool.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.DiskPool.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="ResourceSkuRestrictions" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonObject();

            bool returnNow = false;

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

            bool returnNow = false;

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

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != (((object)this._iPAddress)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonString(this._iPAddress.ToString()) : null, "ipAddress", container.Add);
            AddIf(null != this._port ? (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNumber((int)this._port) : null, "port", container.Add);
            AddIf(null != this._latency ? (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNumber((double)this._latency) : null, "latency", container.Add);
            AddIf(null != this._isAccessible ? (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonBoolean((bool)this._isAccessible) : null, "isAccessible", container.Add);
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="IscsiTargetCreateProperties" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.DiskPool.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.DiskPool.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="IscsiTargetCreateProperties" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != (((object)this._aclMode)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonString(this._aclMode.ToString()) : null, "aclMode", container.Add);
            AddIf(null != (((object)this._targetIqn)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonString(this._targetIqn.ToString()) : null, "targetIqn", container.Add);
            if (null != this._staticAcls)
            {
                var __w = new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.XNodeArray();
                foreach (var __x in this._staticAcls)
                {
                    AddIf(__x?.ToJson(null, serializationMode), __w.Add);
                }
                container.Add("staticAcls", __w);
            }
            if (null != this._lun)
            {
                var __r = new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.XNodeArray();
                foreach (var __s in this._lun)
                {
                    AddIf(__s?.ToJson(null, serializationMode), __r.Add);
                }
                container.Add("luns", __r);
            }
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="DiskPoolIdentity" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.DiskPool.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.DiskPool.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="DiskPoolIdentity" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.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.DiskPool.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonString(this._subscriptionId.ToString()) : null, "subscriptionId", container.Add);
            AddIf(null != (((object)this._resourceGroupName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonString(this._resourceGroupName.ToString()) : null, "resourceGroupName", container.Add);
            AddIf(null != (((object)this._diskPoolName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonString(this._diskPoolName.ToString()) : null, "diskPoolName", container.Add);
            AddIf(null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonString(this._location.ToString()) : null, "location", container.Add);
            AddIf(null != (((object)this._iscsiTargetName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonString(this._iscsiTargetName.ToString()) : null, "iscsiTargetName", container.Add);
            AddIf(null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonString(this._id.ToString()) : null, "id", container.Add);
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="ErrorAdditionalInfo" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.DiskPool.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.DiskPool.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="ErrorAdditionalInfo" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonObject();

            bool returnNow = false;

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

            bool returnNow = false;

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

            bool returnNow = false;

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

            bool returnNow = false;

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

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != (((object)this._aclMode)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonString(this._aclMode.ToString()) : null, "aclMode", container.Add);
            if (null != this._staticAcls)
            {
                var __w = new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.XNodeArray();
                foreach (var __x in this._staticAcls)
                {
                    AddIf(__x?.ToJson(null, serializationMode), __w.Add);
                }
                container.Add("staticAcls", __w);
            }
            if (null != this._lun)
            {
                var __r = new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.XNodeArray();
                foreach (var __s in this._lun)
                {
                    AddIf(__s?.ToJson(null, serializationMode), __r.Add);
                }
                container.Add("luns", __r);
            }
            AddIf(null != (((object)this._targetIqn)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonString(this._targetIqn.ToString()) : null, "targetIqn", container.Add);
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState", container.Add);
            }
            AddIf(null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonString(this._status.ToString()) : null, "status", container.Add);
            if (null != this._endpoint)
            {
                var __m = new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.XNodeArray();
                foreach (var __n in this._endpoint)
                {
                    AddIf(null != (((object)__n)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonString(__n.ToString()) : null, __m.Add);
                }
                container.Add("endpoints", __m);
            }
            AddIf(null != this._port ? (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNumber((int)this._port) : null, "port", container.Add);
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.SerializationMode.IncludeReadOnly))
            {
                if (null != this._session)
                {
                    var __h = new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.XNodeArray();
                    foreach (var __i in this._session)
                    {
                        AddIf(null != (((object)__i)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Runtime.Json.JsonString(__i.ToString()) : null, __h.Add);
                    }
                    container.Add("sessions", __h);
                }
            }
            AfterToJson(ref container);
            return(container);
        }