예제 #1
0
        internal static SecurityGroupNetworkInterface DeserializeSecurityGroupNetworkInterface(JsonElement element)
        {
            Optional <SecurityRuleAssociations> securityRuleAssociations = default;
            ResourceIdentifier id = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("securityRuleAssociations"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    securityRuleAssociations = SecurityRuleAssociations.DeserializeSecurityRuleAssociations(property.Value);
                    continue;
                }
                if (property.NameEquals("id"))
                {
                    id = property.Value.GetString();
                    continue;
                }
            }
            return(new SecurityGroupNetworkInterface(id, securityRuleAssociations.Value));
        }
        internal static SecurityGroupNetworkInterface DeserializeSecurityGroupNetworkInterface(JsonElement element)
        {
            string id = default;
            SecurityRuleAssociations securityRuleAssociations = 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("securityRuleAssociations"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    securityRuleAssociations = SecurityRuleAssociations.DeserializeSecurityRuleAssociations(property.Value);
                    continue;
                }
            }
            return(new SecurityGroupNetworkInterface(id, securityRuleAssociations));
        }
예제 #3
0
        internal static SecurityGroupNetworkInterface DeserializeSecurityGroupNetworkInterface(JsonElement element)
        {
            Optional <string> id = default;
            Optional <SecurityRuleAssociations> securityRuleAssociations = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("id"))
                {
                    id = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("securityRuleAssociations"))
                {
                    securityRuleAssociations = SecurityRuleAssociations.DeserializeSecurityRuleAssociations(property.Value);
                    continue;
                }
            }
            return(new SecurityGroupNetworkInterface(id.Value, securityRuleAssociations.Value));
        }
 internal SecurityGroupNetworkInterface(string id, SecurityRuleAssociations securityRuleAssociations) : base(id)
 {
     SecurityRuleAssociations = securityRuleAssociations;
 }