/// <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="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>Constructor for deserialization.</summary> /// <param name="json">a <see cref="Microsoft.Azure.AzConfig.Runtime.Json.JsonObject" /> to deserialize from.</param> internal RemoveAzConfigurationStore_ResourceGroupNameConfigStoreName(Microsoft.Azure.AzConfig.Runtime.Json.JsonObject json) { // deserialize the contents _subscriptionId = If(json?.PropertyT <Microsoft.Azure.AzConfig.Runtime.Json.JsonString>("SubscriptionId"), out var __jsonSubscriptionId) ? (string)__jsonSubscriptionId : (string)SubscriptionId; _resourceGroupName = If(json?.PropertyT <Microsoft.Azure.AzConfig.Runtime.Json.JsonString>("ResourceGroupName"), out var __jsonResourceGroupName) ? (string)__jsonResourceGroupName : (string)ResourceGroupName; _configStoreName = If(json?.PropertyT <Microsoft.Azure.AzConfig.Runtime.Json.JsonString>("ConfigStoreName"), out var __jsonConfigStoreName) ? (string)__jsonConfigStoreName : (string)ConfigStoreName; }
/// <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>Constructor for deserialization.</summary> /// <param name="json">a <see cref="Microsoft.Azure.AzConfig.Runtime.Json.JsonObject" /> to deserialize from.</param> internal GetAzConfigurationStore_ResourceGroupResourceGroupNameSkipToken(Microsoft.Azure.AzConfig.Runtime.Json.JsonObject json) { // deserialize the contents _subscriptionId = If(json?.PropertyT <Microsoft.Azure.AzConfig.Runtime.Json.JsonString>("SubscriptionId"), out var __jsonSubscriptionId) ? (string)__jsonSubscriptionId : (string)SubscriptionId; _resourceGroupName = If(json?.PropertyT <Microsoft.Azure.AzConfig.Runtime.Json.JsonString>("ResourceGroupName"), out var __jsonResourceGroupName) ? (string)__jsonResourceGroupName : (string)ResourceGroupName; _skipToken = If(json?.PropertyT <Microsoft.Azure.AzConfig.Runtime.Json.JsonString>("SkipToken"), out var __jsonSkipToken) ? (string)__jsonSkipToken : (string)SkipToken; }
/// <summary> /// Serializes the state of this cmdlet to a <see cref="Microsoft.Azure.AzConfig.Runtime.Json.JsonNode" /> object. /// </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="GetAzConfigurationStore_SubscriptionId" /> 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) { // serialization method container = container ?? new Microsoft.Azure.AzConfig.Runtime.Json.JsonObject(); AddIf(null != (((object)SubscriptionId)?.ToString()) ? (Microsoft.Azure.AzConfig.Runtime.Json.JsonNode) new Microsoft.Azure.AzConfig.Runtime.Json.JsonString(SubscriptionId.ToString()) : null, "SubscriptionId", container.Add); return(container); }
/// <summary>Constructor for deserialization.</summary> /// <param name="json">a <see cref="Microsoft.Azure.AzConfig.Runtime.Json.JsonObject" /> to deserialize from.</param> internal NewAzConfigurationStoreKey_KeyResourceGroupNameConfigStoreNameId(Microsoft.Azure.AzConfig.Runtime.Json.JsonObject json) { // deserialize the contents _subscriptionId = If(json?.PropertyT <Microsoft.Azure.AzConfig.Runtime.Json.JsonString>("SubscriptionId"), out var __jsonSubscriptionId) ? (string)__jsonSubscriptionId : (string)SubscriptionId; _resourceGroupName = If(json?.PropertyT <Microsoft.Azure.AzConfig.Runtime.Json.JsonString>("ResourceGroupName"), out var __jsonResourceGroupName) ? (string)__jsonResourceGroupName : (string)ResourceGroupName; _configStoreName = If(json?.PropertyT <Microsoft.Azure.AzConfig.Runtime.Json.JsonString>("ConfigStoreName"), out var __jsonConfigStoreName) ? (string)__jsonConfigStoreName : (string)ConfigStoreName; _regenerateKeyParameters = If(json?.PropertyT <Microsoft.Azure.AzConfig.Runtime.Json.JsonObject>("RegenerateKeyParameters"), out var __jsonRegenerateKeyParameters) ? Microsoft.Azure.AzConfig.Models.RegenerateKeyParameters.FromJson(__jsonRegenerateKeyParameters) : RegenerateKeyParameters; }
/// <summary> /// Serializes the state of this cmdlet to a <see cref="Microsoft.Azure.AzConfig.Runtime.Json.JsonNode" /> object. /// </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="UpdateAzConfigurationStore_ResourceGroupNameConfigStoreNamePropertiesTags" /> 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) { // serialization method container = container ?? new Microsoft.Azure.AzConfig.Runtime.Json.JsonObject(); AddIf(null != (((object)SubscriptionId)?.ToString()) ? (Microsoft.Azure.AzConfig.Runtime.Json.JsonNode) new Microsoft.Azure.AzConfig.Runtime.Json.JsonString(SubscriptionId.ToString()) : null, "SubscriptionId", container.Add); AddIf(null != (((object)ResourceGroupName)?.ToString()) ? (Microsoft.Azure.AzConfig.Runtime.Json.JsonNode) new Microsoft.Azure.AzConfig.Runtime.Json.JsonString(ResourceGroupName.ToString()) : null, "ResourceGroupName", container.Add); AddIf(null != (((object)ConfigStoreName)?.ToString()) ? (Microsoft.Azure.AzConfig.Runtime.Json.JsonNode) new Microsoft.Azure.AzConfig.Runtime.Json.JsonString(ConfigStoreName.ToString()) : null, "ConfigStoreName", container.Add); AddIf(null != ConfigStoreUpdateParameters ? (Microsoft.Azure.AzConfig.Runtime.Json.JsonNode)ConfigStoreUpdateParameters.ToJson(null) : null, "ConfigStoreUpdateParameters", container.Add); return(container); }
/// <summary> /// Deserializes a Microsoft.Azure.AzConfig.Runtime.Json.JsonObject into a new instance of <see cref="Error" />. /// </summary> /// <param name="json">A Microsoft.Azure.AzConfig.Runtime.Json.JsonObject instance to deserialize from.</param> internal Error(Microsoft.Azure.AzConfig.Runtime.Json.JsonObject json) { bool returnNow = false; BeforeFromJson(json, ref returnNow); if (returnNow) { return; } _errorProperty = If(json?.PropertyT <Microsoft.Azure.AzConfig.Runtime.Json.JsonObject>("error"), out var __jsonError) ? Microsoft.Azure.AzConfig.Models.ErrorProperties.FromJson(__jsonError) : ErrorProperty; AfterFromJson(json); }
/// <summary> /// Deserializes a Microsoft.Azure.AzConfig.Runtime.Json.JsonObject into a new instance of <see cref="ConfigurationStorePropertiesUpdateParameters" /// />. /// </summary> /// <param name="json">A Microsoft.Azure.AzConfig.Runtime.Json.JsonObject instance to deserialize from.</param> internal ConfigurationStorePropertiesUpdateParameters(Microsoft.Azure.AzConfig.Runtime.Json.JsonObject json) { bool returnNow = false; BeforeFromJson(json, ref returnNow); if (returnNow) { return; } _enabled = If(json?.PropertyT <Microsoft.Azure.AzConfig.Runtime.Json.JsonBoolean>("enabled"), out var __jsonEnabled) ? (bool?)__jsonEnabled : Enabled; AfterFromJson(json); }
/// <summary> /// Deserializes a Microsoft.Azure.AzConfig.Runtime.Json.JsonObject into a new instance of <see cref="RegenerateKeyParameters" />. /// </summary> /// <param name="json">A Microsoft.Azure.AzConfig.Runtime.Json.JsonObject instance to deserialize from.</param> internal RegenerateKeyParameters(Microsoft.Azure.AzConfig.Runtime.Json.JsonObject json) { bool returnNow = false; BeforeFromJson(json, ref returnNow); if (returnNow) { return; } _id = If(json?.PropertyT <Microsoft.Azure.AzConfig.Runtime.Json.JsonString>("id"), out var __jsonId) ? (string)__jsonId : (string)Id; AfterFromJson(json); }
/// <summary> /// Deserializes a Microsoft.Azure.AzConfig.Runtime.Json.JsonObject into a new instance of <see cref="ConfigurationStoreUpdateParameters" />. /// </summary> /// <param name="json">A Microsoft.Azure.AzConfig.Runtime.Json.JsonObject instance to deserialize from.</param> internal ConfigurationStoreUpdateParameters(Microsoft.Azure.AzConfig.Runtime.Json.JsonObject json) { bool returnNow = false; BeforeFromJson(json, ref returnNow); if (returnNow) { return; } _properties = If(json?.PropertyT <Microsoft.Azure.AzConfig.Runtime.Json.JsonObject>("properties"), out var __jsonProperties) ? Microsoft.Azure.AzConfig.Models.ConfigurationStorePropertiesUpdateParameters.FromJson(__jsonProperties) : Properties; _tag = /* 1 */ new System.Collections.Hashtable(System.Linq.Enumerable.ToDictionary <string, string, string>(json.Property("tags")?.Keys ?? System.Linq.Enumerable.Empty <string>(), each => each, each => json.Property("tags").PropertyT <Microsoft.Azure.AzConfig.Runtime.Json.JsonNode>(each) is Microsoft.Azure.AzConfig.Runtime.Json.JsonString __t ? (string)__t : null)); AfterFromJson(json); }
/// <summary> /// Deserializes a Microsoft.Azure.AzConfig.Runtime.Json.JsonObject into a new instance of <see cref="OperationDefinition" />. /// </summary> /// <param name="json">A Microsoft.Azure.AzConfig.Runtime.Json.JsonObject instance to deserialize from.</param> internal OperationDefinition(Microsoft.Azure.AzConfig.Runtime.Json.JsonObject json) { bool returnNow = false; BeforeFromJson(json, ref returnNow); if (returnNow) { return; } _name = If(json?.PropertyT <Microsoft.Azure.AzConfig.Runtime.Json.JsonString>("name"), out var __jsonName) ? (string)__jsonName : (string)Name; _display = If(json?.PropertyT <Microsoft.Azure.AzConfig.Runtime.Json.JsonObject>("display"), out var __jsonDisplay) ? Microsoft.Azure.AzConfig.Models.OperationDefinitionDisplay.FromJson(__jsonDisplay) : Display; AfterFromJson(json); }
/// <summary> /// Deserializes a Microsoft.Azure.AzConfig.Runtime.Json.JsonObject into a new instance of <see cref="ErrorProperties" />. /// </summary> /// <param name="json">A Microsoft.Azure.AzConfig.Runtime.Json.JsonObject instance to deserialize from.</param> internal ErrorProperties(Microsoft.Azure.AzConfig.Runtime.Json.JsonObject json) { bool returnNow = false; BeforeFromJson(json, ref returnNow); if (returnNow) { return; } _code = If(json?.PropertyT <Microsoft.Azure.AzConfig.Runtime.Json.JsonString>("code"), out var __jsonCode) ? (string)__jsonCode : (string)Code; _message = If(json?.PropertyT <Microsoft.Azure.AzConfig.Runtime.Json.JsonString>("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message; AfterFromJson(json); }
/// <summary> /// Deserializes a Microsoft.Azure.AzConfig.Runtime.Json.JsonObject into a new instance of <see cref="CheckNameAvailabilityParameters" />. /// </summary> /// <param name="json">A Microsoft.Azure.AzConfig.Runtime.Json.JsonObject instance to deserialize from.</param> internal CheckNameAvailabilityParameters(Microsoft.Azure.AzConfig.Runtime.Json.JsonObject json) { bool returnNow = false; BeforeFromJson(json, ref returnNow); if (returnNow) { return; } _name = If(json?.PropertyT <Microsoft.Azure.AzConfig.Runtime.Json.JsonString>("name"), out var __jsonName) ? (string)__jsonName : (string)Name; _type = If(json?.PropertyT <Microsoft.Azure.AzConfig.Runtime.Json.JsonString>("type"), out var __jsonType) ? (string)__jsonType : (string)Type; AfterFromJson(json); }
/// <summary> /// Deserializes a Microsoft.Azure.AzConfig.Runtime.Json.JsonObject into a new instance of <see cref="ConfigurationStore" />. /// </summary> /// <param name="json">A Microsoft.Azure.AzConfig.Runtime.Json.JsonObject instance to deserialize from.</param> internal ConfigurationStore(Microsoft.Azure.AzConfig.Runtime.Json.JsonObject json) { bool returnNow = false; BeforeFromJson(json, ref returnNow); if (returnNow) { return; } _resource = new Microsoft.Azure.AzConfig.Models.Resource(json); _properties = If(json?.PropertyT <Microsoft.Azure.AzConfig.Runtime.Json.JsonObject>("properties"), out var __jsonProperties) ? Microsoft.Azure.AzConfig.Models.ConfigurationStoreProperties.FromJson(__jsonProperties) : Properties; AfterFromJson(json); }
/// <summary> /// Deserializes a Microsoft.Azure.AzConfig.Runtime.Json.JsonObject into a new instance of <see cref="OperationDefinitionListResult" />. /// </summary> /// <param name="json">A Microsoft.Azure.AzConfig.Runtime.Json.JsonObject instance to deserialize from.</param> internal OperationDefinitionListResult(Microsoft.Azure.AzConfig.Runtime.Json.JsonObject json) { bool returnNow = false; BeforeFromJson(json, ref returnNow); if (returnNow) { return; } _nextLink = If(json?.PropertyT <Microsoft.Azure.AzConfig.Runtime.Json.JsonString>("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink; _value = If(json?.PropertyT <Microsoft.Azure.AzConfig.Runtime.Json.JsonArray>("value"), out var __jsonValue) ? If(__jsonValue, out var __v) ? new System.Func <Microsoft.Azure.AzConfig.Models.IOperationDefinition[]>(() => System.Linq.Enumerable.ToArray(System.Linq.Enumerable.Select(__v, (__u) => (Microsoft.Azure.AzConfig.Models.IOperationDefinition)(Microsoft.Azure.AzConfig.Models.OperationDefinition.FromJson(__u)))))() : null : Value; AfterFromJson(json); }
/// <summary> /// Deserializes a Microsoft.Azure.AzConfig.Runtime.Json.JsonObject into a new instance of <see cref="NameAvailabilityStatus" />. /// </summary> /// <param name="json">A Microsoft.Azure.AzConfig.Runtime.Json.JsonObject instance to deserialize from.</param> internal NameAvailabilityStatus(Microsoft.Azure.AzConfig.Runtime.Json.JsonObject json) { bool returnNow = false; BeforeFromJson(json, ref returnNow); if (returnNow) { return; } _message = If(json?.PropertyT <Microsoft.Azure.AzConfig.Runtime.Json.JsonString>("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message; _nameAvailable = If(json?.PropertyT <Microsoft.Azure.AzConfig.Runtime.Json.JsonBoolean>("nameAvailable"), out var __jsonNameAvailable) ? (bool?)__jsonNameAvailable : NameAvailable; _reason = If(json?.PropertyT <Microsoft.Azure.AzConfig.Runtime.Json.JsonString>("reason"), out var __jsonReason) ? (string)__jsonReason : (string)Reason; AfterFromJson(json); }
/// <summary> /// Deserializes a Microsoft.Azure.AzConfig.Runtime.Json.JsonObject into a new instance of <see cref="ConfigurationStoreProperties" />. /// </summary> /// <param name="json">A Microsoft.Azure.AzConfig.Runtime.Json.JsonObject instance to deserialize from.</param> internal ConfigurationStoreProperties(Microsoft.Azure.AzConfig.Runtime.Json.JsonObject json) { bool returnNow = false; BeforeFromJson(json, ref returnNow); if (returnNow) { return; } _creationDate = If(json?.PropertyT <Microsoft.Azure.AzConfig.Runtime.Json.JsonString>("creationDate"), out var __jsonCreationDate) ? System.DateTime.TryParse((string)__jsonCreationDate, System.Globalization.CultureInfo.InvariantCulture, System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreationDateValue) ? __jsonCreationDateValue : CreationDate : CreationDate; _endpoint = If(json?.PropertyT <Microsoft.Azure.AzConfig.Runtime.Json.JsonString>("endpoint"), out var __jsonEndpoint) ? (string)__jsonEndpoint : (string)Endpoint; _provisioningState = If(json?.PropertyT <Microsoft.Azure.AzConfig.Runtime.Json.JsonString>("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState; AfterFromJson(json); }
/// <summary> /// Deserializes a Microsoft.Azure.AzConfig.Runtime.Json.JsonObject into a new instance of <see cref="OperationDefinitionDisplay" />. /// </summary> /// <param name="json">A Microsoft.Azure.AzConfig.Runtime.Json.JsonObject instance to deserialize from.</param> internal OperationDefinitionDisplay(Microsoft.Azure.AzConfig.Runtime.Json.JsonObject json) { bool returnNow = false; BeforeFromJson(json, ref returnNow); if (returnNow) { return; } _description = If(json?.PropertyT <Microsoft.Azure.AzConfig.Runtime.Json.JsonString>("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description; _operation = If(json?.PropertyT <Microsoft.Azure.AzConfig.Runtime.Json.JsonString>("operation"), out var __jsonOperation) ? (string)__jsonOperation : (string)Operation; _provider = If(json?.PropertyT <Microsoft.Azure.AzConfig.Runtime.Json.JsonString>("provider"), out var __jsonProvider) ? (string)__jsonProvider : (string)Provider; _resource = If(json?.PropertyT <Microsoft.Azure.AzConfig.Runtime.Json.JsonString>("resource"), out var __jsonResource) ? (string)__jsonResource : (string)Resource; AfterFromJson(json); }
/// <summary> /// Serializes this instance of <see cref="RegenerateKeyParameters" /> 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="RegenerateKeyParameters" /> 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)Id)?.ToString()) ? (Microsoft.Azure.AzConfig.Runtime.Json.JsonNode) new Microsoft.Azure.AzConfig.Runtime.Json.JsonString(Id.ToString()) : null, "id", container.Add); AfterToJson(ref container); return(container); }
/// <summary> /// Serializes this instance of <see cref="ConfigurationStorePropertiesUpdateParameters" /> 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="ConfigurationStorePropertiesUpdateParameters" /> 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 != Enabled ? (Microsoft.Azure.AzConfig.Runtime.Json.JsonNode) new Microsoft.Azure.AzConfig.Runtime.Json.JsonBoolean((bool)Enabled) : null, "enabled", container.Add); AfterToJson(ref container); return(container); }
/// <summary> /// Serializes this instance of <see cref="Error" /> 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="Error" /> 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 != ErrorProperty ? (Microsoft.Azure.AzConfig.Runtime.Json.JsonNode)ErrorProperty.ToJson(null) : null, "error", container.Add); AfterToJson(ref container); return(container); }
/// <summary> /// Serializes this instance of <see cref="ConfigurationStore" /> 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="ConfigurationStore" /> 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); } _resource?.ToJson(container, serializationMode); AddIf(null != Properties ? (Microsoft.Azure.AzConfig.Runtime.Json.JsonNode)Properties.ToJson(null) : null, "properties", container.Add); AfterToJson(ref container); return(container); }
/// <summary> /// Deserializes a Microsoft.Azure.AzConfig.Runtime.Json.JsonObject into a new instance of <see cref="Resource" />. /// </summary> /// <param name="json">A Microsoft.Azure.AzConfig.Runtime.Json.JsonObject instance to deserialize from.</param> internal Resource(Microsoft.Azure.AzConfig.Runtime.Json.JsonObject json) { bool returnNow = false; BeforeFromJson(json, ref returnNow); if (returnNow) { return; } _name = If(json?.PropertyT <Microsoft.Azure.AzConfig.Runtime.Json.JsonString>("name"), out var __jsonName) ? (string)__jsonName : (string)Name; _type = If(json?.PropertyT <Microsoft.Azure.AzConfig.Runtime.Json.JsonString>("type"), out var __jsonType) ? (string)__jsonType : (string)Type; _id = If(json?.PropertyT <Microsoft.Azure.AzConfig.Runtime.Json.JsonString>("id"), out var __jsonId) ? (string)__jsonId : (string)Id; _location = If(json?.PropertyT <Microsoft.Azure.AzConfig.Runtime.Json.JsonString>("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)Location; _tag = /* 1 */ new System.Collections.Hashtable(System.Linq.Enumerable.ToDictionary <string, string, string>(json.Property("tags")?.Keys ?? System.Linq.Enumerable.Empty <string>(), each => each, each => json.Property("tags").PropertyT <Microsoft.Azure.AzConfig.Runtime.Json.JsonNode>(each) is Microsoft.Azure.AzConfig.Runtime.Json.JsonString __t ? (string)__t : null)); AfterFromJson(json); }
/// <summary> /// Deserializes a Microsoft.Azure.AzConfig.Runtime.Json.JsonObject into a new instance of <see cref="ApiKey" />. /// </summary> /// <param name="json">A Microsoft.Azure.AzConfig.Runtime.Json.JsonObject instance to deserialize from.</param> internal ApiKey(Microsoft.Azure.AzConfig.Runtime.Json.JsonObject json) { bool returnNow = false; BeforeFromJson(json, ref returnNow); if (returnNow) { return; } _name = If(json?.PropertyT <Microsoft.Azure.AzConfig.Runtime.Json.JsonString>("name"), out var __jsonName) ? (string)__jsonName : (string)Name; _connectionString = If(json?.PropertyT <Microsoft.Azure.AzConfig.Runtime.Json.JsonString>("connectionString"), out var __jsonConnectionString) ? (string)__jsonConnectionString : (string)ConnectionString; _id = If(json?.PropertyT <Microsoft.Azure.AzConfig.Runtime.Json.JsonString>("id"), out var __jsonId) ? (string)__jsonId : (string)Id; _lastModified = If(json?.PropertyT <Microsoft.Azure.AzConfig.Runtime.Json.JsonString>("lastModified"), out var __jsonLastModified) ? System.DateTime.TryParse((string)__jsonLastModified, System.Globalization.CultureInfo.InvariantCulture, System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastModifiedValue) ? __jsonLastModifiedValue : LastModified : LastModified; _readOnly = If(json?.PropertyT <Microsoft.Azure.AzConfig.Runtime.Json.JsonBoolean>("readOnly"), out var __jsonReadOnly) ? (bool?)__jsonReadOnly : ReadOnly; _value = If(json?.PropertyT <Microsoft.Azure.AzConfig.Runtime.Json.JsonString>("value"), out var __jsonValue) ? (string)__jsonValue : (string)Value; AfterFromJson(json); }
/// <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); }
/// <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); }