internal ResourceGroupPatchable(string name, ResourceGroupProperties properties, string managedBy, IDictionary <string, string> tags)
 {
     Name       = name;
     Properties = properties;
     ManagedBy  = managedBy;
     Tags       = tags;
 }
Ejemplo n.º 2
0
 internal ResourceGroup(string id, string name, ResourceGroupProperties properties, string location, string managedBy, IDictionary <string, string> tags)
 {
     Id         = id;
     Name       = name;
     Properties = properties;
     Location   = location;
     ManagedBy  = managedBy;
     Tags       = tags;
 }
Ejemplo n.º 3
0
        internal static ResourceGroup DeserializeResourceGroup(JsonElement element)
        {
            string id   = default;
            string name = default;
            ResourceGroupProperties properties = default;
            string location  = default;
            string managedBy = default;
            IDictionary <string, string> tags = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("id"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    id = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    properties = ResourceGroupProperties.DeserializeResourceGroupProperties(property.Value);
                    continue;
                }
                if (property.NameEquals("location"))
                {
                    location = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("managedBy"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    managedBy = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("tags"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    Dictionary <string, string> dictionary = new Dictionary <string, string>();
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.Value.ValueKind == JsonValueKind.Null)
                        {
                            dictionary.Add(property0.Name, null);
                        }
                        else
                        {
                            dictionary.Add(property0.Name, property0.Value.GetString());
                        }
                    }
                    tags = dictionary;
                    continue;
                }
            }
            return(new ResourceGroup(id, name, properties, location, managedBy, tags));
        }