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

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.JsonSerializable.ToJson(((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IAssociativeArray <string>) this).AdditionalProperties, container);
            AfterToJson(ref container);
            return(container);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Serializes this instance of <see cref="AzureBareMetalInstancesListResult" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="AzureBareMetalInstancesListResult" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.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.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink", container.Add);
            AfterToJson(ref container);
            return(container);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Serializes this instance of <see cref="Operation" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="Operation" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject();

            bool returnNow = false;

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

            bool returnNow = false;

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

            bool returnNow = false;

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

            bool returnNow = false;

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

            bool returnNow = false;

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

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != this._hardwareProfile ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) this._hardwareProfile.ToJson(null, serializationMode) : null, "hardwareProfile", container.Add);
            AddIf(null != this._storageProfile ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) this._storageProfile.ToJson(null, serializationMode) : null, "storageProfile", container.Add);
            AddIf(null != this._oSProfile ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) this._oSProfile.ToJson(null, serializationMode) : null, "osProfile", container.Add);
            AddIf(null != this._networkProfile ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) this._networkProfile.ToJson(null, serializationMode) : null, "networkProfile", container.Add);
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._azureBareMetalInstanceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._azureBareMetalInstanceId.ToString()) : null, "azureBareMetalInstanceId", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._powerState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._powerState.ToString()) : null, "powerState", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._proximityPlacementGroup)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._proximityPlacementGroup.ToString()) : null, "proximityPlacementGroup", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._hwRevision)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._hwRevision.ToString()) : null, "hwRevision", container.Add);
            }
            AddIf(null != (((object)this._partnerNodeId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._partnerNodeId.ToString()) : null, "partnerNodeId", container.Add);
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState", container.Add);
            }
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="HardwareProfile" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="HardwareProfile" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._hardwareType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._hardwareType.ToString()) : null, "hardwareType", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._azureBareMetalInstanceSize)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._azureBareMetalInstanceSize.ToString()) : null, "azureBareMetalInstanceSize", container.Add);
            }
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="TrackedResource" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="TrackedResource" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.Json.JsonNode) this._tag.ToJson(null, serializationMode) : null, "tags", container.Add);
            AddIf(null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._location.ToString()) : null, "location", container.Add);
            AfterToJson(ref container);
            return(container);
        }
Ejemplo n.º 11
0
        /// <summary>
        /// Serializes this instance of <see cref="Disk" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="Disk" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._name.ToString()) : null, "name", container.Add);
            AddIf(null != this._sizeGb ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNumber((int)this._sizeGb) : null, "diskSizeGB", container.Add);
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._lun ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNumber((int)this._lun) : null, "lun", container.Add);
            }
            AfterToJson(ref container);
            return(container);
        }
Ejemplo n.º 12
0
        /// <summary>
        /// Serializes this instance of <see cref="ErrorResponse" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="ErrorResponse" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != this._error ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) this._error.ToJson(null, serializationMode) : null, "error", container.Add);
            AfterToJson(ref container);
            return(container);
        }
Ejemplo n.º 13
0
        /// <summary>
        /// Serializes this instance of <see cref="SystemData" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="SystemData" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._createdBy.ToString()) : null, "createdBy", container.Add);
            AddIf(null != (((object)this._createdByType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._createdByType.ToString()) : null, "createdByType", container.Add);
            AddIf(null != this._createdAt ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._lastModifiedBy.ToString()) : null, "lastModifiedBy", container.Add);
            AddIf(null != (((object)this._lastModifiedByType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._lastModifiedByType.ToString()) : null, "lastModifiedByType", container.Add);
            AddIf(null != this._lastModifiedAt ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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="BareMetalIdentity" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="BareMetalIdentity" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._subscriptionId.ToString()) : null, "subscriptionId", container.Add);
            AddIf(null != (((object)this._resourceGroupName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._resourceGroupName.ToString()) : null, "resourceGroupName", container.Add);
            AddIf(null != (((object)this._azureBareMetalInstanceName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._azureBareMetalInstanceName.ToString()) : null, "azureBareMetalInstanceName", container.Add);
            AddIf(null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._id.ToString()) : null, "id", container.Add);
            AfterToJson(ref container);
            return(container);
        }
Ejemplo n.º 15
0
        /// <summary>
        /// Serializes this instance of <see cref="AzureBareMetalInstance" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="AzureBareMetalInstance" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject();

            bool returnNow = false;

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