Exemplo n.º 1
0
        internal static RoleAssignmentListResult DeserializeRoleAssignmentListResult(JsonElement element)
        {
            Optional <IReadOnlyList <RoleAssignment> > value = default;
            Optional <string> nextLink = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("value"))
                {
                    List <RoleAssignment> array = new List <RoleAssignment>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(RoleAssignment.DeserializeRoleAssignment(item));
                    }
                    value = array;
                    continue;
                }
                if (property.NameEquals("nextLink"))
                {
                    nextLink = property.Value.GetString();
                    continue;
                }
            }
            return(new RoleAssignmentListResult(Optional.ToList(value), nextLink.Value));
        }
Exemplo n.º 2
0
        internal static RoleAssignmentListResult DeserializeRoleAssignmentListResult(JsonElement element)
        {
            IReadOnlyList <RoleAssignment> value = default;
            string nextLink = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("value"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    List <RoleAssignment> array = new List <RoleAssignment>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        if (item.ValueKind == JsonValueKind.Null)
                        {
                            array.Add(null);
                        }
                        else
                        {
                            array.Add(RoleAssignment.DeserializeRoleAssignment(item));
                        }
                    }
                    value = array;
                    continue;
                }
                if (property.NameEquals("nextLink"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    nextLink = property.Value.GetString();
                    continue;
                }
            }
            return(new RoleAssignmentListResult(value, nextLink));
        }