示例#1
0
        internal static BastionShareableLinkListResult DeserializeBastionShareableLinkListResult(JsonElement element)
        {
            Optional <IReadOnlyList <BastionShareableLink> > value = default;
            Optional <string> nextLink = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("value"))
                {
                    List <BastionShareableLink> array = new List <BastionShareableLink>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(BastionShareableLink.DeserializeBastionShareableLink(item));
                    }
                    value = array;
                    continue;
                }
                if (property.NameEquals("nextLink"))
                {
                    nextLink = property.Value.GetString();
                    continue;
                }
            }
            return(new BastionShareableLinkListResult(Optional.ToList(value), nextLink.Value));
        }
示例#2
0
        internal static BastionShareableLinkListResult DeserializeBastionShareableLinkListResult(JsonElement element)
        {
            IReadOnlyList <BastionShareableLink> value = default;
            string nextLink = default;

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