/// <summary> /// Serializes this instance of <see cref="CloudErrorBody" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.MariaDb.Runtime.Json.JsonNode" />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.MariaDb.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.MariaDb.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="CloudErrorBody" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.MariaDb.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.MariaDb.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.MariaDb.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.MariaDb.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.MariaDb.Runtime.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return(container); } AddIf(null != (((object)this._code)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.MariaDb.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.MariaDb.Runtime.Json.JsonString(this._code.ToString()) : null, "code", container.Add); AddIf(null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.MariaDb.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.MariaDb.Runtime.Json.JsonString(this._message.ToString()) : null, "message", container.Add); AddIf(null != (((object)this._target)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.MariaDb.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.MariaDb.Runtime.Json.JsonString(this._target.ToString()) : null, "target", container.Add); if (null != this._detail) { var __w = new Microsoft.Azure.PowerShell.Cmdlets.MariaDb.Runtime.Json.XNodeArray(); foreach (var __x in this._detail) { AddIf(__x?.ToJson(null, serializationMode), __w.Add); } container.Add("details", __w); } AfterToJson(ref container); return(container); }
/// <summary> /// Serializes this instance of <see cref="VirtualNetworkRuleListResult" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.MariaDb.Runtime.Json.JsonNode" />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.MariaDb.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.MariaDb.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="VirtualNetworkRuleListResult" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.MariaDb.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.MariaDb.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.MariaDb.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.MariaDb.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.MariaDb.Runtime.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return(container); } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.MariaDb.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.MariaDb.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.MariaDb.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink", container.Add); } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.MariaDb.Runtime.SerializationMode.IncludeReadOnly)) { if (null != this._value) { var __w = new Microsoft.Azure.PowerShell.Cmdlets.MariaDb.Runtime.Json.XNodeArray(); foreach (var __x in this._value) { AddIf(__x?.ToJson(null, serializationMode), __w.Add); } container.Add("value", __w); } } AfterToJson(ref container); return(container); }
/// <summary> /// Serializes this instance of <see cref="PerformanceTierListResult" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.MariaDb.Runtime.Json.JsonNode" />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.MariaDb.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.MariaDb.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="PerformanceTierListResult" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.MariaDb.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.MariaDb.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.MariaDb.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.MariaDb.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.MariaDb.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.MariaDb.Runtime.Json.XNodeArray(); foreach (var __x in this._value) { AddIf(__x?.ToJson(null, serializationMode), __w.Add); } container.Add("value", __w); } AfterToJson(ref container); return(container); }
/// <summary> /// Serializes this instance of <see cref="SecurityAlertPolicyProperties" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.MariaDb.Runtime.Json.JsonNode" />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.MariaDb.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.MariaDb.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="SecurityAlertPolicyProperties" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.MariaDb.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.MariaDb.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.MariaDb.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.MariaDb.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.MariaDb.Runtime.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return(container); } AddIf(null != (((object)this._state)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.MariaDb.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.MariaDb.Runtime.Json.JsonString(this._state.ToString()) : null, "state", container.Add); if (null != this._disabledAlert) { var __w = new Microsoft.Azure.PowerShell.Cmdlets.MariaDb.Runtime.Json.XNodeArray(); foreach (var __x in this._disabledAlert) { AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.MariaDb.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.MariaDb.Runtime.Json.JsonString(__x.ToString()) : null, __w.Add); } container.Add("disabledAlerts", __w); } if (null != this._emailAddress) { var __r = new Microsoft.Azure.PowerShell.Cmdlets.MariaDb.Runtime.Json.XNodeArray(); foreach (var __s in this._emailAddress) { AddIf(null != (((object)__s)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.MariaDb.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.MariaDb.Runtime.Json.JsonString(__s.ToString()) : null, __r.Add); } container.Add("emailAddresses", __r); } AddIf(null != this._emailAccountAdmin ? (Microsoft.Azure.PowerShell.Cmdlets.MariaDb.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.MariaDb.Runtime.Json.JsonBoolean((bool)this._emailAccountAdmin) : null, "emailAccountAdmins", container.Add); AddIf(null != (((object)this._storageEndpoint)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.MariaDb.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.MariaDb.Runtime.Json.JsonString(this._storageEndpoint.ToString()) : null, "storageEndpoint", container.Add); AddIf(null != (((object)this._storageAccountAccessKey)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.MariaDb.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.MariaDb.Runtime.Json.JsonString(this._storageAccountAccessKey.ToString()) : null, "storageAccountAccessKey", container.Add); AddIf(null != this._retentionDay ? (Microsoft.Azure.PowerShell.Cmdlets.MariaDb.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.MariaDb.Runtime.Json.JsonNumber((int)this._retentionDay) : null, "retentionDays", container.Add); AfterToJson(ref container); return(container); }
/// <summary> /// Serializes this instance of <see cref="PerformanceTierProperties" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.MariaDb.Runtime.Json.JsonNode" />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.MariaDb.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.MariaDb.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="PerformanceTierProperties" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.MariaDb.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.MariaDb.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.MariaDb.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.MariaDb.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.MariaDb.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.MariaDb.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.MariaDb.Runtime.Json.JsonString(this._id.ToString()) : null, "id", container.Add); if (null != this._serviceLevelObjective) { var __w = new Microsoft.Azure.PowerShell.Cmdlets.MariaDb.Runtime.Json.XNodeArray(); foreach (var __x in this._serviceLevelObjective) { AddIf(__x?.ToJson(null, serializationMode), __w.Add); } container.Add("serviceLevelObjectives", __w); } AfterToJson(ref container); return(container); }