/// <summary> /// Serializes this instance of <see cref="ConfigurationStoreUpdateParameters" /> into a <see cref="Microsoft.Azure.AzConfig.Runtime.Json.JsonNode" /// />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.AzConfig.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.AzConfig.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="ConfigurationStoreUpdateParameters" /> as a <see cref="Microsoft.Azure.AzConfig.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.AzConfig.Runtime.Json.JsonNode ToJson(Microsoft.Azure.AzConfig.Runtime.Json.JsonObject container, Microsoft.Azure.AzConfig.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.AzConfig.Runtime.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return(container); } AddIf(null != Properties ? (Microsoft.Azure.AzConfig.Runtime.Json.JsonNode)Properties.ToJson(null) : null, "properties", container.Add); if (null != Tag) { var __u = new Microsoft.Azure.AzConfig.Runtime.Json.JsonObject(); container.Add("tags", __u); foreach (var __x in Tag.Keys) { var __v = Tag[__x]; AddIf(null != (((object)(__v as string))?.ToString()) ? (Microsoft.Azure.AzConfig.Runtime.Json.JsonNode) new Microsoft.Azure.AzConfig.Runtime.Json.JsonString((__v as string).ToString()) : null, (__w) => __u.Add(__x as string, __w)); } } AfterToJson(ref container); return(container); }
/// <summary> /// Serializes this instance of <see cref="Resource" /> into a <see cref="Microsoft.Azure.AzConfig.Runtime.Json.JsonNode" />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.AzConfig.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.AzConfig.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="Resource" /> as a <see cref="Microsoft.Azure.AzConfig.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.AzConfig.Runtime.Json.JsonNode ToJson(Microsoft.Azure.AzConfig.Runtime.Json.JsonObject container, Microsoft.Azure.AzConfig.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.AzConfig.Runtime.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return(container); } if (serializationMode.HasFlag(Microsoft.Azure.AzConfig.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)Name)?.ToString()) ? (Microsoft.Azure.AzConfig.Runtime.Json.JsonNode) new Microsoft.Azure.AzConfig.Runtime.Json.JsonString(Name.ToString()) : null, "name", container.Add); } if (serializationMode.HasFlag(Microsoft.Azure.AzConfig.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)Type)?.ToString()) ? (Microsoft.Azure.AzConfig.Runtime.Json.JsonNode) new Microsoft.Azure.AzConfig.Runtime.Json.JsonString(Type.ToString()) : null, "type", container.Add); } if (serializationMode.HasFlag(Microsoft.Azure.AzConfig.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)Id)?.ToString()) ? (Microsoft.Azure.AzConfig.Runtime.Json.JsonNode) new Microsoft.Azure.AzConfig.Runtime.Json.JsonString(Id.ToString()) : null, "id", container.Add); } AddIf(null != (((object)Location)?.ToString()) ? (Microsoft.Azure.AzConfig.Runtime.Json.JsonNode) new Microsoft.Azure.AzConfig.Runtime.Json.JsonString(Location.ToString()) : null, "location", container.Add); if (null != Tag) { var __u = new Microsoft.Azure.AzConfig.Runtime.Json.JsonObject(); container.Add("tags", __u); foreach (var __x in Tag.Keys) { var __v = Tag[__x]; AddIf(null != (((object)(__v as string))?.ToString()) ? (Microsoft.Azure.AzConfig.Runtime.Json.JsonNode) new Microsoft.Azure.AzConfig.Runtime.Json.JsonString((__v as string).ToString()) : null, (__w) => __u.Add(__x as string, __w)); } } AfterToJson(ref container); return(container); }
/// <summary> /// Serializes this instance of <see cref="OperationDefinitionListResult" /> into a <see cref="Microsoft.Azure.AzConfig.Runtime.Json.JsonNode" />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.AzConfig.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.AzConfig.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="OperationDefinitionListResult" /> as a <see cref="Microsoft.Azure.AzConfig.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.AzConfig.Runtime.Json.JsonNode ToJson(Microsoft.Azure.AzConfig.Runtime.Json.JsonObject container, Microsoft.Azure.AzConfig.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.AzConfig.Runtime.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return(container); } AddIf(null != (((object)NextLink)?.ToString()) ? (Microsoft.Azure.AzConfig.Runtime.Json.JsonNode) new Microsoft.Azure.AzConfig.Runtime.Json.JsonString(NextLink.ToString()) : null, "nextLink", container.Add); if (null != Value) { var __w = new Microsoft.Azure.AzConfig.Runtime.Json.XNodeArray(); foreach (var __x in Value) { AddIf(__x?.ToJson(null), __w.Add); } container.Add("value", __w); } AfterToJson(ref container); return(container); }