/// <summary> /// Serializes this instance of <see cref="NameAvailabilityStatus" /> 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="NameAvailabilityStatus" /> 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)Message)?.ToString()) ? (Microsoft.Azure.AzConfig.Runtime.Json.JsonNode) new Microsoft.Azure.AzConfig.Runtime.Json.JsonString(Message.ToString()) : null, "message", container.Add); } if (serializationMode.HasFlag(Microsoft.Azure.AzConfig.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != NameAvailable ? (Microsoft.Azure.AzConfig.Runtime.Json.JsonNode) new Microsoft.Azure.AzConfig.Runtime.Json.JsonBoolean((bool)NameAvailable) : null, "nameAvailable", container.Add); } if (serializationMode.HasFlag(Microsoft.Azure.AzConfig.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)Reason)?.ToString()) ? (Microsoft.Azure.AzConfig.Runtime.Json.JsonNode) new Microsoft.Azure.AzConfig.Runtime.Json.JsonString(Reason.ToString()) : null, "reason", container.Add); } AfterToJson(ref container); return(container); }
/// <summary> /// Serializes this instance of <see cref="ConfigurationStoreProperties" /> 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="ConfigurationStoreProperties" /> 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 != CreationDate ? (Microsoft.Azure.AzConfig.Runtime.Json.JsonNode) new Microsoft.Azure.AzConfig.Runtime.Json.JsonString(CreationDate?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK", System.Globalization.CultureInfo.InvariantCulture)) : null, "creationDate", container.Add); } if (serializationMode.HasFlag(Microsoft.Azure.AzConfig.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)Endpoint)?.ToString()) ? (Microsoft.Azure.AzConfig.Runtime.Json.JsonNode) new Microsoft.Azure.AzConfig.Runtime.Json.JsonString(Endpoint.ToString()) : null, "endpoint", container.Add); } if (serializationMode.HasFlag(Microsoft.Azure.AzConfig.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)ProvisioningState)?.ToString()) ? (Microsoft.Azure.AzConfig.Runtime.Json.JsonNode) new Microsoft.Azure.AzConfig.Runtime.Json.JsonString(ProvisioningState.ToString()) : null, "provisioningState", container.Add); } 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="OperationDefinitionDisplay" /> 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="OperationDefinitionDisplay" /> 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)Description)?.ToString()) ? (Microsoft.Azure.AzConfig.Runtime.Json.JsonNode) new Microsoft.Azure.AzConfig.Runtime.Json.JsonString(Description.ToString()) : null, "description", container.Add); AddIf(null != (((object)Operation)?.ToString()) ? (Microsoft.Azure.AzConfig.Runtime.Json.JsonNode) new Microsoft.Azure.AzConfig.Runtime.Json.JsonString(Operation.ToString()) : null, "operation", container.Add); if (serializationMode.HasFlag(Microsoft.Azure.AzConfig.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)Provider)?.ToString()) ? (Microsoft.Azure.AzConfig.Runtime.Json.JsonNode) new Microsoft.Azure.AzConfig.Runtime.Json.JsonString(Provider.ToString()) : null, "provider", container.Add); } AddIf(null != (((object)Resource)?.ToString()) ? (Microsoft.Azure.AzConfig.Runtime.Json.JsonNode) new Microsoft.Azure.AzConfig.Runtime.Json.JsonString(Resource.ToString()) : null, "resource", container.Add); AfterToJson(ref container); return(container); }
/// <summary> /// Serializes this instance of <see cref="ApiKey" /> 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="ApiKey" /> 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)ConnectionString)?.ToString()) ? (Microsoft.Azure.AzConfig.Runtime.Json.JsonNode) new Microsoft.Azure.AzConfig.Runtime.Json.JsonString(ConnectionString.ToString()) : null, "connectionString", 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); } if (serializationMode.HasFlag(Microsoft.Azure.AzConfig.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != LastModified ? (Microsoft.Azure.AzConfig.Runtime.Json.JsonNode) new Microsoft.Azure.AzConfig.Runtime.Json.JsonString(LastModified?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK", System.Globalization.CultureInfo.InvariantCulture)) : null, "lastModified", container.Add); } if (serializationMode.HasFlag(Microsoft.Azure.AzConfig.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != ReadOnly ? (Microsoft.Azure.AzConfig.Runtime.Json.JsonNode) new Microsoft.Azure.AzConfig.Runtime.Json.JsonBoolean((bool)ReadOnly) : null, "readOnly", container.Add); } if (serializationMode.HasFlag(Microsoft.Azure.AzConfig.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)Value)?.ToString()) ? (Microsoft.Azure.AzConfig.Runtime.Json.JsonNode) new Microsoft.Azure.AzConfig.Runtime.Json.JsonString(Value.ToString()) : null, "value", container.Add); } AfterToJson(ref container); return(container); }