Example #1
0
        internal static AppDeploymentResourceData DeserializeAppDeploymentResourceData(JsonElement element)
        {
            Optional <DeploymentResourceProperties> properties = default;
            Optional <AppPlatformSku> sku = default;
            ResourceIdentifier        id  = default;
            string       name             = default;
            ResourceType type             = default;
            SystemData   systemData       = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("properties"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    properties = DeploymentResourceProperties.DeserializeDeploymentResourceProperties(property.Value);
                    continue;
                }
                if (property.NameEquals("sku"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    sku = AppPlatformSku.DeserializeAppPlatformSku(property.Value);
                    continue;
                }
                if (property.NameEquals("id"))
                {
                    id = new ResourceIdentifier(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    type = new ResourceType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("systemData"))
                {
                    systemData = JsonSerializer.Deserialize <SystemData>(property.Value.ToString());
                    continue;
                }
            }
            return(new AppDeploymentResourceData(id, name, type, systemData, properties.Value, sku.Value));
        }
Example #2
0
 internal AppDeploymentResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DeploymentResourceProperties properties, AppPlatformSku sku) : base(id, name, resourceType, systemData)
 {
     Properties = properties;
     Sku        = sku;
 }
Example #3
0
        internal static AppPlatformServiceResourceData DeserializeAppPlatformServiceResourceData(JsonElement element)
        {
            Optional <ClusterResourceProperties> properties = default;
            Optional <AppPlatformSku>            sku        = default;
            IDictionary <string, string>         tags       = default;
            AzureLocation      location   = default;
            ResourceIdentifier id         = default;
            string             name       = default;
            ResourceType       type       = default;
            SystemData         systemData = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("properties"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    properties = ClusterResourceProperties.DeserializeClusterResourceProperties(property.Value);
                    continue;
                }
                if (property.NameEquals("sku"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    sku = AppPlatformSku.DeserializeAppPlatformSku(property.Value);
                    continue;
                }
                if (property.NameEquals("tags"))
                {
                    Dictionary <string, string> dictionary = new Dictionary <string, string>();
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        dictionary.Add(property0.Name, property0.Value.GetString());
                    }
                    tags = dictionary;
                    continue;
                }
                if (property.NameEquals("location"))
                {
                    location = new AzureLocation(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("id"))
                {
                    id = new ResourceIdentifier(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    type = new ResourceType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("systemData"))
                {
                    systemData = JsonSerializer.Deserialize <SystemData>(property.Value.ToString());
                    continue;
                }
            }
            return(new AppPlatformServiceResourceData(id, name, type, systemData, tags, location, properties.Value, sku.Value));
        }
Example #4
0
 internal AppPlatformServiceResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary <string, string> tags, AzureLocation location, ClusterResourceProperties properties, AppPlatformSku sku) : base(id, name, resourceType, systemData, tags, location)
 {
     Properties = properties;
     Sku        = sku;
 }