示例#1
0
        public static new AzureResource FromJsonElement(JsonElement element)
        {
            IpConfiguration resource = new IpConfiguration();

            resource.Description = element;

            // basic information
            resource.Name = element.GetProperty("name").GetString();
            resource.Type = element.GetProperty("type").GetString();

            JsonElement properties = element.GetProperty("properties");

            resource.PrivateIpAllocationMethod = properties.GetProperty("privateIPAllocationMethod").GetString();
            resource.PrivateIpAddressVersion   = properties.GetProperty("privateIPAddressVersion").GetString();
            resource.SubnetId = resource.GetSubnetReference(properties.GetProperty("subnet").GetProperty("id").GetString());

            return(resource);
        }
示例#2
0
        public static new AzureResource FromJsonElement(JsonElement element)
        {
            NetworkInterface resource = new NetworkInterface();

            resource.Description = element;

            // basic information
            resource.ID       = element.GetProperty("id").GetString();
            resource.Name     = element.GetProperty("name").GetString();
            resource.Type     = element.GetProperty("type").GetString();
            resource.Location = element.GetProperty("location").GetString();

            ArrayEnumerator e = element.GetProperty("properties").GetProperty("ipConfigurations").EnumerateArray();

            while (e.MoveNext())
            {
                IpConfiguration config = IpConfiguration.FromJsonElement(e.Current) as IpConfiguration;
                resource.IpConfigs.Add(config);
            }

            return(resource);
        }